Bug 44037 - runs but cannot set breakpoint
Summary: runs but cannot set breakpoint
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-06-10 04:55 UTC by Mike Rubel
Modified: 2007-04-18 16:33 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Mike Rubel 2001-06-10 04:55:34 UTC
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:

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
entropy$  > rpm --verify gcc
entropy$  > rpm -q gcc
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 05:44:08 UTC
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.