This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] [01/17] Get rid of current_gdbarch in exec.c
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: deuling at de dot ibm dot com (Markus Deuling)
- Cc: gdb-patches at sourceware dot org (GDB Patches)
- Date: Thu, 11 Oct 2007 15:41:19 +0200 (CEST)
- Subject: Re: [rfc] [01/17] Get rid of current_gdbarch in exec.c
Markus Deuling wrote:
> @@ -531,7 +532,7 @@ print_section_info (struct target_ops *t
> {
> struct section_table *p;
> /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */
> - int wid = gdbarch_addr_bit (current_gdbarch) <= 32 ? 8 : 16;
> + int wid = gdbarch_addr_bit (gdbarch_from_bfd (abfd)) <= 32 ? 8 : 16;
I'm not sure this is the right thing to do. For example, this still
will not handle the case where we have libraries of different
architectures loaded.
Since this is used only to determine an appropriate display field
width, I think the correct fix would be to just make two passes
over the section table: in the first pass, do not output anything
but simply take note how many digits the addresses require, and
in the second pass do the actual output.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com