From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3657 invoked by alias); 7 Dec 2007 01:57:48 -0000 Received: (qmail 3532 invoked by uid 22791); 7 Dec 2007 01:57:47 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.171) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Dec 2007 01:57:31 +0000 Received: by ug-out-1314.google.com with SMTP id h2so1637740ugf for ; Thu, 06 Dec 2007 17:57:28 -0800 (PST) Received: by 10.67.103.12 with SMTP id f12mr2300051ugm.1196992648495; Thu, 06 Dec 2007 17:57:28 -0800 (PST) Received: from ?78.130.101.241? ( [78.130.101.241]) by mx.google.com with ESMTPS id 27sm178528ugp.2007.12.06.17.57.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Dec 2007 17:57:28 -0800 (PST) Message-ID: <4758A871.9060508@portugalmail.pt> Date: Fri, 07 Dec 2007 01:57:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: gdb@sourceware.org, personel personel , gdb-patches Subject: Re: Debugging a Vlc dll with GDB. References: <20071206182343.GA16137@caradoc.them.org> <433908.24398.qm@web57701.mail.re3.yahoo.com> <20071206202850.GA27429@caradoc.them.org> <47586224.CE80C330@dessent.net> <475893BA.8000700@portugalmail.pt> <20071207004226.GA30430@caradoc.them.org> In-Reply-To: <20071207004226.GA30430@caradoc.them.org> Content-Type: multipart/mixed; boundary="------------070109030904050801080209" X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00056.txt.bz2 This is a multi-part message in MIME format. --------------070109030904050801080209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2964 Daniel Jacobowitz wrote: > On Fri, Dec 07, 2007 at 12:28:42AM +0000, Pedro Alves wrote: >> I could swear there use to be a "pending resolved" >> notice. Did it go away with the multiple breakpoint >> location support? > > Yes, I believe so. It was mostly there to warn you that the > breakpoint number had changed, which Vladimir has now fixed. > Humm, I found it useful, as in "ok, the breakpoint I set in a function that will only trigger after I do this, that, and that, is correctly set". Now, I have to interrupt the inferior and do an info breakpoints to see if it got in. If the breakpoint is in a plugin that gets loaded in reaction to some event, its even worse, as I'll have to poll... >> if (pending_break_support == AUTO_BOOLEAN_AUTO && >> - !nquery ("Make breakpoint pending on future shared library load? ")) >> + !nquery (_("\ >> +Make breakpoint pending on future symbol file addition? "))) > > Accurate, but I don't like it much... sounds awkward. > > For the rest, I don't really like the churn on messages; would it work > to just push the error down below *not_found_ptr = 1, and make it a > NOT_FOUND_ERROR? > Yes it works, but do we want both the current error message, and NOT_FOUND_ERROR message that's already there, but not triggered currently, which is the message one usually sees? I guess you mean something like the attached? In IMHO *this* looks awkward: >gdb/gdb.exe gdb-stripped.exe GNU gdb 6.7.50.20071206-cvs Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-cygwin"... (no debugging symbols found) (gdb) b main No symbol table is loaded. Use the "file" command. Function "main" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (main) pending. (gdb) file gdb/gdb.exe Reading symbols from /home/pedro/gdb/build/gdb/gdb.exe...done. (gdb) r Starting program: /home/pedro/gdb/build/gdb/gdb.exe Breakpoint 1, main (argc=1, argv=0xe336e8) at ../../gdb/src/gdb/gdb.c:28 28 memset (&args, 0, sizeof args); (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x0040107a in main at ../../gdb/src/gdb/gdb.c:28 breakpoint already hit 1 time (gdb) Should one really care if there is no symbol table loaded, as opposed to having symbols for everything else but what one needs? To me, what's important is that the symbol I requested isn't found. With the error out of the way, we'll ask if the user would like to make it pending on a *shared library* load. But, the user may know the symbol isn't from a shared lib (like the example above), get confused, and answer no to the pending query. -- Pedro Alves --------------070109030904050801080209 Content-Type: text/x-diff; name="pending.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pending.diff" Content-length: 2122 2007-12-07 Pedro Alves * linespec.c (symtab_from_filename): Don't error out early if there are no symbols loaded. (decode_variable): Likewise. --- gdb/linespec.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) Index: src/gdb/linespec.c =================================================================== --- src.orig/gdb/linespec.c 2007-12-07 00:33:10.000000000 +0000 +++ src/gdb/linespec.c 2007-12-07 01:39:08.000000000 +0000 @@ -1534,11 +1534,16 @@ symtab_from_filename (char **argptr, cha file_symtab = lookup_symtab (copy); if (file_symtab == 0) { - if (!have_full_symbols () && !have_partial_symbols ()) - error (_("No symbol table is loaded. Use the \"file\" command.")); + int nosyms = !have_full_symbols () && !have_partial_symbols (); + if (not_found_ptr) *not_found_ptr = 1; - throw_error (NOT_FOUND_ERROR, _("No source file named %s."), copy); + + throw_error (NOT_FOUND_ERROR, _("\ +%s\ +No source file named %s."), + nosyms ? _("\ +No symbol table is loaded. Use the \"file\" command.\n") : "", copy); } /* Discard the file name from the arg. */ @@ -1727,6 +1732,7 @@ decode_variable (char *copy, int funfirs struct symtab *sym_symtab; struct minimal_symbol *msymbol; + int nosyms; sym = lookup_symbol (copy, (file_symtab @@ -1744,13 +1750,19 @@ decode_variable (char *copy, int funfirs if (msymbol != NULL) return minsym_found (funfirstline, msymbol); - if (!have_full_symbols () && - !have_partial_symbols () && !have_minimal_symbols ()) - error (_("No symbol table is loaded. Use the \"file\" command.")); - if (not_found_ptr) *not_found_ptr = 1; - throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy); + + nosyms = (!have_full_symbols () + && !have_partial_symbols () + && !have_minimal_symbols ()); + + throw_error (NOT_FOUND_ERROR, + _("\ +%s\ +Function \"%s\" not defined."), + nosyms ? _("\ +No symbol table is loaded. Use the \"file\" command.\n") : "", copy); } --------------070109030904050801080209--