unable to display the souce line in gdb

Hi All,

I am unable to display the code in gdb. When i put list command i dont get any line. I mean i am unable to display the source line in gdb.

Can any body help me.

Thanks & Regards
Gauri

Some of the things which need to be done before your run your application in gdb.

Make sure the application is compiled with the -ggdb flag. Minimally the -g flag should be there. None of -O flags should be present.

Try running your app and see if you can see the source code displayed.

Hi Vino,

Thanks for the reply. But i have just exe file. How can i check these flags in a complied version.

Thanks & Regards
Gauri

Hi, does anyone know how can I skip a loop 'n' number of times in gdb.

For e.g:

for (i= 0; i< 100; i++) {
...
}

Lets say I am single stepping the program and I reach this loop. Now I want to skip running the loop 10 times. (I do not want to single step inside the loop for the first 10 iterations)

Can I do that ?

Thank you !!

You should have created a new thread for this as it is a new topic. The simplest solution I can think of is to use a conditional breakpoint, where you would set the condition based on the value of i.