VIRTUTECH CONFIDENTIAL    Previous - Up - Next

symtable

Provided by
symtable
Class Hierarchy
conf-objectlog-objectsymtable
Interfaces Implemented
log_object, symtable
Description
Symbolic debugging information for an address space.

Attributes

Attributes inherited from class conf-object
attributes, classname, component, iface, name, object_id, queue
Attributes inherited from class log-object
access_count, log_buffer, log_buffer_last, log_buffer_size, log_group_mask, log_groups, log_level, log_type_mask
Attribute List
abi
Session attribute; read/write access; type: String.

ABI to use, or empty string if not set.

addr_of
Pseudo attribute; read-only access; ; list indexed; indexed type: Integer.

Address of (file, line, function) where file/line or function may be 0.

all_abis
Pseudo class attribute; read-only access; type: [s*].

List of all symtable ABIs.

arch
Session attribute; read/write access; type: String.

Architecture the symbols are for, or the empty string if not set.

arch_compat
Pseudo attribute; read-only access; ; string indexed; indexed type: Integer.

True if symtable is compatible with architecture given as index

data_at
Pseudo attribute; read-only access; ; integer indexed; indexed type: [sssi].

(file, variable, type, offset) Variable at given address

display_position
Session class attribute; read/write access; type: Integer.

If set, the current source position is displayed after each command.

eager_loading
Session attribute; read/write access; type: Integer.

Whether to load debug info right away, as opposed to only when needed.

fun_addr
Pseudo attribute; read-only access; type: [i,i,i]|n; list indexed; indexed type: unknown type.

Address, offset to first code line, and size of a function. Index is (function, file), where file can be Nil.

functions
Pseudo attribute; read-only access; type: [[s,s,i,i]*].

((function, file, start, end)*) List of functions and where in memory they are located

host_source_at
Pseudo attribute; read-only access; ; integer indexed; indexed type: [sis].

(file, line, function) Source code position at given address. The file is a complete path to the file on the host.

load_symbol_file
Pseudo attribute; write-only access; type: [si].

(file, address) Set to load symbols from file at address

local_vars
Pseudo attribute; read-only access; ; integer indexed; indexed type: [s*]|n.

list of local variable and function parameter names; index is program location

selfprof_active
Pseudo attribute; write-only access; type: i|[iii].

Set to (skip, buffers flat) for starting self-profiling, 0 for stopping and nonzero for continuing after stopping. skip is the number of stack frames to skip from the call root, and buffers is the number of call buffers to use. A non-zero flat value enables flat profiling.

selfprof_dump_flat
Pseudo attribute; write-only access; type: unknown type.

(Internal use only) Set to the file name for dumping flat profile data.

selfprof_graph
Pseudo attribute; write-only access; type: [s|nfsib].

(function-name, cut-off, dot-file, page-size landscape) List the call path for function-name and the accumulated time spent in each function called from this path. A value if NIL will list all call paths in Simics. To skip rarely used paths, specify a cut-off limit in cut-off in percent. If dot-file is non-NIL, the output is written to a file in the dot graph language. The dot file is generated for a page size given by the page-size field which is one of 1, 2, 3 or 4 for A1, A2, A3 and A4.

selfprof_info
Pseudo attribute; read-only access; type: unknown type.

(Internal use only) Print some self-profiling info. Does not return anything interesting.

selfprof_list
Pseudo attribute; write-only access; type: unknown type.

(Internal use only) (n, function-name, accum, file) List the n most executed functions whose name begin with fun-name and reside in file. If accum is nonzero, list in order of accumulated times (including time spent in callees)

selfprof_stat
Pseudo attribute; read-only access; type: [[ssii]]|n.

