Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

Source-file:Line-number Information
[Program Symbols Access And Interpretation]

Collaboration diagram for Source-file:Line-number Information:

Classes

class  libcwd::location_ct
 A source file location. More...
class  libcwd::object_file_ct
 An object representing the main executable or a shared library. More...

Typedefs

typedef unsigned short int libcwd::location_format_t
 The type of the argument of location_format.

Functions

char const * libcwd::pc_mangled_function_name (void const *addr)
 Find the mangled function name of the address addr.
location_format_t libcwd::location_format (location_format_t format)
 Set the output format of location_ct.
std::ostream & libcwd::operator<< (std::ostream &os, location_ct const &location)
 Write location to ostream os.

Write the contents of a location_ct 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 location_format. That function can also be used to cause the source-file to be printed with its full path.


Variables

char const *const libcwd::unknown_function_c
 This constant (pointer) is returned by location_ct::mangled_function_name() when no function is known.

Detailed Description


Detailed Description

When libcwd was configured with --enable-location, then libcwd allows one to easily obtain source-file / line-number information of a given address using the class location_ct.


Typedef Documentation

typedef unsigned short int libcwd::location_format_t

The type of the argument of location_format.

This type is the same as alloc_format_t but should only be used together with the bit masks show_objectfile, show_function and show_path.


Function Documentation

location_format_t libcwd::location_format ( location_format_t  format  )  [inline]

Set the output format of location_ct.

This function can be used to specify the format of how a location_ct 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.

char const * libcwd::pc_mangled_function_name ( void const *  addr  ) 

Find the mangled function name of the address addr.

Returns:
the same pointer that is returned by location_ct::mangled_function_name() on success, otherwise unknown_function_c is returned.

References libcwd::unknown_function_c.


Variable Documentation

char const *const libcwd::unknown_function_c

This constant (pointer) is returned by location_ct::mangled_function_name() when no function is known.

Referenced by cwdebug_alloc(), and libcwd::pc_mangled_function_name().

Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.