From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5511 invoked by alias); 11 Oct 2007 13:41:27 -0000 Received: (qmail 5503 invoked by uid 22791); 11 Oct 2007 13:41:27 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Oct 2007 13:41:23 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9BDfKcV033386 for ; Thu, 11 Oct 2007 13:41:20 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9BDfKhU2302112 for ; Thu, 11 Oct 2007 15:41:20 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9BDfJFI004407 for ; Thu, 11 Oct 2007 15:41:20 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9BDfJ8M004404; Thu, 11 Oct 2007 15:41:19 +0200 Message-Id: <200710111341.l9BDfJ8M004404@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 11 Oct 2007 15:41:19 +0200 Subject: Re: [rfc] [01/17] Get rid of current_gdbarch in exec.c To: deuling@de.ibm.com (Markus Deuling) Date: Thu, 11 Oct 2007 13:54:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (GDB Patches) In-Reply-To: <470DE493.3050505@de.ibm.com> from "Markus Deuling" at Oct 11, 2007 10:53:39 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00281.txt.bz2 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