18 #ifndef LIBCWD_CLASS_LOCATION_H 19 #define LIBCWD_CLASS_LOCATION_H 21 #ifndef LIBCWD_CONFIG_H 27 #ifndef LIBCWD_PRIVATE_STRUCT_TSD_H 30 #ifndef LIBCWD_CLASS_OBJECT_FILE_H 33 #ifndef LIBCW_LOCKABLE_AUTO_PTR_H 59 template<
class OSTREAM>
60 void print_location_on(OSTREAM& os, location_ct
const& location);
66 #ifndef LIBCWD_CLASS_ALLOC_FILTER_H 103 mutable _private_::hidden_st M_hide;
109 static char const*
const S_uninitialized_location_ct_c;
110 static char const*
const S_pre_ios_initialization_c;
111 static char const*
const S_pre_libcwd_initialization_c;
112 static char const*
const S_cleared_location_ct_c;
117 #if LIBCWD_THREAD_SAFE 118 explicit location_ct(
void const* addr LIBCWD_COMMA_TSD_PARAM);
165 void pc_location(
void const* pc);
168 void M_pc_location(
void const* addr LIBCWD_COMMA_TSD_PARAM);
181 bool is_known()
const;
189 std::string file()
const;
192 unsigned int line()
const;
200 char const* mangled_function_name()
const;
216 void print_filepath_on(std::ostream& os)
const;
218 void print_filename_on(std::ostream& os)
const;
219 template<
class OSTREAM>
220 friend void _private_::print_location_on(OSTREAM& os,
location_ct const& location);
221 #if (__GNUC__ == 3 && __GNUC_MINOR__ < 4) 227 _private_::print_location_on(os, location);
233 bool initialization_delayed()
const {
return (!M_object_file && (M_func == S_pre_ios_initialization_c || M_func == S_pre_libcwd_initialization_c)); }
234 void const* unknown_pc()
const {
return (!M_object_file && M_func == unknown_function_c) ? M_unknown_pc : initialization_delayed() ? M_initialization_delayed : 0; }
237 bool hide_from_alloc_list()
const {
return M_hide == _private_::filtered_location; }
238 bool new_location()
const {
return M_hide == _private_::new_location; }
266 #endif // CWDEBUG_LOCATION 267 #endif // LIBCWD_CLASS_LOCATION_H char * M_filename
Points inside M_filepath just after the last '/' or to the beginning.
Definition: class_location.h:92
size_t filepath_length() const
The size of the full path name.
Definition: class_location.h:205
unsigned int M_line
The line number of this location.
Definition: class_location.h:96
object_file_ct const * object_file() const
Corresponding object file.
Definition: class_location.h:212
void const * M_unknown_pc
If M_object_file == NULL and M_func points to unknown_function_c, then this is the address that M_pc_...
Definition: class_location.h:94
An allocated-memory filter class.An object of this type can be passed to list_allocations_on containi...
Definition: class_alloc_filter.h:89
A source file location.
Definition: class_location.h:88
size_t filename_length() const
The size of the file name.
Definition: class_location.h:203
void lock_ownership()
Lock ownership of internal allocations.
Definition: class_location.h:160
std::ostream & operator<<(std::ostream &os, memblk_types_nt memblk_type)
Allow writing a memblk_types_nt directly to an ostream.
Definition: debugmalloc.cc:688
An object representing the main executable or a shared library.
Definition: class_object_file.h:52
object_file_ct const * M_object_file
A pointer to an object representing the library or executable that this location belongs to or NULL w...
Definition: class_location.h:98
lockable_auto_ptr< char, true > M_filepath
The full source file name of this location.  Allocated in `M_pc_location' using new []...
Definition: class_location.h:90
char const *const unknown_function_c
This constant (pointer) is returned by location_ct::mangled_function_name() when no function is known...
Definition: bfd.cc:1416
location_format_t location_format(location_format_t format)
Set the output format of location_ct.
Definition: class_location.inl:135
namespace for libcwd.
Definition: debug.cc:87
bool M_known
Set when M_filepath (and M_filename) point to valid data and M_line contains a valid line number...
Definition: class_location.h:99
unsigned short int location_format_t
The type of the argument of location_format.
Definition: private_struct_TSD.h:122
char const * M_func
Pointer to static string containing the mangled function name of this location.
Definition: class_location.h:97
void const * M_initialization_delayed
If M_object_file == NULL and M_func points to S_pre_ios_initialization_c or S_pre_libcwd_initializati...
Definition: class_location.h:93