Hi All,
Second question in 2 days...getting my money's worth.
I (and more worringly, my team lead) think that its time I progressed from inserting printf's to debug code to using a proper debugging tool. From the dim & distant past, I remember using dbx but since I don't have that on my server, I am trying to use GDB instead.
What I would like to know is when i run the gdb command passing in the executable, how can i link the source code so I can see where in the program I am in order to add breaks, etc?
Currently i simply do:
$>> gdb main
and get the following:
blah, blah ...Wildebeest was built for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00...(no debugging symbols found)...
Should I recompile the code in some 'debug' mode (seems to ring a bell (-g option??))?. Any advise, etc, gratefully received.
Thanks & rgds,
Sean
Second question in 2 days...getting my money's worth.
I (and more worringly, my team lead) think that its time I progressed from inserting printf's to debug code to using a proper debugging tool. From the dim & distant past, I remember using dbx but since I don't have that on my server, I am trying to use GDB instead.
What I would like to know is when i run the gdb command passing in the executable, how can i link the source code so I can see where in the program I am in order to add breaks, etc?
Currently i simply do:
$>> gdb main
and get the following:
blah, blah ...Wildebeest was built for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00...(no debugging symbols found)...
Should I recompile the code in some 'debug' mode (seems to ring a bell (-g option??))?. Any advise, etc, gratefully received.
Thanks & rgds,
Sean