This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

About breakpoint in gdb


Hi,

When use gdb to debug in linux, some breakpoint can't
be stop when it is really run through, 

Some friend introduce that use 
b ClassB::function()
instead of 
b ClassB.cpp:1234
For later way would do addicational work same as
addr2line do which may introduce some error.

It is a good way, but I encounter some exception these
days:

1)My example is when 
set a breakpoint at 
ClassB::function()
it can't be stop
but set a breakpoint at
(ClassB * )obj->function();
Then press s can step into ClassB::function()

I am not sure it is true for other case or it can't
stop for other reason.

2)I am not sure if there exist a c function like int3.

I can add this function to ClassB::function(), after
compile&run, gdb can stop as I want.
Does someone use this way?

Thanks for any comment about 1) or 2)
gan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]