From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2551 invoked by alias); 3 Aug 2011 08:09:12 -0000 Received: (qmail 2529 invoked by uid 22791); 3 Aug 2011 08:09:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Aug 2011 08:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D9BBECB029F; Wed, 3 Aug 2011 10:08:51 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rENSoxCD14IR; Wed, 3 Aug 2011 10:08:41 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 97B2DCB01DC; Wed, 3 Aug 2011 10:08:41 +0200 (CEST) Subject: Re: Break at address on darwin Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: Tristan Gingold In-Reply-To: Date: Wed, 03 Aug 2011 08:09:00 -0000 Cc: Jonas Maebe , gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <6734CF15-E9A4-491A-87BE-DC37BE4DB846@adacore.com> References: <5456BE39-F808-4255-B327-334CBC46B068@elis.ugent.be> To: Ben L. Titzer 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: 2011-08/txt/msg00009.txt.bz2 On Aug 2, 2011, at 11:51 PM, Ben L. Titzer wrote: > On Tue, Aug 2, 2011 at 1:31 PM, Jonas Maebe w= rote: >>=20 >> On 02 Aug 2011, at 21:19, Ben L. Titzer wrote: >>=20 >>> On Tue, Aug 2, 2011 at 12:00 PM, Jeffrey Walton wr= ote: >>>> Are you certain you are setting a breakpoint on an address (eg, b >>>> 0x40000000)? Or is it a symbolic name (b main)? >>=20 >> Just to make sure: to put a breakpoint on an address, it's "b *0x4000000= 0" (i.e., with an extra "*"; but you'd notice if you used the wrong syntax,= since gdb would complain that it can't find a symbol with that name). >=20 > Yes, I am using the correct syntax and gdb will list the breakpoints I > have added. >=20 >>=20 >>> It's an address. I =E6now for sure it's being executed because it's the >>> first instruction in the binary. >>=20 >> Actually, I've noticed on many platforms that breakpoints on the very fi= rst instruction don't work. Did you also try other instructions? >>=20 >=20 > Doesn't matter, no breakpoints work. >=20 > I've attached a sample binary and gdb session. Ben, you are using the Apple version of gdb. Please talk with Apple about this = issue. Tristan. >=20 > ------------------- > % gdb /tmp/add01 > GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC= 2011) > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you = are > welcome to change it and/or distribute copies of it under certain conditi= ons. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for detail= s. > This GDB was configured as "x86_64-apple-darwin"... > (gdb) break *0x1114 > Breakpoint 1 at 0x1114 > (gdb) run > Starting program: /private/tmp/add01 >=20 > Program exited with code 04. > (gdb) disass 0x1114 0x1140 > Dump of assembler code from 0x1114 to 0x1140: > 0x00001114: mov (%esp),%ebx > 0x00001117: mov $0x0,%eax > 0x0000111c: mov 0x1121(,%ebx,4),%edx > 0x00001123: jmp 0x1129 > 0x00001125: add %al,(%eax) > 0x00001127: add %al,(%eax) > 0x00001129: call 0x1148 > 0x0000112e: push %eax > 0x0000112f: mov %esp,%ebx > 0x00001131: push $0x4 > 0x00001133: push %ebx > 0x00001134: push $0x1 > 0x00001136: push $0x0 > 0x00001138: mov $0x4,%eax > 0x0000113d: int $0x80 > 0x0000113f: push %eax > End of assembler dump. > (gdb) break 01148 > No symbol table is loaded. Use the "file" command. > (gdb) break *0x1148 > Breakpoint 2 at 0x1148 > (gdb) run > Starting program: /private/tmp/add01 >=20 > Program exited with code 04. > (gdb) info breakpoints > Num Type Disp Enb Address What > 1 breakpoint keep y 0x00001114 > 2 breakpoint keep y 0x00001148 > (gdb) >