aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-02-06 22:54:03 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-04-27 22:05:03 -0400
commit63d609debba854d08a515f73d0ad8e4ef8948370 (patch)
treec5e6b2c9d4b48350c707316a48e69388524cdf66 /gdb/symmisc.c
parent6395b62847e581acc3e8fa179444b824d17b3d68 (diff)
downloadgdb-63d609debba854d08a515f73d0ad8e4ef8948370.zip
gdb-63d609debba854d08a515f73d0ad8e4ef8948370.tar.gz
gdb-63d609debba854d08a515f73d0ad8e4ef8948370.tar.bz2
gdb: remove BLOCKVECTOR_BLOCK and BLOCKVECTOR_NBLOCKS macros
Replace with calls to blockvector::blocks, and the appropriate method call on the returned array_view. Change-Id: I04d1f39603e4d4c21c96822421431d9a029d8ddd
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 3699e82..68b76bf 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -236,13 +236,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
{
struct objfile *objfile = symtab->compunit ()->objfile ();
struct gdbarch *gdbarch = objfile->arch ();
- int i;
struct mdict_iterator miter;
- int len;
struct linetable *l;
- const struct blockvector *bv;
struct symbol *sym;
- const struct block *b;
int depth;
gdb_printf (outfile, "\nSymtab for file %s at %s\n",
@@ -263,8 +259,8 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
if (l)
{
gdb_printf (outfile, "\nLine table:\n\n");
- len = l->nitems;
- for (i = 0; i < len; i++)
+ int len = l->nitems;
+ for (int i = 0; i < len; i++)
{
gdb_printf (outfile, " line %d at ", l->item[i].line);
gdb_puts (paddress (gdbarch, l->item[i].pc), outfile);
@@ -278,11 +274,10 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
if (is_main_symtab_of_compunit_symtab (symtab))
{
gdb_printf (outfile, "\nBlockvector:\n\n");
- bv = symtab->compunit ()->blockvector ();
- len = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < len; i++)
+ const blockvector *bv = symtab->compunit ()->blockvector ();
+ for (int i = 0; i < bv->num_blocks (); i++)
{
- b = BLOCKVECTOR_BLOCK (bv, i);
+ const block *b = bv->block (i);
depth = block_depth (b) * 2;
gdb_printf (outfile, "%*sblock #%03d, object at %s",
depth, "", i,
@@ -351,7 +346,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
gdb_printf (outfile, "Compunit user: %s\n", addr);
}
if (cust->includes != nullptr)
- for (i = 0; ; ++i)
+ for (int i = 0; ; ++i)
{
struct compunit_symtab *include = cust->includes[i];
if (include == nullptr)