delorie.com/djgpp/doc/libc/libc_795.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <debug/syms.h> extern int undefined_symbol; extern int syms_printwhy; unsigned long syms_name2val (const char *string); |
This function returns the address of a symbol specified by string. string may be one of the following:
file#[line]
, where
file is the name of one of the source files linked into the
program whose symbols were read by syms_init
, and line is a
line number in that file. If line is omitted, it defaults
to zero.
Note that the COFF format supported by DJGPP only stores the basename of the source files, so do not specify file with leading directories.
%reg
. reg specifies the value of one
of the debuggee's registers saved in the external variable a_tss
(see section run_child).
syms_name2val
looks up the specified file, line, and symbol in
the symbol table prepared by syms_init
, finds their addresses,
adds the offset, if any, and returns the result.
If the specified file, line, or symbol cannot be found,
syms_name2val
returns zero and sets the global variable
undefined_symbol
to a non-zero value. If the global variable
syms_printwhy
is non-zero, an error message is printed
telling which part of the argument string was invalid.
You must call syms_init
(see section syms_init) before calling any of
the other syms_*
functions for the first time.
The address specified by string, or zero, if none found.
ANSI/ISO C | No |
POSIX | No |
unsigned long addr1, addr2, addr3; syms_init ("foo.exe"); addr1 = syms_name2val ("foo.c#256+12"); addr2 = syms_name2val ("_main"); addr3 = syms_name2val ("struct_a_var+%eax+4"); |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |