From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18734 invoked by alias); 24 Jul 2009 21:12:20 -0000 Received: (qmail 18726 invoked by uid 22791); 24 Jul 2009 21:12:19 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_22 X-Spam-Check-By: sourceware.org Received: from az33egw02.freescale.net (HELO az33egw02.freescale.net) (192.88.158.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Jul 2009 21:12:12 +0000 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id n6OLC9Tv024879 for ; Fri, 24 Jul 2009 14:12:09 -0700 (MST) Received: from lds03-tx32 (lds03-tx32.am.freescale.net [10.83.20.63]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id n6OLCCcu025843 for ; Fri, 24 Jul 2009 16:12:12 -0500 (CDT) Date: Fri, 24 Jul 2009 21:12:00 -0000 From: "Anmol P. Paralkar" To: gdb@sourceware.org Subject: Cannot insert breakpoint -1. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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: 2009-07/txt/msg00191.txt.bz2 Hello, Is there a reason why GDB will try to set a breakpoint (breakpoint number: -1) at the entry point address on a 'c', after a 'target remote'? (I am using a GDB stub at the remote end that resides in a hypervisor upon which guest OS'es run). I am using gdb-6.8.50.20090717; but, I suppose that this is general GDB behaviour. -------------------------------------------------------------------------------- (gdb) target remote :12007 Remote debugging using :12007 warning: Loadable segment "cpu0_heap_stack" outside of ELF segments warning: Loadable segment "cpu1_heap_stack" outside of ELF segments warning: Loadable segment "cpu2_heap_stack" outside of ELF segments warning: Loadable segment "cpu3_heap_stack" outside of ELF segments warning: Loadable segment "cpu4_heap_stack" outside of ELF segments warning: Loadable segment "cpu5_heap_stack" outside of ELF segments warning: Loadable segment "cpu6_heap_stack" outside of ELF segments warning: Loadable segment ".stats_heap" outside of ELF segments warning: Loadable segment ".dpa_mem" outside of ELF segments 0x0013c880 in ?? () (gdb) p $pc $1 = (void (*)()) 0x13c880 (gdb) c Continuing. Warning: Cannot insert breakpoint -1. Error accessing memory address 0x110000: Unknown error 18446744073709551615. -------------------------------------------------------------------------------- (The entry point is likely not mapped into the TLB at that stage and so it is really a visible problem, else it just does this silently without it getting any attention). I tried to work around the issue by using set remote--packet, where equalled software-breakpoint - but that does not work (it did not send a Z0, but sent an X packet instead (verified with an earlier GDB compiled with tracing on)): -------------------------------------------------------------------------------- (gdb) c Continuing. ^C Program received signal SIGTRAP, Trace/breakpoint trap. 0x0013c888 in ?? () (gdb) c Continuing. Warning: Cannot insert breakpoint -1. Error accessing memory address 0x110000: Input/output error. -------------------------------------------------------------------------------- I then also re-tried with equal to binary-download - but that does not work (it did not send the X, but sent an M packet instead): -------------------------------------------------------------------------------- (gdb) c Continuing. ^C Program received signal SIGTRAP, Trace/breakpoint trap. Cannot remove breakpoints because program is no longer writable. Further execution is probably impossible. 0x0013c880 in ?? () (gdb) -------------------------------------------------------------------------------- Please could someone kindly shed light on this GDB behaviour? Thank you. Anmol.