From: Jim Blandy <jimb@codesourcery.com>
To: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Cc: gdb@sourceware.org, drow@false.org
Subject: Re: DWARF question
Date: Tue, 02 Oct 2007 20:09:00 -0000 [thread overview]
Message-ID: <m3sl4txoru.fsf@codesourcery.com> (raw)
In-Reply-To: <4701333C.9040705@linux.vnet.ibm.com> (Carlos Eduardo Seo's message of "Mon, 01 Oct 2007 14:49:48 -0300")
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 <stdio.h>
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 <http://gnu.org/licenses/gpl.html>
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)
prev parent reply other threads:[~2007-10-02 20:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 21:25 Carlos Eduardo Seo
2007-09-26 21:27 ` Daniel Jacobowitz
2007-09-27 8:29 ` Carlos Eduardo Seo
2007-09-28 20:26 ` Carlos Eduardo Seo
2007-09-28 21:13 ` Jim Blandy
2007-09-28 23:14 ` Carlos Eduardo Seo
2007-09-28 23:49 ` Jim Blandy
2007-10-01 17:49 ` Carlos Eduardo Seo
2007-10-02 19:15 ` Jim Blandy
2007-10-02 19:26 ` Carlos Eduardo Seo
2007-10-02 21:43 ` Carlos Eduardo Seo
2007-10-02 23:05 ` Carlos Eduardo Seo
2007-10-02 20:03 ` Jim Blandy
2007-10-02 20:09 ` Jim Blandy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3sl4txoru.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=cseo@linux.vnet.ibm.com \
--cc=drow@false.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox