public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4391] Add debug helpers for auto_bitmap.
@ 2021-10-14 9:04 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2021-10-14 9:04 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3d0a7271b383c95d5c8dc9647966517a61e71abb
commit r12-4391-g3d0a7271b383c95d5c8dc9647966517a61e71abb
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Wed Oct 13 10:04:39 2021 +0200
Add debug helpers for auto_bitmap.
Using debug() on an auto_bitmap from gdb doesn't work because the
implicit conversion from auto_bitmap to bitmap_head doesn't work
from within a debugging session. This patch adds the convenience
functions for auto_bitmap.
gcc/ChangeLog:
* bitmap.c (debug): New overloaded function for auto_bitmaps.
* bitmap.h (debug): Same.
Diff:
---
gcc/bitmap.c | 12 ++++++++++++
gcc/bitmap.h | 3 +++
2 files changed, 15 insertions(+)
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index b915fdfbb54..98c6d0b9e05 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -2830,6 +2830,18 @@ debug (const bitmap_head *ptr)
fprintf (stderr, "<nil>\n");
}
+DEBUG_FUNCTION void
+debug (const auto_bitmap &ref)
+{
+ debug ((const bitmap_head &) ref);
+}
+
+DEBUG_FUNCTION void
+debug (const auto_bitmap *ptr)
+{
+ debug ((const bitmap_head *) ptr);
+}
+
void
bitmap_head::dump ()
{
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 0846f79665d..1bddcdbfaee 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -964,6 +964,9 @@ class auto_bitmap
bitmap_head m_bits;
};
+extern void debug (const auto_bitmap &ref);
+extern void debug (const auto_bitmap *ptr);
+
/* Base class for bitmap_view; see there for details. */
template<typename T, typename Traits = array_traits<T> >
class base_bitmap_view
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-14 9:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 9:04 [gcc r12-4391] Add debug helpers for auto_bitmap Aldy Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).