From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12837 invoked by alias); 2 Oct 2007 20:09:25 -0000 Received: (qmail 12813 invoked by uid 22791); 2 Oct 2007 20:09:22 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 20:08:55 +0000 Received: (qmail 20756 invoked from network); 2 Oct 2007 20:08:54 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Oct 2007 20:08:54 -0000 To: Carlos Eduardo Seo Cc: gdb@sourceware.org, drow@false.org Subject: Re: DWARF question References: <46FAC9D7.9080001@linux.vnet.ibm.com> <20070926212539.GA17502@caradoc.them.org> <46FAD46B.9000006@br.ibm.com> <46FD5A9B.2070004@linux.vnet.ibm.com> <46FD7AE9.8030208@linux.vnet.ibm.com> <4701333C.9040705@linux.vnet.ibm.com> From: Jim Blandy Date: Tue, 02 Oct 2007 20:09:00 -0000 In-Reply-To: <4701333C.9040705@linux.vnet.ibm.com> (Carlos Eduardo Seo's message of "Mon, 01 Oct 2007 14:49:48 -0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2007-10/txt/msg00021.txt.bz2 This one's fun, and demonstrates the 'exact_match' lossage I was concerned about before. Take a look at where two successive 'break 9' commands set the breakpoints. (Having three CUs didn't turn out to be important; you could get the same effect without 'bar'.) $ cat 1s3c.mk CFLAGS = -g CC = gcc all: 1s3c 1s3c: 1s3cFOO.o 1s3cMAIN.o 1s3cBAR.o $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ 1s3c%.o: 1s3c.c $(CC) $(CFLAGS) $(CPPFLAGS) -D$* -c $< -o $@ clean: rm -f 1s3c 1s3c*.o $ cat 1s3c.c #include extern void foo (void); #ifdef FOO void foo (void) { puts ("foo"); } #endif #ifdef MAIN int main (int argc, char **argv) { puts ("main"); foo (); puts ("main again"); bar (); puts ("main yet again"); return 0; } #endif #ifdef BAR void bar (void) { puts ("foo"); } #endif $ ~/gdb/pub/nat/gdb/gdb 1s3c GNU gdb 6.7.50-20070924-cvs Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break 9 Breakpoint 1 at 0x8048398: file 1s3c.c, line 9. (gdb) break 9 Breakpoint 2 at 0x804838a: file 1s3c.c, line 9. (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x08048398 in main at 1s3c.c:9 2 breakpoint keep y 0x0804838a in foo at 1s3c.c:9 (gdb)