From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5774 invoked by alias); 28 Dec 2012 00:17:23 -0000 Received: (qmail 5760 invoked by uid 22791); 28 Dec 2012 00:17:21 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Dec 2012 00:17:13 +0000 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 27 Dec 2012 22:17:11 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 27 Dec 2012 22:17:09 -0200 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 9ED1F352004D for ; Thu, 27 Dec 2012 19:17:08 -0500 (EST) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBS0G9Aw2486494 for ; Thu, 27 Dec 2012 22:16:09 -0200 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBRMHVZ2029577 for ; Thu, 27 Dec 2012 20:17:31 -0200 Received: from [9.8.13.8] ([9.8.13.8]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qBRMHUcJ029565; Thu, 27 Dec 2012 20:17:31 -0200 Message-ID: <50DCE502.5050700@linux.vnet.ibm.com> Date: Fri, 28 Dec 2012 00:17:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jan Kratochvil CC: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [rfc] Print MI fullname even for non-existing files References: <20121217155859.GA8029@host2.jankratochvil.net> <8738z4y1el.fsf@fleche.redhat.com> <20121217183717.GC14232@host2.jankratochvil.net> <87txrkwmfx.fsf@fleche.redhat.com> <20121217185910.GE14232@host2.jankratochvil.net> In-Reply-To: <20121217185910.GE14232@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12122800-2194-0000-0000-0000040D065A 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: 2012-12/txt/msg00829.txt.bz2 On 12/17/2012 04:59 PM, Jan Kratochvil wrote: > gdb/ > 2012-12-17 Jan Kratochvil > > * ada-lang.c (is_known_support_routine): New variable fullname. Use > access call to verify the symtab_to_fullname result. > * breakpoint.c (print_breakpoint_location, update_static_tracepoint): > Remove NULL check of symtab_to_fullname result. > * cli/cli-cmds.c (edit_command): Likewise. > * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) > (mi_cmd_file_list_exec_source_files): Likewise. > * python/py-symtab.c (stpy_fullname): Likewise. > * source.c (symtab_to_fullname): Update function comment. Rename > variable r to fd, move it to inner block. Always provide non-NULL > result. > (print_source_lines_base): Remove NULL check of symtab_to_fullname > result. > * stack.c (print_frame): Likewise. > * symtab.c (iterate_over_some_symtabs, find_line_symtab, sources_info): > Likewise. > * tracepoint.c (print_one_static_tracepoint_marker): Likewise. > > gdb/doc/ > 2012-12-17 Jan Kratochvil > > * gdb.texinfo (GDB/MI Data Manipulation) (fullname): Make it always > present. > (GDB/MI File Commands) (-file-list-exec-source-files): Make the > fullname output always present. > > gdb/testsuite/ > 2012-12-17 Jan Kratochvil > > * gdb.mi/mi-fullname-deleted.exp: New file. > I've seen a high number of failures on gdb.base/list.exp testcase on ppc64 after this change and noticed that gdb was segfaulting when issuing a list with specific arguments: $ ./gdb ./testsuite/gdb.base/list -q -ex 'list list0.h:1' Reading symbols from /home/emachado/gdb/build/gdb/testsuite/gdb.base/list...done. Segmentation fault (core dumped) This seem to be due to a strcmp with a null string 'symtab->fullname' in: if (FILENAME_CMP (symtab->fullname, symtab_to_fullname (s)) != 0) With the patch below, this problem is fixed and gdb.base/list.exp no longer crashes gdb. Ok? 2012-12-27 Edjunior Machado * symtab.c (find_line_symtab): Update symtab->fullname before compare full file name strings. diff --git a/gdb/symtab.c b/gdb/symtab.c index a39e5bf..bd6c3b4 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2547,6 +2547,9 @@ find_line_symtab (struct symtab *symtab, int line, symtab->filename); } + /* Get symbol full file name if possible. */ + symtab_to_fullname (symtab); + ALL_SYMTABS (objfile, s) { struct linetable *l;