Debugging Tools for Windows

AddSymbol

The AddSymbol and AddSymbolWide methods add a symbol to a symbol group.

HRESULT
  IDebugSymbolGroup::AddSymbol(
    IN PCSTR  Name,
    IN OUT PULONG  Index
    );

HRESULT
  IDebugSymbolGroup2::AddSymbolWide(
    IN PCWSTR  Name,
    IN OUT PULONG  Index
    );

#ifdef UNICODE
#define AddSymbolT AddSymbolWide
#else
#define AddSymbolT AddSymbol
#endif

Parameters

Name
The symbol's name. Name is examined as an expression to determine the symbol's type. This expression can include pointer, array, and structure dereferencing (for example, *my_pointer, my_array[1], or my_struct.some_field).
Index
The index of the entry in the symbol group. When you are calling AddSymbol or AddSymbolWide, Index should point to the index of the symbol that you want. Or, if Index points to DEBUG_ANY_ID, the symbol is appended to the end of the list.

When this method returns, Index points to the actual index of the symbol. The index of a symbol is an identification number. The index ranges from zero through the number of symbols in the symbol group minus one.

Return Value

AddSymbol and AddSymbolWide might return one of the following values:

S_OK
The method was successful.

This method might also return error values. For more information about possible return values, see Return Values.

Comments

The symbol name in Name is evaluated by the C++ expression evaluator and can contain any C++ expression (for example, x+y).

If the index that you want is less than the size of the symbol group, the new symbol is added at the desired index. If the desired index is larger than the size of the symbol group, the new symbol is added to the end of the list (as in the case of DEBUG_ANY_ID).

For more information about symbol groups, see Scopes and Symbol Groups.

Requirements

Versions: AddSymbol is available in all versions of IDebugSymbolGroup. AddSymbolWide is available in IDebugSymbolGroup2 and later versions.

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetNumberSymbols, RemoveSymbolByIndex, RemoveSymbolByName

Build machine: CAPEBUILD