bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

note from Prof D E Knuth


From: Maggie McLoughlin
Subject: note from Prof D E Knuth
Date: Fri, 30 Jan 2004 10:51:56 -0800

Dear people,

The version of GDB that I installed recently has an annoying bug that
I had not encountered in previous versions: It fails to find the source
file that is explicitly mentioned in a #line directive.

Here are three files that document the problem. Please let me know
if more explanation is needed.

---- cut here for my source file gdb-bug.w ----- (written in CWEB)
@* Intro. This trivial \.{CWEB} program demonstrates a bug in
`GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)'.

@c
main()
{
  printf("Hello");
  printf(" there.");
}

---- cut here for the file gdb-bug.c generated by CTANGLE from gdb-bug.w
/*1:*/
#line 4 "gdb-bug.w"

main()
{
printf("Hello");
printf(" there.");
}/*:1*/

---- of course I then used gcc to compile the program
       and I launched gdb from emacs via CTL-x gdb

---- cut here for an annotated transcript of what happened
       when I tried to set a breakpoint via emacs
       in the "there" line of gdb-bug.w

(gdb) file gdb-bug
Load new symbol table from "gdb-bug"? (y or n) y
Reading symbols from gdb-bug...
done.
### at this point I tried to insert a breakpoint at line 8 with emacs, but got:
No source file named gdb-bug.w.
### so that failed, and I had to work around it as follows:
(gdb) break main
Breakpoint 6 at 0x804836c: file gdb-bug.w, line 7.
### now, CTL-x SPACE in the emacs window did work as it should:
Breakpoint 7 at 0x804837c: file gdb-bug.w, line 8.
(gdb) run
Starting program: /home/don/tmp/gdb-bug 
Breakpoint 6, main () at gdb-bug.w:7
(gdb) n

Breakpoint 7, main () at gdb-bug.w:8
(gdb) n
(gdb) c
Continuing.
Hello there.
Program exited with code 07.

### sometimes (but not always) gdb will forget gdb-bug.w again
###   when I recompile the program, making it unable to reset breakpoints

### this glitch did not exist in the gdb I've used for many years in the past

--------

Thanks again for your previous help. I hope this bug is either
already known or easily fixable. The debugger is the most important
program in my entire system!

-- Don Knuth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]