From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21998 invoked by alias); 12 Jun 2014 03:49:23 -0000 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 Received: (qmail 21982 invoked by uid 89); 12 Jun 2014 03:49:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jun 2014 03:49:21 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Wuw0r-0000wj-SM from Yao_Qi@mentor.com ; Wed, 11 Jun 2014 20:49:17 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Jun 2014 20:49:17 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Wed, 11 Jun 2014 20:48:55 -0700 Message-ID: <539922D1.9030904@codesourcery.com> Date: Thu, 12 Jun 2014 03:49:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH] "$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint. References: <1402323778-27849-1-git-send-email-palves@redhat.com> In-Reply-To: <1402323778-27849-1-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00486.txt.bz2 On 06/09/2014 10:22 PM, Pedro Alves wrote: > And, likewise, "file" with no arguments only started turning > breakpoints set in the main executable to "" with the > remote-symbol-file patch (63644780). The old behavior is now ^^^^^^ remove I don't see breakpoint set in the main executable becomes "" (with and without this patch applied), if the following steps are what you meant. (gdb) b main Breakpoint 1 at 0x80484c1: file ../../../../git/gdb/testsuite/gdb.base/wchar.c, line 29. (gdb) file No executable file now. Discard symbol table from `/home/yao/Source/gnu/gdb/build-git/x86/gdb/testsuite/gdb.base/wchar'? (y or n) y Error in re-setting breakpoint 1: No symbol table is loaded. Use the "file" command. No symbol file now. (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep n 0x080484c1 > restored, and we break-unload-file.exp test now exercizes both "gdb; > file PROGRAM" and "gdb PROGRAM". Hope this table helps the understanding to the flags setting in different scenarios: shared library loaded by program OBJF_SHARED add-symbol-file foo OBJF_SHARED | OBJF_USERLOADED symbol-file or file foo OBJF_USERLOADED ./gdb foo Neither > @@ -7729,18 +7729,19 @@ disable_breakpoints_in_freed_objfile (struct objfile *objfile) > if (objfile == NULL) > return; > > - /* OBJF_USERLOADED are dynamic modules manually managed by the user > - with add-symbol-file/remove-symbol-file. Similarly to how > - breakpoints in shared libraries are handled in response to > - "nosharedlibrary", mark breakpoints in OBJF_USERLOADED modules > + /* OBJF_SHARED|OBJF_USERLOADED objfiles are dynamic modules manually > + managed by the user with add-symbol-file/remove-symbol-file. > + Similarly to how breakpoints in shared libraries are handled in > + response to "nosharedlibrary", mark breakpoints in such modules The comments are clear to me... > shlib_disabled so they end up uninserted on the next global > location list update. Shared libraries not loaded by the user > aren't handled here -- they're already handled in > disable_breakpoints_in_unloaded_shlib, called by solib.c's > solib_unloaded observer. We skip objfiles that are not > - OBJF_USERLOADED (nor OBJF_SHARED) as those aren't considered > - dynamic objects (e.g. the main objfile). */ > - if ((objfile->flags & OBJF_USERLOADED) == 0) > + OBJF_SHARED as those aren't considered dynamic objects (e.g. the > + main objfile). */ > + if ((objfile->flags & OBJF_SHARED) == 0 > + || (objfile->flags & OBJF_USERLOADED) == 0) > return; ... these are clear too, but shouldn't we only check "(objfile->flags & OBJF_SHARED) == 0" here? which means objfile is a shared library loaded by program or is added by add-symbol-file can be processed afterwards. -- Yao (齐尧)