-
Notifications
You must be signed in to change notification settings - Fork 18
Debug natives
native bool:debug_loaded();
Returns true if the debug information is loaded for this script, false otherwise.
native AmxDebug:debug_get_ptr();
Returns the debug information pointer that can be passed to other plugins that inspect debug symbols, or AmxDebug:0
if no debug information is loaded.
native debug_code(level=0);
Returns the value of the CIP register at the call site specified by level
. 0 corresponds to the current function, 1 to the function that called the current function etc.
native debug_line(code=cellmin);
Returns the line number in the script where the instruction pointed to by code
is located (returned from debug_code
). If no value is specified, returns the current line.
native debug_file(file[], code=cellmin, size=sizeof(file));
native String:debug_file_s(code=cellmin);
Returns the name of the file where the instruction pointed to by code
is located (returned from debug_code
). If no value is specified, returns the current file.
native debug_num_symbols();
Returns the number of debug symbols defined in the script.
native Symbol:debug_symbol(const name[], code=cellmin, symbol_kind:kind=symbol_kind:-1, symbol_class:class=symbol_class:-1);
Finds a symbol by its name, visible in scope of the code located at code
, or INVALID_SYMBOL_ID
if no symbol was found. The other parameters can be used to limit the number of possible symbols to certain types.
native Symbol:debug_func(code=cellmin);
Returns the symbol representing the function located at code
.
native Symbol:debug_var(&AnyTag:var);
Returns the symbol representing the variable pointed to by var
. Only variables in the data section, or on the stack of the AMX can be used.
native Symbol:debug_var_arr(AnyTag:var[]) = debug_var;
Returns the symbol representing the array variable pointed to by var
. Only variables in the data section, or on the stack of the AMX can be used.
native symbol_kind:debug_symbol_kind(Symbol:symbol);
Returns the kind of a symbol, i.e. a variable, a variable reference, an array, an array reference, or a function.
native symbol_class:debug_symbol_class(Symbol:symbol);
Returns the visibility class of a symbol, i.e. whether it is global, local, or static.
native debug_symbol_tag(Symbol:symbol);
Returns the tag id of a symbol.
native tag_uid:debug_symbol_tag_uid(Symbol:symbol);
Returns the universal tag id of a symbol.
native Symbol:debug_symbol_func(Symbol:symbol);
Returns the function that defines a symbol.
native debug_symbol_name(Symbol:symbol, name[], size=sizeof(name));
native String:debug_symbol_name_s(Symbol:symbol);
Returns the name of a symbol.
native debug_symbol_addr(Symbol:symbol);
Returns the address where a symbol is defined (code for functions, data or stack local for variables).
native debug_symbol_range(Symbol:symbol, &codestart, &codeend);
Returns the code range where a symbol is in scope.
native debug_symbol_line(Symbol:symbol);
Returns the line where a symbol was defined.
native debug_symbol_file(Symbol:symbol, file[], size=sizeof(file));
native String:debug_symbol_file_s(Symbol:symbol);
Returns the file where a symbol was defined.
native bool:debug_symbol_in_scope(Symbol:symbol, level=0);
Returns true if a symbol is visible at level
, i.e. if it is in scope.
native debug_symbol_rank(Symbol:symbol);
Returns the rank/dimension of a symbol (0 for a single cell, 1 for a single-dimensional array etc.)
native debug_symbol_size(Symbol:symbol, dimension=0);
Returns the size of an array symbol in a specific dimension.
native debug_symbol_size_tag(Symbol:symbol, dimension=0);
Returns the size tag id of an array symbol in a specific dimension.
native tag_uid:debug_symbol_size_tag_uid(Symbol:symbol, dimension=0);
Returns the size universal tag id of an array symbol in a specific dimension.
native Var:debug_symbol_to_amx_var(Symbol:symbol, level=0);
Created a new AMX variable reference from the symbol at stack frame level level
.
native debug_symbol_get(Symbol:symbol, level=0, offset=0);
native debug_symbol_get_arr(Symbol:symbol, AnyTag:value[], level=0, offset=0, size=sizeof(value));
native Variant:debug_symbol_get_var(Symbol:symbol, level=0);
native bool:debug_symbol_get_safe(Symbol:symbol, &AnyTag:value, level=0, offset=0, tag_id=tagof(value));
native debug_symbol_get_arr_safe(Symbol:symbol, AnyTag:value[], level=0, offset=0, size=sizeof(value), tag_id=tagof(value));
Returns the value of a symbol at stack frame level level
.
native debug_symbol_set(Symbol:symbol, AnyTag:value, level=0, offset=0);
native bool:debug_symbol_set_safe(Symbol:symbol, AnyTag:value, level=0, offset=0, tag_id=tagof(value));
native debug_symbol_set_arr(Symbol:symbol, const AnyTag:values[], level=0, offset=0, size=sizeof(values));
native debug_symbol_set_arr_safe(Symbol:symbol, const AnyTag:values[], level=0, offset=0, size=sizeof(values), tag_id=tagof(values));
Sets the value of a symbol at stack frame level level
.
native debug_symbol_call(Symbol:symbol, AnyTag:...);
native debug_symbol_indirect_call(Symbol:symbol, AnyTag:...);
Calls a function symbol. The first native performs a direct call (i.e. without creating a new context), the second an indirect call.
native debug_symbol_call_list(Symbol:symbol, List:args);
native debug_symbol_indirect_call_list(Symbol:symbol, List:args);
Calls a function symbol, passing the arguments in a list.
native amx_err:debug_symbol_try_call(Symbol:symbol, &result, AnyTag:...);
Calls a function symbol, suppressing errors and returning an error code.
native amx_err:debug_symbol_try_call_list(Symbol:symbol, &result, List:args);
Calls a function symbol, passing the arguments in a list, suppressing errors and returning an error code.
native Iter:debug_symbol_variables(Symbol:symbol);
Creates an iterator that contains all variables defined by a function symbol.