(Internal use only)Get the time spent in different functions. Each entry in the returned list is a list of the form [function, file name, ticks, accumulated ticks]. Self-profiling must have been started an stopped (using selfprof-start and selfprof-stop before this attribute is read. Failure to do so will result in nil being returned. If self-profiling was started in flat mode nil is returned.

selfprof_tick
Pseudo attribute; write-only access; type: Integer.

Trigger a selfprof tick.

simics_symbols
Pseudo attribute; write-only access; type: [ii].

(all, verbose) Set to load Simics own symbols into this symtable object. Set all to 0 to just load symbols, 1 to load debug info as well. If the verbose flag is non-zero, information about loaded symbol files is printed.

source_at
Pseudo attribute; read-only access; ; integer indexed; indexed type: [sis].

(file, line, function) Source code position at given address

source_lines
Pseudo attribute; read-only access; ; integer indexed; indexed type: [[si]*].

((file, line), ...) All source lines corresponding to a given instruction

sourcepath
Optional attribute; read/write access; type: String.

set source search path for debug info

symbol_file
Session attribute; read/write access; type: [[si]*]; string indexed; indexed type: Integer.

((file, address), ...) Loaded symbol tables

symbol_list
Pseudo attribute; write-only access; ; string indexed; indexed type: [[siii]*].

((symbol-name, info, value, size), ...) Specify a list of symbols to be entered under the indexed name. info is an integer as follows: local=0, global=1, weak=2; variable=0, function=16.

symbol_value
Pseudo attribute; read-only access; ; string indexed; indexed type: i|n.

Value of symbol (index), or Nil if no such symbol exists.

total_walks
Pseudo attribute; read-only access; type: Integer.

(Internal use only)Get total number of walks (perfanalyze/time_handler events)

Command List

Commands defined by interface log_object
log, log-group, log-level, log-size, log-type
Commands
abiset ABI to use
host-source-atreturn the source code position for a given address
listlist source and/or disassemble
load-symbolsload symbols from file
plain-symbolsread raw symbols in nm format
posaddress of line or function
source-pathset source search path for debug info
whereisfind symbol by address

Command Descriptions

<symtable>.abi
Synopsis
<symtable>.abi ["abi"]
Description
Set the ABI to abi, or show the current ABI. This is normally not needed when loading debug info from a binary, but is needed when using plain-symbols.
See Also
<symtable>.plain-symbols
<symtable>.host-source-at
Synopsis
<symtable>.host-source-at address
Description
Return the source code position (file, line, function) corresponding to a given address.
<symtable>.list
Synopsis
<symtable>.list [(-s|-d)] (address|"location") [maxlines]
Description
List the source code corresponding to a given address, function or line. The location can be specified as

line or file:line --- list from given line

function or file:function --- list that function

address --- list from that address

At most maxlines lines of source or asm are printed. -s produces source intermixed with disassembly, and -d only disassembles.

See Also
disassemble, whereis, pos, symval
<symtable>.load-symbols
Synopsis
<symtable>.load-symbols file [start] [-t]
Description
Loads symbolic debugging information from file. If start is given, it is the (absolute) starting address of the file's code. If -t is specified, start is interpreted as the address of the .text section (similarly to GDB); otherwise start is taken to be the address of the first executable segment. The Simics search path is used to locate file.
See Also
new-symtable, <symtable>.plain-symbols
<symtable>.plain-symbols
Synopsis
<symtable>.plain-symbols file [start]
Description
Reads "plain" symbols in BSD nm(1) output format. Each line looks like:

value type symbol

where value is the symbol value (usually the address) in hex, and type is a code letter describing the type of the symbol: B, D or R are treated as data symbols, and T as text (code) symbols. File-local symbols have their type letters in lower case, global symbols in upper case. If start is specified, it is added to the value of each symbol.

See Also
new-symtable, <symtable>.load-symbols
<symtable>.pos
Synopsis
<symtable>.pos (line|"function")
Description
Finds the address of a source line or a function in a given file (e.g., myfile.c:4711 or myfile.c:myfunction). If only a line number is specified, the command looks at the current value of the program counter to determine the current file. (If this command is called from the symtable namespace, no current file is defined.) It may be necessary to put the argument inside double quotes for it to be parsed correctly.
See Also
stack-trace, psym, symval
<symtable>.source-path
Synopsis
<symtable>.source-path ["path"]
Description
Sets the source search path to path. If no path is given, the current search path will be displayed. The source search path is used when translating file names in debug information to the appropriate place in the host machine's file system.

Each component of the (semicolon-separated) search path is either a path name, added to the beginning of source file names, or a string of the form a>b, replacing a with b at the beginning of source file names.

Example: The source path /usr/src>/pkg/source;/usr>/misc would cause the file name /usr/src/any.c to be translated to /pkg/source/any.c, or, if no such file exists, to /misc/src/any.c.

Another example: The source path /usr/src>C:\My\Source would translate the file name /usr/src/any/file.c to C:\My\Source\any\file.c.

See Also
<symtable>.load-symbols, new-symtable
<symtable>.whereis
Synopsis
<symtable>.whereis [-d] address
Description
Displays the function or variable and (if possible) the source file and line number corresponding to address. If -d is specified, searches only data symbols. Does not look for stack-allocated variables.
See Also
pos, psym

VIRTUTECH CONFIDENTIAL    Previous - Up - Next