From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18784 invoked by alias); 7 Dec 2007 00:28:56 -0000 Received: (qmail 18771 invoked by uid 22791); 7 Dec 2007 00:28:55 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.172) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Dec 2007 00:28:40 +0000 Received: by ug-out-1314.google.com with SMTP id h2so1611685ugf for ; Thu, 06 Dec 2007 16:28:37 -0800 (PST) Received: by 10.67.115.2 with SMTP id s2mr1980070ugm.1196987317412; Thu, 06 Dec 2007 16:28:37 -0800 (PST) Received: from ?78.130.101.183? ( [78.130.101.183]) by mx.google.com with ESMTPS id 31sm550659ugg.2007.12.06.16.28.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Dec 2007 16:28:37 -0800 (PST) Message-ID: <475893BA.8000700@portugalmail.pt> Date: Fri, 07 Dec 2007 00:28: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 CC: 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> In-Reply-To: <47586224.CE80C330@dessent.net> Content-Type: multipart/mixed; boundary="------------080205050109090808000504" 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/msg00054.txt.bz2 This is a multi-part message in MIME format. --------------080205050109090808000504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 3780 [RFC patch attached -- cc'ed to gdb-patches@] Brian Dessent wrote: > Daniel Jacobowitz wrote: > >>> (gdb) break libvlc_new >>> No symbol table is loaded. use the file command >> Try "set pending on"? Or you may need a newer version of GDB. > > I don't think pending being off is the problem, but you do need a more > recent gdb than what ships with Cygwin. With recent CVS gdb I have had > success with something like: > > gdb VLCTest.exe > add-shared-symbol-files libvlc.dll > b libvlc_new > run > > I have always found debugging stripped binaries on Win32 with gdb to be > somewhat unpleasant. After the first time that the program has run and > terminates, all the pending breakpoint stuff usually seems to work fine, > it's just that initially when nothing has loaded yet it does not. So > that's another workaround, just run the inferior to completion without > any breakpoints and then start debugging the second run. > My opinion is that the pending support should kick in on this case, like in the attached patch, like so: > 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 LoadLibraryW Function not found in loaded symbols: LoadLibraryW Make breakpoint pending on future symbol file addition? (y or [n]) y Breakpoint 1 (LoadLibraryW) pending. (gdb) r Starting program: /home/pedro/gdb/build/gdb-stripped.exe (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) Breakpoint 1, 0x7c80ae4b in LoadLibraryW () from /cygdrive/c/WINDOWS/system32/kernel32.dll (gdb) (Those unconditional "(no debugging symbols found)" in symbol_file_add_with_addrs_or_offsets seem silly to me. An idea would be: if (mainline || from_tty || info_verbose) printf_filtered (_("(no debugging symbols found)")); ? ) And also: >gdb/gdb 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 Function not found in loaded symbols: main Make breakpoint pending on future symbol file addition? (y or [n]) y Breakpoint 1 (main) pending. (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y(p) main (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=0xe336e0) at ../../gdb-server_submit/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-server_submit/src/gdb/gdb.c:28 breakpoint already hit 1 time (gdb) I could swear there use to be a "pending resolved" notice. Did it go away with the multiple breakpoint location support? -- Pedro Alves --------------080205050109090808000504 Content-Type: text/x-diff; name="pending.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pending.diff" Content-length: 2424 2007-12-07 Pedro Alves * breakpoint.c (break_command_1): Update pending breakpoint query text. * linespec.c (symtab_from_filename): Don't call error if there are no symbols loaded. Update message. (decode_variable): Likewise. --- gdb/breakpoint.c | 3 ++- gdb/linespec.c | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) Index: src/gdb/breakpoint.c =================================================================== --- src.orig/gdb/breakpoint.c 2007-12-06 20:53:32.000000000 +0000 +++ src/gdb/breakpoint.c 2007-12-07 00:07:14.000000000 +0000 @@ -5505,7 +5505,8 @@ break_command_1 (char *arg, int flag, in /* If pending breakpoint support is auto query and the user selects no, then simply return the error code. */ 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? "))) return e.reason; /* At this point, either the user was queried about setting Index: src/gdb/linespec.c =================================================================== --- src.orig/gdb/linespec.c 2007-10-03 01:16:04.000000000 +0100 +++ src/gdb/linespec.c 2007-12-06 23:53:34.000000000 +0000 @@ -1534,11 +1534,11 @@ 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.")); if (not_found_ptr) *not_found_ptr = 1; - throw_error (NOT_FOUND_ERROR, _("No source file named %s."), copy); + throw_error (NOT_FOUND_ERROR, + _("Source file not found in loaded symbols: %s"), + copy); } /* Discard the file name from the arg. */ @@ -1744,13 +1744,11 @@ 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); + throw_error (NOT_FOUND_ERROR, + _("Function not found in loaded symbols: %s"), + copy); } --------------080205050109090808000504--