Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 8
Format the addresses from a backtrace
|
The backtrace library is an unsupported feature, due to its fragility.
For more information, see
Backtraces
in the QNX Neutrino technotes. |
#include <backtrace.h>
int bt_sprnf_addrs( bt_memmap_t *memmap,
bt_addr_t *addrs,
int addrslen,
char *fmt,
char *out,
size_t outlen,
char *separator );
- memmap
- NULL, or a pointer to memory-map information for the
process you've collected backtracing for.
Use
bt_load_memmap()
to initialize this variable.
- addrs
- An array of addresses that you want to format.
- addrslen
- The number of entries in the addrs array.
- fmt
- The format to use for each entry; see below.
- out
- A pointer to a buffer where the function can store the formatted output.
- outlen
- The length of the out, in bytes.
- separator
- NULL, or a pointer to a separator to write between
the formatted addresses.
libbacktrace
Use the -l backtrace option to
qcc
to link against this library.
The bt_sprnf_addrs() function
formats the addresses in the addrs using fmt as the
format for each entry, and storing the formatted addresses in the
out buffer.
If separator isn't NULL, the function writes it in
out between each formatted address.
The memmap is optional, but if specified, it allows access to
more formatting styles.
The format for each entry (fmt), is analogous to
printf()
formats:
- %% — a literal %.
- %a — an address in memory.
- %l — an address relative to the start of the file
it belongs to (i.e. this corresponds to the address in the object file).
- %o — an address offset from the beginning of the
object files. (i.e. %a == %l + %o).
- %f — an object file that the address belongs to (e.g.
/some/dir/libc.so).
- %I — a numerical index that corresponds to the
numerical index in the memory map printouts (i.e. if the memory map
is printed, then using %I instead of %f in the
backtrace minimizes the size of the backtrace).
|
For the %l, %o, %f, and %I
formats, memmap must not be NULL. |
The number of addresses from addr that could be completely
formatted and written in out.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
bt_get_backtrace(),
bt_init_accessor(),
bt_load_memmap(),
bt_release_accessor(),
bt_set_flags(),
bt_sprn_memmap(),
bt_translate_addrs(),
bt_unload_memmap()
Backtraces
in the QNX Neutrino technotes
pidin backtrace
in the Utilities Reference
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 219
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bt_sprnf_addrs.html on line 219