From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 60DA63858D35 for ; Thu, 28 Oct 2021 09:35:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60DA63858D35 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg1oQ-0007OX-LS for gdb@sourceware.org; Thu, 28 Oct 2021 05:35:06 -0400 Received: from ip5f5a8d68.dynamic.kabel-deutschland.de ([95.90.141.104]:60277 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mg1oQ-0004eH-1y for gdb@sourceware.org; Thu, 28 Oct 2021 05:35:06 -0400 To: gdb@sourceware.org From: Simon Sobisch Subject: How to create maintenance breakpoints for running programs? Message-ID: <6b1622f3-ef58-642a-b320-1ebfeae59b98@gnu.org> Date: Thu, 28 Oct 2021 11:35:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 09:35:09 -0000 We can create maintenance breakpoints with gdb.Breakpoint(internal=True), which is good. I've now stumbled over the problem that this _does_ work with not running / attached targets but raises an error message "No symbol table is loaded. Use the "file" command." the breakpoint is then shown under "maint info break" as PENDING (as expected) and is resolved on "start". What I _want_ to achieve is the same as one can see with "plain GDB": $ gdb -q (gdb) maint info break No breakpoints or watchpoints. (gdb) file prog (gdb) star ... (gdb) maint info break (gdb) maint info break Num Type Disp Enb Address What -1 shlib events keep y 0x00007ffff7fe2590 <__GI__dl_debug_state> inf 1 -1.1 y 0x00007ffff7fe2590 <__GI__dl_debug_state> inf 1 -2 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -2.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -3 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -3.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -4 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -4.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -5 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -5.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -6 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -6.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -7 longjmp master keep n 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -7.1 y 0x00007ffff7db3950 <__libc_siglongjmp> inf 1 -8 std::terminate master keep n 0x00007ffff59369c0 inf 1 -8.1 y 0x00007ffff59369c0 inf 1 I'd like to do the same - is there any event I can register to so that I don't create a breakpoint and an error but instead create the breakpoint when GDB actually has a running program? Thanks for any insights, Simon