Bug 44037 - runs but cannot set breakpoint
runs but cannot set breakpoint
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-10 00:55 EDT by Mike Rubel
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-06-10 00:55:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Rubel 2001-06-10 00:55:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
In simple "hello world" test program, hello.c, compiled to executable
hello.  Runs fine. Can run with gdb also.  Try to set breakpoint on
line 62; here's what happens:

(gdb) break 62
No line 62 in file "init.c"

So try 
(gdb) break hello.c:62
No source file named hello.c.

But hello.c is in the same directory (which is in the path).  What is
init.c anyway?  Gdb ain't too useful without breakpoints...

How reproducible:
Always

Steps to Reproduce:
1. Start gdb on any executable that's been compiled with -g
2. Try to set a breakpoint in the source file with break ## or
   break file:##

Actual Results:  As described above; tries to break in a file called
"init.c" by default, which doesn't seem to exist; if you specify a file it
says the file is not found, even if it is in the path.

Expected Results:  Should have set the breakpoint.

Additional info:

(My machine's name is entropy.  Wrote a simple "hello world" demo program
in C that *does* have a line 62 I want to break at, and does include
main().  I've used gdb many times on previous versions w/o trouble--this is
weird.  I first noticed the problem when trying to debug a more complicated
program--thought I'd done something wrong.  Eventually I tried it on
another program I'd written and got the same result.  I seem to get the
same result with every program...  they all run fine but I cannot set
breakpoints.  So I made this demonstration).


entropy$  > rpm --verify gdb
entropy$  > rpm -q gdb
gdb-5.0rh-5
entropy$  > rpm --verify gcc
entropy$  > rpm -q gcc
gcc-2.96-81
entropy$  > gcc -Wall -g -o hello hello.c
entropy$  > hello
Hello World
entropy$  > gdb hello
[...gdb startup text omitted...]
(gdb) break 62
No line 62 in file "init.c".
(gdb) break hello.c:62
No source file named hello.c.
(gdb) run
Starting program: /home/mrubel/progs/sandbox/gtk/hello 
Hello World

Program exited normally
(gdb) quit
Comment 1 Mike Rubel 2001-06-10 01:44:08 EDT
OOPS!  -- WITHDRAWN --
My mistake-- wasn't actually compiling with -g, due to a bug in my makefiles. 
This part of gdb works fine.  Next time I'll check more carefully.  Sorry!

Note You need to log in before you can comment on or make changes to this bug.