Debuging using core dump and PC

G

gogo

I'm trying to debug my application which is crashing at unknown
location .
In case of normal crash , i can trace the instruction due to which
program crashes using
PC (program counter) printed by OS at the time of crash.
For which i use "gdb exename corefile".
But in this case my program crashes with PC=0x000000 ,
so that I could not trace the instruction due to which program is
crashing .
So Please Suggest me some steps/way using which i can trace instruction
due to which Application
is crashing .
Thanks in advance .

Regards,
Yogesh D.
 
R

Richard Heathfield

gogo said:
I'm trying to debug my application which is crashing at unknown
location .
In case of normal crash , i can trace the instruction due to which
program crashes using
PC (program counter) printed by OS at the time of crash.
For which i use "gdb exename corefile".
But in this case my program crashes with PC=0x000000 ,
so that I could not trace the instruction due to which program is
crashing .
So Please Suggest me some steps/way using which i can trace instruction
due to which Application
is crashing .

Start by identifying input data that reproduces the problem reliably. Then
ignore the core dump, and start debugging the program using that data as
your input. At each stage, check your understanding of the line of code
that is about to execute, and predict its effect. Then execute the line,
and check that your prediction is borne out. If it isn't, investigate, and
correct the code if necessary (in which case, start again, first checking
that the input data still reproduces the problem).

At the end of this process you will find your bug.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top