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
76 extern char const*
const unknown_function_c;
90 lockable_auto_ptr<char, true> M_filepath;
93 void const* M_initialization_delayed;
94 void const* M_unknown_pc;
98 object_file_ct
const* M_object_file;
102 friend class alloc_filter_ct;
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;
115 explicit location_ct(
void const* addr);
117 #if LIBCWD_THREAD_SAFE
118 explicit location_ct(
void const* addr LIBCWD_COMMA_TSD_PARAM);
140 location_ct(location_ct
const& location);
151 location_ct& operator=(location_ct
const& location);
160 void lock_ownership() {
if (M_known) M_filepath.lock(); }
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;
203 size_t filename_length()
const {
return M_known ? strlen(M_filename) : 0; }
205 size_t filepath_length()
const {
return M_known ? strlen(M_filepath.get()) : 0; }
212 object_file_ct
const* object_file()
const {
return M_object_file; }
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)
225 operator<<(std::ostream& os, location_ct
const& location)
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; }
236 void handle_delayed_initialization(alloc_filter_ct
const& filter);
237 bool hide_from_alloc_list()
const {
return M_hide == _private_::filtered_location; }
238 bool new_location()
const {
return M_hide == _private_::new_location; }
239 void synchronize_with(alloc_filter_ct
const&)
const;
260 location_format_t location_format(location_format_t format);
namespace for libcwd.
Definition: debug.cc:87
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