* No source file named getopt.c.
@ 2015-03-20 6:09 Fei Ding
2015-03-20 7:59 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Fei Ding @ 2015-03-20 6:09 UTC (permalink / raw)
To: gdb
Hi:
I want to set a break point on some code in getopt.c, but I just got:
////////////////////////////////////////////
(gdb) b getopt.c:100
No source file named getopt.c.
////////////////////////////////////////////
then, I did this to add the source directory of that code, as:
////////////////////////////////////////////
(gdb) directory /home/dingaaa/test/gdb-7.6/libiberty/
Source directories searched: /home/dingaaa/test/gdb-7.6/libiberty:$cdir:$cwd
////////////////////////////////////////////
but still, I get
////////////////////////////////////////////
(gdb) b getopt.c:100
No source file named getopt.c.
////////////////////////////////////////////
BTW: I've changed Makefiles, with `-g -O0`
What's the problem?
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: No source file named getopt.c.
2015-03-20 6:09 No source file named getopt.c Fei Ding
@ 2015-03-20 7:59 ` Eli Zaretskii
2015-03-20 8:11 ` Fei Ding
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2015-03-20 7:59 UTC (permalink / raw)
To: Fei Ding; +Cc: gdb
> Date: Fri, 20 Mar 2015 14:09:00 +0800
> From: Fei Ding <fdingiit@gmail.com>
>
> I want to set a break point on some code in getopt.c, but I just got:
>
> ////////////////////////////////////////////
> (gdb) b getopt.c:100
> No source file named getopt.c.
> ////////////////////////////////////////////
>
> then, I did this to add the source directory of that code, as:
>
> ////////////////////////////////////////////
> (gdb) directory /home/dingaaa/test/gdb-7.6/libiberty/
> Source directories searched: /home/dingaaa/test/gdb-7.6/libiberty:$cdir:$cwd
> ////////////////////////////////////////////
>
> but still, I get
> ////////////////////////////////////////////
> (gdb) b getopt.c:100
> No source file named getopt.c.
> ////////////////////////////////////////////
>
> BTW: I've changed Makefiles, with `-g -O0`
>
> What's the problem?
You can only do this when debugging a program that has getopt.c
compiled in. Since you give no details on how you built that program,
it's hard to say something more intelligent.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: No source file named getopt.c.
2015-03-20 7:59 ` Eli Zaretskii
@ 2015-03-20 8:11 ` Fei Ding
0 siblings, 0 replies; 3+ messages in thread
From: Fei Ding @ 2015-03-20 8:11 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
I am debugging gdb using gdb, I want to know how gdb handle the
command "gdb filename options", and I've traced to the code of
gdb/main.c, which is main.c:captured_main(), and I lost myself when
step into getopt_long_only() near line 520 (gdb-7.6)
2015-03-20 15:59 GMT+08:00 Eli Zaretskii <eliz@gnu.org>:
>> Date: Fri, 20 Mar 2015 14:09:00 +0800
>> From: Fei Ding <fdingiit@gmail.com>
>>
>> I want to set a break point on some code in getopt.c, but I just got:
>>
>> ////////////////////////////////////////////
>> (gdb) b getopt.c:100
>> No source file named getopt.c.
>> ////////////////////////////////////////////
>>
>> then, I did this to add the source directory of that code, as:
>>
>> ////////////////////////////////////////////
>> (gdb) directory /home/dingaaa/test/gdb-7.6/libiberty/
>> Source directories searched: /home/dingaaa/test/gdb-7.6/libiberty:$cdir:$cwd
>> ////////////////////////////////////////////
>>
>> but still, I get
>> ////////////////////////////////////////////
>> (gdb) b getopt.c:100
>> No source file named getopt.c.
>> ////////////////////////////////////////////
>>
>> BTW: I've changed Makefiles, with `-g -O0`
>>
>> What's the problem?
>
> You can only do this when debugging a program that has getopt.c
> compiled in. Since you give no details on how you built that program,
> it's hard to say something more intelligent.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-20 8:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 6:09 No source file named getopt.c Fei Ding
2015-03-20 7:59 ` Eli Zaretskii
2015-03-20 8:11 ` Fei Ding
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).