|
From: Carlo W. <li...@us...> - 2001-12-27 05:17:46
|
CVSROOT : /cvsroot/libcw
Module : src
Branch tags: branch-threading
Commit time: 2001-11-27 05:17:46 UTC
Modified files:
Tag: branch-threading
libcwd/debug.cc libcwd/debugmalloc.cc libcwd/elf32.cc
Log message:
Fix compilation when configured with --disable-libcwd-location
---------------------- diff included ----------------------
Index: src/libcwd/debug.cc
diff -u src/libcwd/debug.cc:1.46.2.41 src/libcwd/debug.cc:1.46.2.42
--- src/libcwd/debug.cc:1.46.2.41 Fri Dec 7 18:06:22 2001
+++ src/libcwd/debug.cc Wed Dec 26 21:17:35 2001
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.41 2001/12/08 02:06:22 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.46.2.42 2001/12/27 05:17:35 libcw Exp $
//
// Copyright (C) 2000 - 2001, by
//
@@ -899,7 +899,9 @@
channels::dc::malloc.NS_initialize("MALLOC");
channels::dc::continued.NS_initialize(continued_maskbit);
channels::dc::finish.NS_initialize(finish_maskbit);
+#ifdef DEBUGUSEBFD
channels::dc::bfd.NS_initialize("BFD");
+#endif
// What the heck, initialize all other debug channels too
channels::dc::warning.NS_initialize("WARNING");
channels::dc::notice.NS_initialize("NOTICE");
@@ -1292,14 +1294,24 @@
channel_set_st& debug_ct::operator|(fatal_channel_ct const&)
{
+#ifdef DEBUGUSEBFD
DoutFatal(dc::fatal, location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) <<
" : Don't use Dout together with dc::core or dc::fatal! Use DoutFatal instead.");
+#else
+ DoutFatal(dc::core,
+ "Don't use Dout together with dc::core or dc::fatal! Use DoutFatal instead.");
+#endif
}
channel_set_st& debug_ct::operator&(channel_ct const&)
{
+#ifdef DEBUGUSEBFD
DoutFatal(dc::fatal, location_ct((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset) <<
- " : Use dc::core or dc::fatal together with DoutFatal.");
+ " : Use dc::core or dc::fatal together with DoutFatal.");
+#else
+ DoutFatal(dc::core,
+ "Use dc::core or dc::fatal together with DoutFatal.");
+#endif
}
namespace _private_ {
Index: src/libcwd/debugmalloc.cc
diff -u src/libcwd/debugmalloc.cc:1.61.2.47 src/libcwd/debugmalloc.cc:1.61.2.48
--- src/libcwd/debugmalloc.cc:1.61.2.47 Fri Dec 7 18:06:22 2001
+++ src/libcwd/debugmalloc.cc Wed Dec 26 21:17:35 2001
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.47 2001/12/08 02:06:22 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debugmalloc.cc,v 1.61.2.48 2001/12/27 05:17:35 libcw Exp $
//
// Copyright (C) 2000 - 2001, by
//
@@ -839,6 +839,7 @@
extern void demangle_symbol(char const* in, _private_::internal_string& out);
+#ifdef DEBUGUSEBFD
struct dm_location_ct : public location_ct {
void print_on(std::ostream& os) const;
friend _private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, dm_location_ct const& data);
@@ -846,9 +847,11 @@
friend _private_::non_allocating_fake_ostream_using_write_ct const& operator<<(_private_::non_allocating_fake_ostream_using_write_ct const& os, dm_location_ct const& data);
#endif
};
+#endif // DEBUGUSEBFD
static char const* const twentyfive_spaces_c = " ";
+#ifdef DEBUGUSEBFD
_private_::no_alloc_ostream_ct& operator<<(_private_::no_alloc_ostream_ct& os, dm_location_ct const& data)
{
size_t len = strlen(data.M_filename);
@@ -887,7 +890,8 @@
write(2, twentyfive_spaces_c, cnt);
return raw_write;
}
-#endif
+#endif // DEBUGDEBUGOUTPUT
+#endif // DEBUGUSEBFD
void dm_alloc_ct::print_description(LIBCWD_TSD_PARAM) const
{
Index: src/libcwd/elf32.cc
diff -u src/libcwd/elf32.cc:1.20.2.21 src/libcwd/elf32.cc:1.20.2.22
--- src/libcwd/elf32.cc:1.20.2.21 Wed Dec 5 22:01:15 2001
+++ src/libcwd/elf32.cc Wed Dec 26 21:17:35 2001
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.20.2.21 2001/12/06 06:01:15 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/elf32.cc,v 1.20.2.22 2001/12/27 05:17:35 libcw Exp $
//
// Copyright (C) 2001, by
//
@@ -18,7 +18,7 @@
#include <libcw/debug_config.h>
-#ifndef DEBUGUSEGNULIBBFD
+#if defined(DEBUGUSEBFD) && !defined(DEBUGUSEGNULIBBFD)
#include "sys.h"
#include <inttypes.h> // ISO C99 header, needed for int32_t etc.
@@ -1890,4 +1890,4 @@
} // namespace debug
} // namespace libcw
-#endif // !DEBUGUSEGNULIBBFD
+#endif // DEBUGUSEBFD && !DEBUGUSEGNULIBBFD
----------------------- End of diff -----------------------
|