tags:

views:

33

answers:

1

Here is more specific explanation of what I want to make clear:

  • I have some source c files locate under JM/lencod/src ;
  • and some header h files locate under JM/lencod/inc ;
  • and a Makefile locates at JM/lencod ;

After I compile these source files using Makefile, some of obj files will be generated under JM/lencod/obj , meanwhile a lencod.exe executable file is generated in JM/bin.

Then I want to debug it like what I can do using MS Visual Studio, i.e. step by step debug, watch the parameters changing...

How can I make that happen? To do like this??

$cd ~/JM/bin
$gdb lencod.exe
$break ****
$run

......
There is still one thing,i,e. if I want to set a breakpoint at the main function which is in one c source file lencod.c under JM/lencod/src. How to do this?

Simply typing:

$b main

?

Thanks very much for any possible help:)

A: 

Yes, in order to set a breakpoint on entry in main you have to execute command:

b main

skwllsp
No need to specify break in which file? After I set it "b main", I get the following info: """(gdb) b main Breakpoint 1 at 0x807a9f3""" which does not show to break in which file and also corresponding line number. Is it right?? I just doubt it.
MaiTiano
Seems like you didn't add debugging information
skwllsp