]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add debug helpers for auto_bitmap.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 13 Oct 2021 08:04:39 +0000 (10:04 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Thu, 14 Oct 2021 09:04:13 +0000 (11:04 +0200)
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.

gcc/bitmap.c
gcc/bitmap.h

index b915fdfbb54d9eb026aef9c0740c487daf07c934..98c6d0b9e05ceec8d18ea1037dd87f82f213512c 100644 (file)
@@ -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 ()
 {
index 0846f79665ddf851fc5146d61bc87365c2f0ba77..1bddcdbfaee69232f1b82a7d39bbb4fe21a4c641 100644 (file)
@@ -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