From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4403 invoked by alias); 25 Jul 2006 18:22:30 -0000 Received: (qmail 4395 invoked by uid 22791); 25 Jul 2006 18:22:29 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr9.xs4all.nl (HELO smtp-vbr9.xs4all.nl) (194.109.24.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Jul 2006 18:22:26 +0000 Received: from webmail.xs4all.nl (dovemail3.xs4all.nl [194.109.26.5]) by smtp-vbr9.xs4all.nl (8.13.6/8.13.6) with ESMTP id k6PIMFFg014688; Tue, 25 Jul 2006 20:22:16 +0200 (CEST) (envelope-from mark.kettenis@xs4all.nl) Received: from 82.92.89.47 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Tue, 25 Jul 2006 20:22:20 +0200 (CEST) Message-ID: <20303.82.92.89.47.1153851740.squirrel@webmail.xs4all.nl> In-Reply-To: <44C645C0.1050409@undo-software.com> References: <44C63B23.7060306@undo-software.com> <20060725154115.GA13191@nevyn.them.org> <44C6405A.50502@undo-software.com> <20060725160914.GA14110@nevyn.them.org> <44C645C0.1050409@undo-software.com> Date: Tue, 25 Jul 2006 18:40:00 -0000 Subject: Re: bfinish writes to random addresses. From: "Mark Kettenis" To: "Greg Law" Cc: "Daniel Jacobowitz" , gdb@sourceware.org User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00186.txt.bz2 > Daniel Jacobowitz wrote: > > > And there aren't very many hardware breakpoints, if any. > > At least in the cases I've seen on x86, most of the time the hardware > breakpoints aren't in use. Of course, on other architectures there may > be none, and on x86 they may all be used. But my point was that if a > hardware breakpoint is used if available, it would fix this at least in > those cases. If you can come up with some code that doesn't compicate matters too much and falls back on the software breakpoints if no hardware breakpoints are available, that might be a good idea. > Maybe this is considered sufficiently unusual, or a user trying to do > such a thing is considered sufficiently stupid that it isn't considered > worth the effort. But I alas I was sufficiently stupid, and it did take > quite a while to track down what was going on here. Well, I's probably a good idea to look before you jump. Otherwise you might land in deep shit! ;-) > Sorry, bad terminology from me. What I meant was that if there is a > word in memory that is an address in a text segment, then chances are it > is a pointer to some instruction, so most likely it points at the > beginning of the instruction, not into the middle of an instruction. Well, there are quite a few cases where programs execute code outside the text segment. GCC for example, creates trampolines on the stack for nested functions. A better approach would be to look wheter a page at a particular address is "executable". But in general that information is not available to GDB. > > Warning when returning from something with a symbol to something > > without a symbol is an interesting suggestion. Does anyone else have > > comments? Should this warn? > > > > (gdb) bt > > #0 foo() > > #1 0x4000000 in ??? > > (gdb) finish > > > > I was actually suggesting an error rather than a warning. In this case, > it seems that writing into 0x40000000 is almost certainly not what the > user wants gdb to be doing. This situation can arise easily if only partial debug information is available. I think that even a warning would be annoying. Mark