Translating a program address into its source file and line number.
More...
|
|
char const *const | libcwd::unknown_function_c = "<unknown function>" |
| | This constant (pointer) is returned by Location::mangled_function_name() when no function is known.
|
|
location_format_t const | libcwd::show_path = 1 |
| | Show the full source path when printing a location.
|
|
location_format_t const | libcwd::show_objectfile = 2 |
| | Show the shared library or executable that owns the location.
|
|
location_format_t const | libcwd::show_function = 4 |
| | Show the mangled function name for the location.
|
If libcwd is configured with ‑DEnableLibcwdLocation:BOOL=ON, it allows you to easily obtain source-file & line-number information of a given address using the Location class.
◆ location_format_t
◆ location_format()
This function can be used to specify the format of how a Location will be printed when it is written to an ostream. The format is thread-specific: only the calling thread will be influenced.
The argument format is a bit-wise OR-ed value of three possible bit masks: show_function : Include the mangled function name. show_object : Include the name of the shared library or the executable name. show_path : Print the full path of the source file.
- Returns
- the previous value of the format.
◆ operator<<()
| std::ostream & libcwd::operator<< |
( |
std::ostream & | os, |
|
|
Location const & | location ) |
|
inline |
Write the contents of a Location object to an ostream in the form source-file:line-number, or writes objectfile:mangledfuncname when the location is unknown. If the source-file:line-number is known, then it may be prepended by the object file and/or the mangled function name anyway if this was requested through libcwd::location_format. That function can also be used to cause the source-file to be printed with its full path.
◆ pc_mangled_function_name()
| char const * libcwd::pc_mangled_function_name |
( |
void const * | pc | ) |
|