How to debug in Visual studio?

Jascha Wetzel "[firstname]" at mainia.de
Fri Mar 30 05:10:26 PDT 2007


check settings > compiler and debugger > debugger settings > display
debugger's log
you'll have a message tab "Debugger (debug)" which displays almost all
of the communication between codeblocks and ddbg.
ddbg will probably give a more verbose error message that you'll find there.
alternatively you can also try debugging your program on the command
line to find the problem.

you may have to consider that codeblocks compiles and links in separate
steps. therefore compiler and linker need to have the -g option. you
have to add the -g switch manually in the build options for the linker.

also note, that you need codeblocks nightly build from 2007-03-19 or
newer for stepping to work correctly.

Patrick Byrne wrote:
> Jascha Wetzel wrote:
>>> [1] That said, ddbg works beautifully with Code::Blocks.  A pity, then,
>>> that Code::Blocks is incapable of passing arguments to the D compiler at
>>> the moment, which makes it totally useless... -_-
> 
> I am trying to get dmd/ddbg/cblocks working at the moment. It seems to
> compile and link ok, and if I run my program from the command line it
> works:
> 
> hello world
> args.length = 1
> args[0] = 'C:\d\hworld\bin\Debug\hworld.exe'
> 
> ....but when I try to step in (having set up ddbg_gdb.exe as the
> debugger), it just terminates, with this in the output window:
> 
> Building to ensure sources are up-to-date
> Build succeeded
> Selecting target: Debug
> Adding source dir: c:\d\hworld\
> Adding source dir: c:\d\hworld\
> Adding file: bin\Debug\hworld.exe
> Starting debugger: done
> Registered new type: wxString
> Registered new type: STL String
> Registered new type: STL Vector
> Setting breakpoints
> Program exited
> Debugger finished with status 0
> 
> ...can someone please shed light on why the debugger is not playing ball?
> 
> Thanks
> 
> -P
> 
> PS Code::Blocks looks like a worthy replacement for Visual Studio, if
> only I could get the debugger working.....



More information about the Digitalmars-d mailing list