From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [RFA] "maint print psymbols" with large section tables
Date: Wed, 28 Feb 2001 13:48:00 -0000 [thread overview]
Message-ID: <200102282148.NAA06598@bosch.cygnus.com> (raw)
This patch fixes "maint print psymbols" to work better with large
section offset tables. The existing code prints the whole section offset
tale all on one line, which is awkward when a section offset table has
900+ entries. (The code thinks it is wrapping lines, but wrap_here()
does no good when all the output is going to outfile).
The existing code also takes so long to execute that I saw timeout
failures in gdb.base/maint.exp. This is my motivation for changing
the code.
The new code prints only the non-zero entries of a section offset table,
one per line.
This does not fix PR gdb/29, but it it's a pre-requisite for fixing this
bug without casing a regression failure in maint.exp.
I tested this on Red Hat Linux 6.2 native and Solaris 2.6 native
using the FSF gcc compiler from cvs branch gcc-3_0-branch checked out
on 2001-02-28. I hand inspected the relevant sections of gdb.log and
compared before-and-after test results.
OK to apply?
===
2001-02-28 Michael Chastain <chastain@redhat.com>
* symmisc.c (dump_psymtab): Dump only the non-zero elements of
the section offset table.
Index: gdb/symmisc.c
===================================================================
RCS file: /cvs/src/src/gdb/symmisc.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 symmisc.c
*** gdb/symmisc.c 2000/12/15 01:01:50 1.4
--- gdb/symmisc.c 2001/02/28 20:41:36
***************
*** 1,5 ****
/* Do various things to symbol tables (other than lookup), for GDB.
! Copyright 1986, 1987, 1989, 1991-1996, 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
--- 1,6 ----
/* Do various things to symbol tables (other than lookup), for GDB.
! Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
! 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
*************** dump_psymtab (struct objfile *objfile, s
*** 360,376 ****
fprintf_filtered (outfile, ")\n");
}
! fprintf_filtered (outfile, " Relocate symbols by ");
! for (i = 0; i < psymtab->objfile->num_sections; ++i)
! {
! if (i != 0)
! fprintf_filtered (outfile, ", ");
! wrap_here (" ");
! print_address_numeric (ANOFFSET (psymtab->section_offsets, i),
! 1,
! outfile);
! }
! fprintf_filtered (outfile, "\n");
fprintf_filtered (outfile, " Symbols cover text addresses ");
print_address_numeric (psymtab->textlow, 1, outfile);
--- 361,383 ----
fprintf_filtered (outfile, ")\n");
}
! fprintf_filtered (outfile, " Section offset table\n");
! {
! int empty = 1;
! for (i = 0; i < psymtab->objfile->num_sections; ++i)
! {
! CORE_ADDR offset = ANOFFSET (psymtab->section_offsets, i);
! if (offset != 0)
! {
! fprintf_filtered (outfile, "%5d ", i);
! print_address_numeric (offset, 1, outfile);
! fprintf_filtered (outfile, "\n");
! empty = 0;
! }
! }
! if (empty)
! fprintf_filtered (outfile, " (empty)\n");
! }
fprintf_filtered (outfile, " Symbols cover text addresses ");
print_address_numeric (psymtab->textlow, 1, outfile);
next reply other threads:[~2001-02-28 13:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-28 13:48 Michael Elizabeth Chastain [this message]
2001-03-01 0:47 ` Eli Zaretskii
2001-03-01 7:40 ` Andrew Cagney
2001-03-01 12:44 Michael Elizabeth Chastain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200102282148.NAA06598@bosch.cygnus.com \
--to=chastain@cygnus.com \
--cc=gdb-patches@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox