* how to set breakpoint at a particular line in cpp file
@ 2009-11-19 7:30 n179911
2009-11-19 23:05 ` Paul Pluzhnikov
0 siblings, 1 reply; 4+ messages in thread
From: n179911 @ 2009-11-19 7:30 UTC (permalink / raw)
To: gdb
Hi,
How to set breakpoint at a particular line in cpp?
I tried
(gdb) break HTMLParser.cpp:208
But I get:
No symbol table is loaded. Use the "file" command.
Thanks for your help.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to set breakpoint at a particular line in cpp file
2009-11-19 7:30 how to set breakpoint at a particular line in cpp file n179911
@ 2009-11-19 23:05 ` Paul Pluzhnikov
2009-11-20 6:20 ` n179911
0 siblings, 1 reply; 4+ messages in thread
From: Paul Pluzhnikov @ 2009-11-19 23:05 UTC (permalink / raw)
To: n179911; +Cc: gdb
On Wed, Nov 18, 2009 at 10:43 PM, n179911 <n179911@gmail.com> wrote:
> How to set breakpoint at a particular line in cpp?
>
> I tried
> (gdb) break HTMLParser.cpp:208
That *is* the correct way.
> But I get:
> No symbol table is loaded. Use the "file" command.
Yes, do that!
In order to set a breakpoint, GDB needs to know the address of the
first instruction on the given line. To find that address, GDB needs
to have an executable file compiled with debugging info (usually the
'-g' compiler switch). You *must* provide that executable file, or GDB
will not be able to set the breakpoint.
The usual way to provide such file:
gdb /path/to/executable
Alternatively:
gdb
(gdb) file /path/to/executable
Hope this helps.
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to set breakpoint at a particular line in cpp file
2009-11-19 23:05 ` Paul Pluzhnikov
@ 2009-11-20 6:20 ` n179911
2009-11-20 13:56 ` Paul Pluzhnikov
0 siblings, 1 reply; 4+ messages in thread
From: n179911 @ 2009-11-20 6:20 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb
Thank you.
I followed this step (which download gdb 6.8 built for android),
http://ortegaalfredo.googlepages.com/android
And then I run gdb to attach a process running on android (using the
command gdb -P {Process ID})
And I run (gdb) break HTMLParser.cpp:208 because I am trying to debug
Webkit on android.
So I can't really use the 'file command'.
On Wed, Nov 18, 2009 at 11:10 PM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> On Wed, Nov 18, 2009 at 10:43 PM, n179911 <n179911@gmail.com> wrote:
>
>> How to set breakpoint at a particular line in cpp?
>>
>> I tried
>> (gdb) break HTMLParser.cpp:208
>
> That *is* the correct way.
>
>> But I get:
>> No symbol table is loaded. Use the "file" command.
>
> Yes, do that!
>
>
> In order to set a breakpoint, GDB needs to know the address of the
> first instruction on the given line. To find that address, GDB needs
> to have an executable file compiled with debugging info (usually the
> '-g' compiler switch). You *must* provide that executable file, or GDB
> will not be able to set the breakpoint.
>
> The usual way to provide such file:
>
> gdb /path/to/executable
>
> Alternatively:
>
> gdb
> (gdb) file /path/to/executable
>
> Hope this helps.
>
> Cheers,
> --
> Paul Pluzhnikov
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to set breakpoint at a particular line in cpp file
2009-11-20 6:20 ` n179911
@ 2009-11-20 13:56 ` Paul Pluzhnikov
0 siblings, 0 replies; 4+ messages in thread
From: Paul Pluzhnikov @ 2009-11-20 13:56 UTC (permalink / raw)
To: n179911; +Cc: gdb
On Wed, Nov 18, 2009 at 11:16 PM, n179911 <n179911@gmail.com> wrote:
> I followed this step (which download gdb 6.8 built for android),
> http://ortegaalfredo.googlepages.com/android
>
> And then I run gdb to attach a process running on android (using the
> command gdb -P {Process ID})
>
> And I run (gdb) break HTMLParser.cpp:208 because I am trying to debug
> Webkit on android.
You still have not provided an executable. WebKit is a library, but it
doesn't execute "on its own". It is loaded into *some* executable;
namely the one that is running in process <PID>. If you don't know
which executable that is, try "ps -fp <PID>".
> So I can't really use the 'file command'.
Why not? Once you figure out which executable is running "inside"
process <PID>, invoke GDB like this: "gdb -p <PID>
/path/to/executable", and you should be good to go (assuming you don't
run out of memory that is -- AFAIU WebKit is very large, and I believe
you are quite unlikely to succeed with "native android GDB").
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-19 7:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-19 7:30 how to set breakpoint at a particular line in cpp file n179911
2009-11-19 23:05 ` Paul Pluzhnikov
2009-11-20 6:20 ` n179911
2009-11-20 13:56 ` Paul Pluzhnikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox