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.
This commit is contained in:
Aldy Hernandez 2021-10-13 10:04:39 +02:00
parent 6e3bfd60e8
commit 3d0a7271b3
2 changed files with 15 additions and 0 deletions

View 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 ()
{

View 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