From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8693 invoked by alias); 21 Apr 2008 11:36:21 -0000 Received: (qmail 8680 invoked by uid 22791); 21 Apr 2008 11:36:21 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 21 Apr 2008 11:36:03 +0000 Received: (qmail 21438 invoked from network); 21 Apr 2008 11:36:00 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Apr 2008 11:36:00 -0000 From: Pedro Alves To: Daniel Jacobowitz Subject: Re: MI testsuite fix Date: Mon, 21 Apr 2008 12:58:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: gdb-patches@sourceware.org References: <200804102102.07722.pedro@codesourcery.com> <20080414182131.GC1968@caradoc.them.org> In-Reply-To: <20080414182131.GC1968@caradoc.them.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_ewHDIA04x+bo7X7" Message-Id: <200804211235.58900.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2008-04/txt/msg00425.txt.bz2 --Boundary-00=_ewHDIA04x+bo7X7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 2275 A Monday 14 April 2008 19:21:31, Daniel Jacobowitz wrote: > On Thu, Apr 10, 2008 at 09:02:07PM +0100, Pedro Alves wrote: > > It is also arguable if that warning has any value, but in any case, > > we should be filtering warnings. > > I am not sure this is true. Warning the user about this sort of > thing should imply something really wrong; otherwise, bothering > the user (who probably can not do anything about it except report it > to us) is not very helpful. And during the testsuite there shouldn't > be anything wrong that the user (i.e. the testsuite harness) can't > fix. > Fair enough. > As for the warning itself, I'd approve a patch to remove it. Ok, that's what the attached does. Regtested on x86_64-unknown-linux-gnu, and confirmed that is also fixes the async MI testsuite on x86 due to the gate page warning. BTW, What is it that won't work with the look for .text first? /* Find lowest loadable section to be used as starting point for continguous sections. FIXME!! won't work without call to find .text first, but this assumes text is lowest section. */ lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); if (lower_sect == NULL) bfd_map_over_sections (objfile->obfd, find_lowest_section, > I'd also > approve a patch to reuse some of the qOffsets machinery for this, but > that would take more testing... if you want to look at that, > keep in mind that SEC_LOAD doesn't mean the VMA is useful; you > also need to check !SEC_THREAD_LOCAL. Now you've lost me. This is mapping absolute section addresses to section offsets. It doesn't seem symfile_map_offsets_to_segments or objfile_relocate would give any help here? I could see passing OFFSETS instead ADDRS in more cases where we want to pass addresses/offsets for all sections so we wouldn't have to rely on sections names for addr->offset mapping. There's the unfortunaty that xcoff_symfile_offsets ignores ADDRS, but I'm sure something could be done about it. (While I was looking at it, I've reorganized the code to use objfile_relocate after reading the symbols, instead of setting the section offsets before reading them, but it didn't give any simplification, so I dropped it.) What machinery do you mean exactly? -- Pedro Alves --Boundary-00=_ewHDIA04x+bo7X7 Content-Type: text/x-diff; charset="iso-8859-1"; name="remove_warning.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remove_warning.diff" Content-length: 1433 2008-04-21 Pedro Alves * symfile.c (syms_from_objfile): Don't warn if lowest loadable section is not a code section. --- gdb/symfile.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) Index: src/gdb/symfile.c =================================================================== --- src.orig/gdb/symfile.c 2008-04-18 22:12:58.000000000 +0100 +++ src/gdb/symfile.c 2008-04-18 22:14:02.000000000 +0100 @@ -821,18 +821,13 @@ syms_from_objfile (struct objfile *objfi bfd_map_over_sections (objfile->obfd, find_lowest_section, &lower_sect); if (lower_sect == NULL) - warning (_("no loadable sections found in added symbol-file %s"), - objfile->name); - else - if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) - warning (_("Lowest section in %s is %s at %s"), - objfile->name, - bfd_section_name (objfile->obfd, lower_sect), - paddr (bfd_section_vma (objfile->obfd, lower_sect))); - if (lower_sect != NULL) - lower_offset = bfd_section_vma (objfile->obfd, lower_sect); + { + warning (_("no loadable sections found in added symbol-file %s"), + objfile->name); + lower_offset = 0; + } else - lower_offset = 0; + lower_offset = bfd_section_vma (objfile->obfd, lower_sect); /* Calculate offsets for the loadable sections. FIXME! Sections must be in order of increasing loadable section --Boundary-00=_ewHDIA04x+bo7X7--