This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]