* relative file paths?
@ 2003-02-26 22:50 christopher j bottaro
2003-02-27 23:31 ` gdb 5.3 doesn't find line numbers David Wuertele
0 siblings, 1 reply; 6+ messages in thread
From: christopher j bottaro @ 2003-02-26 22:50 UTC (permalink / raw)
To: gdb
gdb won't let me set a breakpoint when i use a relative file name. i have to
cd into the dir where the file is to make a break point. its kinda annoying.
am i doing something wrong or is this how its suppose to be?
ex output:
(gdb) pwd
Working directory /home/cjb/projects/cs378/linux-2.4.19.
(gdb) b arch/um/kernel/hostandtime.c:9
No source file named arch/um/kernel/hostandtime.c.
(gdb) cd arch/um/kernel/
Working directory /home/cjb/projects/cs378/linux-2.4.19/arch/um/kernel.
(gdb) b hostandtime.c:9
Breakpoint 4 at 0xa0074187: file hostandtime.c, line 9.
thanks for the help,
-- christopher
^ permalink raw reply [flat|nested] 6+ messages in thread
* gdb 5.3 doesn't find line numbers
2003-02-26 22:50 relative file paths? christopher j bottaro
@ 2003-02-27 23:31 ` David Wuertele
2003-02-27 23:33 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: David Wuertele @ 2003-02-27 23:31 UTC (permalink / raw)
To: gdb
I've tried all manner of experiments, including (gasp!) reading the
GDB manual, but I can't seem to get line number info compiled into my
executables. Check this out:
# gcc -o hello -g -g3 -ggdb -ggdb3 -static hello.c
# /usr/local/bin/gdb hello
GNU gdb 5.3
Copyright 2002 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 conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mipsel-pc-linux-gnu"...
(gdb) list hello.c:26
21 {
22 int j;
23
24 for (i=0; i<2; i++) {
25 for (j=0; j<2; j++) {
26 printf ("Hello, World! (%d,%d)\n", i, j);
27 }
28 }
29
30 return 0;
(gdb) b hello.c:26
No line 26 in file "hello.c".
(gdb)
What gives?!? GDB can list line 26 of hello.c. But it claims there
is 'No line 26 in file "hello.c".' !?!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb 5.3 doesn't find line numbers
2003-02-27 23:31 ` gdb 5.3 doesn't find line numbers David Wuertele
@ 2003-02-27 23:33 ` Daniel Jacobowitz
2003-02-27 23:57 ` David Wuertele
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-02-27 23:33 UTC (permalink / raw)
To: David Wuertele; +Cc: gdb
On Thu, Feb 27, 2003 at 02:41:29PM -0800, David Wuertele wrote:
> I've tried all manner of experiments, including (gasp!) reading the
> GDB manual, but I can't seem to get line number info compiled into my
> executables. Check this out:
>
> # gcc -o hello -g -g3 -ggdb -ggdb3 -static hello.c
> # /usr/local/bin/gdb hello
> GNU gdb 5.3
> Copyright 2002 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 conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "mipsel-pc-linux-gnu"...
> (gdb) list hello.c:26
> 21 {
> 22 int j;
> 23
> 24 for (i=0; i<2; i++) {
> 25 for (j=0; j<2; j++) {
> 26 printf ("Hello, World! (%d,%d)\n", i, j);
> 27 }
> 28 }
> 29
> 30 return 0;
> (gdb) b hello.c:26
> No line 26 in file "hello.c".
What does "info source" say?
> (gdb)
>
> What gives?!? GDB can list line 26 of hello.c. But it claims there
> is 'No line 26 in file "hello.c".' !?!
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb 5.3 doesn't find line numbers
2003-02-27 23:33 ` Daniel Jacobowitz
@ 2003-02-27 23:57 ` David Wuertele
2003-02-28 0:08 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: David Wuertele @ 2003-02-27 23:57 UTC (permalink / raw)
To: gdb
Me> (gdb) b hello.c:26
Me> No line 26 in file "hello.c".
Daniel> What does "info source" say?
(gdb) info source
Current source file is hello.c
Compilation directory is /root
Located in /root/hello.c
Contains 31 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
(gdb) d'oh!
OK, looks like I used the wrong debug flags during compile.
D'oh again.
Thanks,
Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb 5.3 doesn't find line numbers
2003-02-27 23:57 ` David Wuertele
@ 2003-02-28 0:08 ` Daniel Jacobowitz
2003-02-28 0:23 ` David Wuertele
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-02-28 0:08 UTC (permalink / raw)
To: David Wuertele; +Cc: gdb
On Thu, Feb 27, 2003 at 03:37:45PM -0800, David Wuertele wrote:
> Me> (gdb) b hello.c:26
> Me> No line 26 in file "hello.c".
>
> Daniel> What does "info source" say?
>
> (gdb) info source
> Current source file is hello.c
> Compilation directory is /root
> Located in /root/hello.c
> Contains 31 lines.
> Source language is c.
> Compiled with DWARF 2 debugging format.
> Does not include preprocessor macro info.
> (gdb) d'oh!
>
> OK, looks like I used the wrong debug flags during compile.
> D'oh again.
Does that mean you can "break hello.c:26" now? The session you posted
before should have worked...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb 5.3 doesn't find line numbers
2003-02-28 0:08 ` Daniel Jacobowitz
@ 2003-02-28 0:23 ` David Wuertele
0 siblings, 0 replies; 6+ messages in thread
From: David Wuertele @ 2003-02-28 0:23 UTC (permalink / raw)
To: gdb
Daniel> Does that mean you can "break hello.c:26" now?
Yes, now I can.
Daniel> The session you posted before should have worked...
Breaking at a line number did not work before. Now it does. Thanks!
Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-02-28 0:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-26 22:50 relative file paths? christopher j bottaro
2003-02-27 23:31 ` gdb 5.3 doesn't find line numbers David Wuertele
2003-02-27 23:33 ` Daniel Jacobowitz
2003-02-27 23:57 ` David Wuertele
2003-02-28 0:08 ` Daniel Jacobowitz
2003-02-28 0:23 ` David Wuertele
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).