From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24260 invoked by alias); 29 Oct 2007 01:31:47 -0000 Received: (qmail 24248 invoked by uid 22791); 29 Oct 2007 01:31:46 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.174) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 29 Oct 2007 01:31:43 +0000 Received: by ug-out-1314.google.com with SMTP id o2so972544uge for ; Sun, 28 Oct 2007 18:31:40 -0700 (PDT) Received: by 10.67.29.12 with SMTP id g12mr364180ugj.1193621498699; Sun, 28 Oct 2007 18:31:38 -0700 (PDT) Received: from ?78.130.26.114? ( [78.130.26.114]) by mx.google.com with ESMTPS id d27sm6136962nfh.2007.10.28.18.31.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Oct 2007 18:31:35 -0700 (PDT) Message-ID: <4725378D.5010800@portugalmail.pt> Date: Mon, 29 Oct 2007 03:06:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.13) Gecko/20070824 Thunderbird/1.5.0.13 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org, insight@sourceware.org Subject: Re: syms_from_objfile() warnings and win32-nat.c IO redirection (Was: suppress annoying warnings about cygwin1.dbg) References: <46264A56.BA86EED7@dessent.net> <4638AB6B.5AA94B26@dessent.net> <46803846.F99470AE@dessent.net> <46804DAD.4020309@portugalmail.pt> <20070625234015.GA17640@caradoc.them.org> <46833EB0.E8ABC8CB@dessent.net> <20070628104601.GA10328@caradoc.them.org> <20071011195327.GB8200@caradoc.them.org> <470FFB00.9909C731@dessent.net> <47101DB4.6010204@portugalmail.pt> <20071024184207.GA10943@caradoc.them.org> In-Reply-To: <20071024184207.GA10943@caradoc.them.org> Content-Type: multipart/mixed; boundary="------------000700040709090708070608" 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: 2007-10/txt/msg00745.txt.bz2 This is a multi-part message in MIME format. --------------000700040709090708070608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 3375 Daniel Jacobowitz wrote: > On Sat, Oct 13, 2007 at 02:21:56AM +0100, Pedro Alves wrote: >> 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); >> - else > > Removing these warnings seems reasonable. I'll be glad to be rid of > them on GNU/Linux too: > > warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4 > >> + else >> + { >> + int flags = bfd_get_section_flags (objfile->obfd, lower_sect); >> + if (flags == 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))); >> + >> + lower_offset = bfd_section_vma (objfile->obfd, lower_sect); >> + } > > But why are you keeping this warning? I'm not sure what flags == 0 > checks, but it's very unlikely to be true; most sections will have > SEC_READONLY set. > Blunder, it should have been: + if ((flags & SEC_CODE)== 0) to match this bit above: - if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) which means I was trying to remove this warning: - warning (_("no loadable sections found in added symbol-file %s"), - objfile->name); but not touch that one: > warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4 as it doesn't affect the cygwin1.dbg case, because there are no code sections there. Somehow I lost the '& SEC_CODE' in the process. >> @@ -860,12 +860,7 @@ syms_from_objfile (struct objfile *objfi >> addrs->other[i].sectindex = sect->index ; >> } >> else >> - { >> - warning (_("section %s not found in %s"), >> - addrs->other[i].name, >> - objfile->name); >> - addrs->other[i].addr = 0; >> - } >> + addrs->other[i].addr = 0; >> } >> else >> addrs->other[i].addr = lower_offset; > > I know you needed this one before because win32-nat.c specified an > offset for .text manually. I don't think it does so any more, though. > This one's useful, since you can provoke it with a typo: > > (gdb) add-symbol-file cat 1000 -s .dataz 24 > add symbol table from file "cat" at > .text_addr = 0x3e8 > .dataz_addr = 0x18 > (y or n) y > Reading symbols from /bin/cat...warning: section .dataz not found in /bin/cat > Ah, right, I clearly see that now. I just more or less blindly removed the warnings that were being output. We do get that warning today, because the cygwin1.dbg file only contains the debug info sections, but ADDRS is filled with every SEC_ALLOC | SEC_LOAD section of cygwin1.dll. Would it be OK to only do the warning if VERBO (it is set to from_tty in the case you mentioned) or info_verbose are on? Cheers, Pedro Alves --------------000700040709090708070608 Content-Type: text/x-diff; name="sepdebug_warnings.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sepdebug_warnings.diff" Content-length: 1903 2007-10-09 Pedro Alves * symfile.c (syms_from_objfile): Don't warn if loadable sections are not found. Don't warn about which is the lowest section. Only warn about a section not being found if VERBO or info_verbose. Turn that warning into a print_unfiltered. --- gdb/symfile.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) Index: src/gdb/symfile.c =================================================================== --- src.orig/gdb/symfile.c 2007-10-28 22:57:49.000000000 +0000 +++ src/gdb/symfile.c 2007-10-29 00:09:34.000000000 +0000 @@ -821,15 +821,6 @@ syms_from_objfile (struct objfile *objfi if (lower_sect == NULL) 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); else @@ -861,9 +852,10 @@ syms_from_objfile (struct objfile *objfi } else { - warning (_("section %s not found in %s"), - addrs->other[i].name, - objfile->name); + if (verbo || info_verbose) + printf_unfiltered (_("section %s not found in %s\n"), + addrs->other[i].name, + objfile->name); addrs->other[i].addr = 0; } } --------------000700040709090708070608--