diff options
author | hunt <hunt> | 2005-05-26 07:43:25 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-05-26 07:43:25 +0000 |
commit | abedf3db3774b54ee4ed227e3ae69e55fb0ff76c (patch) | |
tree | 77bf164eda3f977ba0e964c92493ea8c248fb6f3 /runtime/sym.c | |
parent | 3750373a50833fcda902407e5b260cb8c5799ad6 (diff) | |
download | systemtap-steved-abedf3db3774b54ee4ed227e3ae69e55fb0ff76c.tar.gz systemtap-steved-abedf3db3774b54ee4ed227e3ae69e55fb0ff76c.tar.xz systemtap-steved-abedf3db3774b54ee4ed227e3ae69e55fb0ff76c.zip |
2005-05-26 Martin Hunt <hunt@redhat.com>
* current.c (_stp_sprint_regs): Implement for i386.
* sym.c (_stp_symbol_sprint): Check name before trying to
print it.
(_stp_symbol_print): Change to macro that calls _stp_symbol_sprint().
Diffstat (limited to 'runtime/sym.c')
-rw-r--r-- | runtime/sym.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/runtime/sym.c b/runtime/sym.c index 1eec0d1d..a1c04a65 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -36,11 +36,15 @@ String _stp_symbol_sprint (String str, unsigned long address) name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); - _stp_sprintf (str, "0x%lx : ", address); - if (modname) - _stp_sprintf (str, "%s+%#lx/%#lx [%s]", name, offset, size, modname); - else - _stp_sprintf (str, "%s+%#lx/%#lx", name, offset, size); + _stp_sprintf (str, "0x%lx", address); + + if (name) { + if (modname) + _stp_sprintf (str, " : %s+%#lx/%#lx [%s]", name, offset, size, modname); + else + _stp_sprintf (str, " : %s+%#lx/%#lx", name, offset, size); + } + return str; } @@ -51,21 +55,7 @@ String _stp_symbol_sprint (String str, unsigned long address) * a probe because it is too time-consuming. Use at module exit time. */ -void _stp_symbol_print (unsigned long address) -{ - char *modname; - const char *name; - unsigned long offset, size; - char namebuf[KSYM_NAME_LEN+1]; - - name = _stp_kallsyms_lookup(address, &size, &offset, &modname, namebuf); - - _stp_printf ("0x%lx : ", address); - if (modname) - _stp_printf ("%s+%#lx/%#lx [%s]", name, offset, size, modname); - else - _stp_printf ("%s+%#lx/%#lx", name, offset, size); -} +#define _stp_symbol_print(address) _stp_symbol_sprint(_stp_stdout,address) /** @} */ #endif /* _SYM_C_ */ |