gdb: remove BLOCK_NRANGES macro

Replace with range for loops.

Change-Id: Icbe04f9b6f9e6ddae2e15b2409c61f7a336bc3e3
This commit is contained in:
Simon Marchi 2022-02-06 22:30:06 -05:00 committed by Simon Marchi
parent f5cb8afdd2
commit f73b4922a0
3 changed files with 15 additions and 19 deletions

View file

@ -1442,10 +1442,11 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
}
else
{
for (int i = 0; i < BLOCK_NRANGES (block); i++)
for (const blockrange &range : block->ranges ())
{
CORE_ADDR range_low = BLOCK_RANGE (block)[i].start ();
CORE_ADDR range_high = BLOCK_RANGE (block)[i].end ();
CORE_ADDR range_low = range.start ();
CORE_ADDR range_high = range.end ();
gdb_printf (_("Address range %ps to %ps:\n"),
styled_string (address_style.style (),
paddress (gdbarch, range_low)),