2019-05-02 22:45:40 +00:00
|
|
|
|
/*
|
|
|
|
|
* Copyright 2019 faddenSoft
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
2019-07-20 20:28:10 +00:00
|
|
|
|
namespace SourceGen {
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// Subclass of Symbol used for symbols defined in a platform symbol file, in the project
|
|
|
|
|
/// symbol table, or in a local variable table.
|
2019-08-25 00:35:26 +00:00
|
|
|
|
///
|
2019-08-26 23:58:53 +00:00
|
|
|
|
/// Instances are immutable, except for the Xrefs field.
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// </summary>
|
2019-08-26 23:58:53 +00:00
|
|
|
|
/// <remarks>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// The Xrefs field isn't really part of the object. It's just convenient to access
|
2019-08-26 23:58:53 +00:00
|
|
|
|
/// them from here.
|
|
|
|
|
/// </remarks>
|
2019-05-02 22:45:40 +00:00
|
|
|
|
public class DefSymbol : Symbol {
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
// Absolute min/max width. Zero-page variables are more limited, because they're not
|
|
|
|
|
// allowed to wrap around the end of the page.
|
2019-08-26 00:25:15 +00:00
|
|
|
|
public const int MIN_WIDTH = 1;
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
public const int MAX_WIDTH = 65536;
|
|
|
|
|
|
|
|
|
|
// Value to pass to the FormatDescriptor when no width is given.
|
|
|
|
|
private const int DEFAULT_WIDTH = 1;
|
2019-08-25 21:14:44 +00:00
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Data format descriptor.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public FormatDescriptor DataDescriptor { get; private set; }
|
|
|
|
|
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// True if a width was specified for this symbol.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// All symbols have a positive width, stored in the FormatDescriptor Length property.
|
|
|
|
|
/// We may not want to display widths that haven't been explicitly set, however, so we
|
|
|
|
|
/// keep track here.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public bool HasWidth { get; private set; }
|
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// User-supplied comment.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Comment { get; private set; }
|
|
|
|
|
|
2019-08-25 00:35:26 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Platform symbols only: tag used to organize symbols into groups. Used by
|
|
|
|
|
/// extension scripts.
|
Allow explicit widths in project/platform symbols, part 3
Implement multi-byte project/platform symbols by filling out a table
of addresses. Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority. This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.
The bounds on project/platform symbols are now rigidly defined. If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.
The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.
Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win. Now, the symbol
defined in the most-recently-loaded file wins. (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.) This allows the user to pick the winner by
arranging the load order of the platform symbol files.
Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.
These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses. The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky. (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)
Also, re-enabled some unit tests.
Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 23:26:05 +00:00
|
|
|
|
///
|
|
|
|
|
/// Not serialized.
|
2019-08-25 00:35:26 +00:00
|
|
|
|
/// </summary>
|
2019-05-02 22:45:40 +00:00
|
|
|
|
public string Tag { get; private set; }
|
|
|
|
|
|
Allow explicit widths in project/platform symbols, part 3
Implement multi-byte project/platform symbols by filling out a table
of addresses. Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority. This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.
The bounds on project/platform symbols are now rigidly defined. If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.
The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.
Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win. Now, the symbol
defined in the most-recently-loaded file wins. (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.) This allows the user to pick the winner by
arranging the load order of the platform symbol files.
Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.
These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses. The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky. (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)
Also, re-enabled some unit tests.
Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 23:26:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Platform symbols only: this indicates the position of the defining platform symbol
|
|
|
|
|
/// file in the set of symbol files. Higher numbers mean higher priority.
|
|
|
|
|
///
|
|
|
|
|
/// Not serialized.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int LoadOrdinal { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Platform symbols only: external file identifier for the platform symbol file that
|
|
|
|
|
/// defined this symbol. Can be displayed to the user in the Info panel.
|
|
|
|
|
///
|
|
|
|
|
/// Not serialized.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string FileIdentifier { get; private set; }
|
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// I/O direction enumeration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// The numeric value determines the sort order in the Symbols window. See the Compare
|
|
|
|
|
/// function over in Symbol.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum DirectionFlags {
|
|
|
|
|
None = 0,
|
|
|
|
|
Read = 1 << 1,
|
|
|
|
|
Write = 1 << 2,
|
|
|
|
|
ReadWrite = Read | Write
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// I/O direction, used for memory-mapped I/O locations that have different meanings
|
|
|
|
|
/// (and hence different symbols) depending on whether they're read or written.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DirectionFlags Direction { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-10-16 21:55:10 +00:00
|
|
|
|
/// Bit masks for symbols that represent multiple addresses. Instances are immutable.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Given an integer "addr" to test:
|
|
|
|
|
/// <code>
|
|
|
|
|
/// if ((addr & CompareMask) == CompareValue &&
|
|
|
|
|
/// (addr & AddressMask) == (Value & AddressMask)) {
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// // match!
|
|
|
|
|
/// }
|
2019-10-16 21:55:10 +00:00
|
|
|
|
/// </code>
|
|
|
|
|
/// </remarks>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
public class MultiAddressMask {
|
|
|
|
|
public int CompareMask { get; private set; }
|
|
|
|
|
public int CompareValue { get; private set; }
|
|
|
|
|
public int AddressMask { get; private set; }
|
|
|
|
|
|
|
|
|
|
public MultiAddressMask(int cmpMask, int cmpValue, int addrMask) {
|
|
|
|
|
CompareMask = cmpMask;
|
|
|
|
|
CompareValue = cmpValue;
|
|
|
|
|
AddressMask = addrMask;
|
|
|
|
|
}
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
return "MultiAddrMask: cmpMask=$" + CompareMask.ToString("x4") +
|
|
|
|
|
" cmpValue=$" + CompareValue.ToString("x4") +
|
|
|
|
|
" addrMask=$" + AddressMask.ToString("x4");
|
|
|
|
|
}
|
2019-10-16 21:55:10 +00:00
|
|
|
|
public static bool operator ==(MultiAddressMask a, MultiAddressMask b) {
|
|
|
|
|
if (ReferenceEquals(a, b)) {
|
|
|
|
|
return true; // same object, or both null
|
|
|
|
|
}
|
|
|
|
|
if (ReferenceEquals(a, null) || ReferenceEquals(b, null)) {
|
|
|
|
|
return false; // one is null
|
|
|
|
|
}
|
|
|
|
|
return a.CompareMask == b.CompareMask && a.CompareValue == b.CompareValue &&
|
|
|
|
|
a.AddressMask == b.AddressMask;
|
|
|
|
|
}
|
|
|
|
|
public static bool operator !=(MultiAddressMask a, MultiAddressMask b) {
|
|
|
|
|
return !(a == b);
|
|
|
|
|
}
|
|
|
|
|
public override bool Equals(object obj) {
|
|
|
|
|
return obj is MultiAddressMask && this == (MultiAddressMask)obj;
|
|
|
|
|
}
|
|
|
|
|
public override int GetHashCode() {
|
|
|
|
|
return CompareMask ^ CompareValue ^ AddressMask;
|
|
|
|
|
}
|
2019-10-15 23:37:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Bit masks to apply when performing comparisons. Useful when more than one address
|
|
|
|
|
/// maps to the same thing (e.g. Atari 2600 registers).
|
|
|
|
|
///
|
|
|
|
|
/// Will be null if no mask is specified.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public MultiAddressMask MultiMask { get; private set; }
|
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cross-reference data, generated by the analyzer.
|
|
|
|
|
/// </summary>
|
2019-08-26 23:58:53 +00:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This is just a convenient place to reference some data generated at run-time. It's
|
|
|
|
|
/// not serialized, and not included in the test for equality.
|
|
|
|
|
/// </remarks>
|
2019-05-02 22:45:40 +00:00
|
|
|
|
public XrefSet Xrefs { get; private set; }
|
|
|
|
|
|
2019-08-26 23:58:53 +00:00
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// Internal base-object (Symbol) constructor, called by other constructors.
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// </summary>
|
2019-11-09 04:44:45 +00:00
|
|
|
|
private DefSymbol(string label, int value, Source source, Type type,
|
|
|
|
|
LabelAnnotation labelAnno)
|
|
|
|
|
: base(label, value, source, type, labelAnno) {
|
2019-08-26 23:58:53 +00:00
|
|
|
|
Debug.Assert(source == Source.Platform || source == Source.Project ||
|
|
|
|
|
source == Source.Variable);
|
2019-05-02 22:45:40 +00:00
|
|
|
|
Debug.Assert(type == Type.ExternalAddr || type == Type.Constant);
|
|
|
|
|
Xrefs = new XrefSet();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// Constructor. Limited form, used in a couple of places, e.g. when we need to start
|
|
|
|
|
/// with a default value. The symbol will have unspecified width, ReadWrite direction,
|
|
|
|
|
/// and no mask.
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="label">Symbol's label.</param>
|
|
|
|
|
/// <param name="value">Symbol's value.</param>
|
|
|
|
|
/// <param name="source">Symbol source (general point of origin).</param>
|
|
|
|
|
/// <param name="type">Symbol type.</param>
|
|
|
|
|
/// <param name="formatSubType">Format descriptor sub-type, so we know how the
|
|
|
|
|
/// user wants the value to be displayed.</param>
|
|
|
|
|
public DefSymbol(string label, int value, Source source, Type type,
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
FormatDescriptor.SubType formatSubType)
|
2019-11-09 04:44:45 +00:00
|
|
|
|
: this(label, value, source, type, LabelAnnotation.None, formatSubType, -1, false,
|
2019-10-15 23:37:14 +00:00
|
|
|
|
string.Empty, DirectionFlags.ReadWrite, null, string.Empty) { }
|
2019-05-02 22:45:40 +00:00
|
|
|
|
|
2019-08-26 00:25:15 +00:00
|
|
|
|
/// <summary>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// Constructor. General form.
|
2019-08-26 00:25:15 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="label">Symbol's label.</param>
|
|
|
|
|
/// <param name="value">Symbol's value.</param>
|
|
|
|
|
/// <param name="source">Symbol source (general point of origin).</param>
|
|
|
|
|
/// <param name="type">Symbol type.</param>
|
|
|
|
|
/// <param name="formatSubType">Format descriptor sub-type, so we know how the
|
|
|
|
|
/// user wants the value to be displayed.</param>
|
|
|
|
|
/// <param name="width">Variable width.</param>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// <param name="widthSpecified">True if width was explicitly specified. If this is
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// <param name="comment">End-of-line comment.</param>
|
|
|
|
|
/// <param name="direction">I/O direction.</param>
|
|
|
|
|
/// <param name="multiMask">Bit mask to apply before comparisons.</param>
|
|
|
|
|
/// <param name="tag">Symbol tag, used for grouping platform symbols.</param>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// false, the value of the "width" argument is ignored.</param>
|
2019-08-26 00:25:15 +00:00
|
|
|
|
public DefSymbol(string label, int value, Source source, Type type,
|
2019-11-09 04:44:45 +00:00
|
|
|
|
LabelAnnotation labelAnno, FormatDescriptor.SubType formatSubType,
|
|
|
|
|
int width, bool widthSpecified, string comment,
|
|
|
|
|
DirectionFlags direction, MultiAddressMask multiMask, string tag)
|
|
|
|
|
: this(label, value, source, type, labelAnno) {
|
2019-08-26 23:58:53 +00:00
|
|
|
|
Debug.Assert(comment != null);
|
|
|
|
|
Debug.Assert(tag != null);
|
|
|
|
|
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
if (widthSpecified && type == Type.Constant && source != Source.Variable) {
|
|
|
|
|
// non-variable constants don't have a width; override arg
|
|
|
|
|
Debug.WriteLine("Overriding constant DefSymbol width");
|
|
|
|
|
widthSpecified = false;
|
|
|
|
|
}
|
|
|
|
|
HasWidth = widthSpecified;
|
|
|
|
|
if (!widthSpecified) {
|
|
|
|
|
width = DEFAULT_WIDTH;
|
|
|
|
|
}
|
|
|
|
|
Debug.Assert(width >= MIN_WIDTH && width <= MAX_WIDTH);
|
|
|
|
|
|
2019-08-26 23:58:53 +00:00
|
|
|
|
DataDescriptor = FormatDescriptor.Create(width,
|
|
|
|
|
FormatDescriptor.Type.NumericLE, formatSubType);
|
|
|
|
|
Comment = comment;
|
2019-10-15 23:37:14 +00:00
|
|
|
|
|
|
|
|
|
Debug.Assert(((int)direction & ~(int)DirectionFlags.ReadWrite) == 0);
|
|
|
|
|
Direction = direction;
|
|
|
|
|
|
2019-10-18 23:19:42 +00:00
|
|
|
|
// constants don't have masks
|
|
|
|
|
if (type != Type.Constant) {
|
|
|
|
|
MultiMask = multiMask;
|
|
|
|
|
}
|
2019-10-15 23:37:14 +00:00
|
|
|
|
|
2019-08-26 23:58:53 +00:00
|
|
|
|
Tag = tag;
|
2019-08-26 00:25:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
Allow explicit widths in project/platform symbols, part 3
Implement multi-byte project/platform symbols by filling out a table
of addresses. Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority. This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.
The bounds on project/platform symbols are now rigidly defined. If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.
The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.
Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win. Now, the symbol
defined in the most-recently-loaded file wins. (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.) This allows the user to pick the winner by
arranging the load order of the platform symbol files.
Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.
These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses. The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky. (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)
Also, re-enabled some unit tests.
Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 23:26:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Constructor. Used for platform symbol files.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="loadOrdinal">Indicates the order in which the defining platform
|
|
|
|
|
/// symbol file was loaded. Higher numbers indicate later loading, which translates
|
|
|
|
|
/// to higher priority.</param>
|
|
|
|
|
/// <param name="fileIdent">Platform symbol file identifier, for the Info panel.</param>
|
|
|
|
|
public DefSymbol(string label, int value, Source source, Type type,
|
2019-10-15 23:37:14 +00:00
|
|
|
|
FormatDescriptor.SubType formatSubType, int width, bool widthSpecified,
|
|
|
|
|
string comment, DirectionFlags direction, MultiAddressMask multiMask, string tag,
|
|
|
|
|
int loadOrdinal, string fileIdent)
|
2019-11-09 04:44:45 +00:00
|
|
|
|
: this(label, value, source, type, LabelAnnotation.None, formatSubType,
|
|
|
|
|
width, widthSpecified, comment, direction, multiMask, tag) {
|
Allow explicit widths in project/platform symbols, part 3
Implement multi-byte project/platform symbols by filling out a table
of addresses. Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority. This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.
The bounds on project/platform symbols are now rigidly defined. If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.
The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.
Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win. Now, the symbol
defined in the most-recently-loaded file wins. (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.) This allows the user to pick the winner by
arranging the load order of the platform symbol files.
Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.
These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses. The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky. (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)
Also, re-enabled some unit tests.
Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 23:26:05 +00:00
|
|
|
|
LoadOrdinal = loadOrdinal;
|
|
|
|
|
FileIdentifier = fileIdent;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <summary>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// Create a DefSymbol given a Symbol, FormatDescriptor, and a few other things. Used
|
|
|
|
|
/// for deserialization.
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sym">Base symbol.</param>
|
|
|
|
|
/// <param name="dfd">Format descriptor.</param>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
/// <param name="widthSpecified">Set if a width was explicitly specified.</param>
|
2019-05-02 22:45:40 +00:00
|
|
|
|
/// <param name="comment">End-of-line comment.</param>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// <param name="direction">I/O direction.</param>
|
|
|
|
|
/// <param name="multiMask">Bit mask to apply before comparisons.</param>
|
|
|
|
|
public static DefSymbol Create(Symbol sym, FormatDescriptor dfd, bool widthSpecified,
|
|
|
|
|
string comment, DirectionFlags direction, MultiAddressMask multiMask) {
|
|
|
|
|
int width = dfd.Length;
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
if (widthSpecified && sym.SymbolType == Type.Constant &&
|
|
|
|
|
sym.SymbolSource != Source.Variable) {
|
|
|
|
|
// non-variable constants don't have a width; override arg
|
|
|
|
|
Debug.WriteLine("Overriding constant DefSymbol width");
|
|
|
|
|
widthSpecified = false;
|
|
|
|
|
}
|
2019-10-15 23:37:14 +00:00
|
|
|
|
Debug.Assert(dfd.FormatType == FormatDescriptor.Type.NumericLE);
|
|
|
|
|
return new DefSymbol(sym.Label, sym.Value, sym.SymbolSource, sym.SymbolType,
|
2019-11-09 04:44:45 +00:00
|
|
|
|
sym.LabelAnno, dfd.FormatSubType, width, widthSpecified,
|
|
|
|
|
comment, direction, multiMask, string.Empty);
|
2019-05-02 22:45:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-31 21:10:59 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Constructs a DefSymbol from an existing DefSymbol, with a different label. Use
|
|
|
|
|
/// this to change the label while keeping everything else the same.
|
|
|
|
|
/// </summary>
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This can't be a simple Rename() function that uses a copy constructor because
|
|
|
|
|
/// the label is in the base class.
|
Fix various local variable de-duplication bugs
In 1.5.0-dev1, as part of changes to the way label localization
works, the local variable de-duplicator started checking against a
filtered copy of the symbol table. Unfortunately it never
re-generated the table, so a long-lived LocalVariableLookup (like
the one used by LineListGen) would set up the dup map wrong and
be inconsistent with other parts of the program.
We now regenerate the table on every Reset().
The de-duplication stuff also had problems when opcodes and
operands were double-clicked on. When the opcode is clicked, the
selection should jump to the appropriate variable declaration, but
it wasn't being found because the label generated in the list was
in its original form. Fixed.
When an instruction operand is double-clicked, the instruction operand
editor opens with an "edit variable" shortcut. This was showing
the de-duplicated name, which isn't necessarily a bad thing, but it
was passing that value on to the DefSymbol editor, which thought it
was being asked to create a new entry. Fixed. (Entering the editor
through the LvTable editor works correctly, with nary a de-duplicated
name in sight. You'll be forced to rename it because it'll fail the
uniqueness test.)
References to de-duplicated local variables were getting lost when
the symbol's label was replaced (due largely to a convenient but
flawed shortcut: xrefs are attached to DefSymbol objects). Fixed by
linking the XrefSets.
Given the many issues and their relative subtlety, I decided to make
the modified names more obvious, and went back to the "_DUPn" naming
strategy. (I'm also considering just making it an error and
discarding conflicting entries during analysis... this is much more
complicated than I expected it to be.)
Quick tests can be performed in 2019-local-variables:
- go to +000026, double-click on the opcode, confirm sel change
- go to +000026, double-click on the operand, confirm orig name
shown in shortcut and that shortcut opens editor with orig name
- go to +00001a, down a line, click on PROJ_ZERO_DUP1 and confirm
that it has a single reference (from +000026)
- double-click on var table and confirm editing entry
2020-01-14 01:54:47 +00:00
|
|
|
|
///
|
|
|
|
|
/// The Xrefs reference points to the actual XrefSet in the original. This is not
|
|
|
|
|
/// ideal, but it's the easiest way to keep xrefs working across Lv de-duplication
|
|
|
|
|
/// (you actually *want* xrefs added to copies to be held by the original).
|
2019-10-15 23:37:14 +00:00
|
|
|
|
/// </remarks>
|
2019-08-31 21:10:59 +00:00
|
|
|
|
/// <param name="defSym">Source DefSymbol.</param>
|
|
|
|
|
/// <param name="label">Label to use.</param>
|
|
|
|
|
public DefSymbol(DefSymbol defSym, string label)
|
|
|
|
|
: this(label, defSym.Value, defSym.SymbolSource, defSym.SymbolType,
|
2019-11-09 04:44:45 +00:00
|
|
|
|
defSym.LabelAnno, defSym.DataDescriptor.FormatSubType,
|
|
|
|
|
defSym.DataDescriptor.Length, defSym.HasWidth, defSym.Comment,
|
|
|
|
|
defSym.Direction, defSym.MultiMask, defSym.Tag)
|
Fix various local variable de-duplication bugs
In 1.5.0-dev1, as part of changes to the way label localization
works, the local variable de-duplicator started checking against a
filtered copy of the symbol table. Unfortunately it never
re-generated the table, so a long-lived LocalVariableLookup (like
the one used by LineListGen) would set up the dup map wrong and
be inconsistent with other parts of the program.
We now regenerate the table on every Reset().
The de-duplication stuff also had problems when opcodes and
operands were double-clicked on. When the opcode is clicked, the
selection should jump to the appropriate variable declaration, but
it wasn't being found because the label generated in the list was
in its original form. Fixed.
When an instruction operand is double-clicked, the instruction operand
editor opens with an "edit variable" shortcut. This was showing
the de-duplicated name, which isn't necessarily a bad thing, but it
was passing that value on to the DefSymbol editor, which thought it
was being asked to create a new entry. Fixed. (Entering the editor
through the LvTable editor works correctly, with nary a de-duplicated
name in sight. You'll be forced to rename it because it'll fail the
uniqueness test.)
References to de-duplicated local variables were getting lost when
the symbol's label was replaced (due largely to a convenient but
flawed shortcut: xrefs are attached to DefSymbol objects). Fixed by
linking the XrefSets.
Given the many issues and their relative subtlety, I decided to make
the modified names more obvious, and went back to the "_DUPn" naming
strategy. (I'm also considering just making it an error and
discarding conflicting entries during analysis... this is much more
complicated than I expected it to be.)
Quick tests can be performed in 2019-local-variables:
- go to +000026, double-click on the opcode, confirm sel change
- go to +000026, double-click on the operand, confirm orig name
shown in shortcut and that shortcut opens editor with orig name
- go to +00001a, down a line, click on PROJ_ZERO_DUP1 and confirm
that it has a single reference (from +000026)
- double-click on var table and confirm editing entry
2020-01-14 01:54:47 +00:00
|
|
|
|
{
|
|
|
|
|
Debug.Assert(SymbolSource == Source.Variable);
|
|
|
|
|
Xrefs = defSym.Xrefs;
|
|
|
|
|
}
|
2019-08-31 21:10:59 +00:00
|
|
|
|
|
2019-08-29 00:34:29 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines whether a symbol overlaps with a region. Useful for variables.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="a">Symbol to check.</param>
|
|
|
|
|
/// <param name="value">Address.</param>
|
|
|
|
|
/// <param name="width">Symbol width.</param>
|
|
|
|
|
/// <param name="type">Symbol type to check against.</param>
|
|
|
|
|
/// <returns>True if the symbols overlap.</returns>
|
|
|
|
|
public static bool CheckOverlap(DefSymbol a, int value, int width, Type type) {
|
|
|
|
|
if (a.DataDescriptor.Length <= 0 || width <= 0) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (a.Value < 0 || value < 0) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (a.SymbolType != type) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
int maxStart = Math.Max(a.Value, value);
|
|
|
|
|
int minEnd = Math.Min(a.Value + a.DataDescriptor.Length - 1, value + width - 1);
|
|
|
|
|
return (maxStart <= minEnd);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-23 18:49:22 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines whether symbol one is "wider" than symbol two. It's wider if it
|
|
|
|
|
/// has a width, and the other symbol either doesn't have a width or has a width
|
|
|
|
|
/// but is narrower.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool IsWider(DefSymbol a, DefSymbol b) {
|
|
|
|
|
if (!a.HasWidth && !b.HasWidth) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if (a.HasWidth && !b.HasWidth) {
|
|
|
|
|
return true;
|
|
|
|
|
} else if (!a.HasWidth && b.HasWidth) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
return a.DataDescriptor.Length > b.DataDescriptor.Length;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-26 23:58:53 +00:00
|
|
|
|
|
|
|
|
|
public static bool operator ==(DefSymbol a, DefSymbol b) {
|
|
|
|
|
if (ReferenceEquals(a, b)) {
|
|
|
|
|
return true; // same object, or both null
|
|
|
|
|
}
|
|
|
|
|
if (ReferenceEquals(a, null) || ReferenceEquals(b, null)) {
|
|
|
|
|
return false; // one is null
|
|
|
|
|
}
|
2019-08-29 00:34:29 +00:00
|
|
|
|
return a.Equals(b);
|
2019-08-26 23:58:53 +00:00
|
|
|
|
}
|
|
|
|
|
public static bool operator !=(DefSymbol a, DefSymbol b) {
|
|
|
|
|
return !(a == b);
|
|
|
|
|
}
|
|
|
|
|
public override bool Equals(object obj) {
|
2019-08-29 00:34:29 +00:00
|
|
|
|
if (!(obj is DefSymbol)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// Do base-class equality comparison and the ReferenceEquals check.
|
|
|
|
|
if (!base.Equals(obj)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// All fields must be equal, except Xrefs.
|
|
|
|
|
DefSymbol other = (DefSymbol)obj;
|
|
|
|
|
if (DataDescriptor != other.DataDescriptor ||
|
|
|
|
|
Comment != other.Comment ||
|
|
|
|
|
Tag != other.Tag) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2019-08-26 23:58:53 +00:00
|
|
|
|
}
|
|
|
|
|
public override int GetHashCode() {
|
|
|
|
|
return base.GetHashCode() ^
|
|
|
|
|
DataDescriptor.GetHashCode() ^
|
|
|
|
|
Comment.GetHashCode() ^
|
|
|
|
|
Tag.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-02 22:45:40 +00:00
|
|
|
|
public override string ToString() {
|
|
|
|
|
return base.ToString() + ":" + DataDescriptor + ";" + Comment +
|
2019-10-15 23:37:14 +00:00
|
|
|
|
" dir=" + Direction + " mask=" + (MultiMask == null ? "-" : MultiMask.ToString()) +
|
2019-05-02 22:45:40 +00:00
|
|
|
|
(string.IsNullOrEmpty(Tag) ? "" : " [" + Tag + "]");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|