Can't get ddbg to work in Code::Blocks

Patrick Byrne pbyrne at frontier.co.uk
Fri Mar 30 06:45:38 PDT 2007


Jascha Wetzel wrote:
 > this is not the ddbg output.
 > note that there are two tabs, one called "Debugger" and one called
 > "Debugger (debug)". the former holds short infos from CB that are
 > independent of the debugger, the latter is the tab that holds the ddbg
 > output and what codeblocks sends to ddbg as input.

I see no 'Debugger (debug)' tab. I presume you mean the 'Code::Blocks 
Debug' tab, which has lots of stuff on it.

All that the debugger adds (after pressing 'Step-in') is:
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 1, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0
[14:38:28.951]: Scanned 0 files for #includes, cache used 0, cache updated 0

 > don't worry - if you're trying command-line debugging, you just do that
 > to fix this problem and get back to CB after that ;)

Well, this is my attempt at debugging so far:

C:\d\hworld>\dmd\bin\ddbg_gdb.exe bin\Debug\hworld.exe
Ddbg v0.0.5.3 alpha - D Debugger
Copyright (c) 2007 Jascha Wetzel
http://ddbg.mainia.de/

(gdb) break main
Breakpoint 0 at 0x00000000
(gdb) run
Error: couldn't write breakpoint opcode at :0
(gdb) n
Warning: Unknown command 'n' ignored!
(gdb) next
ERROR: Couldn't read from process' memory for disassembly: Only part of 
a ReadProcessMemory or WriteProcessMemory request was completed.

....I haven't used gdb before, but all does not seem to be well!

<* * *>

If I just start and run I get:

C:\d\hworld>\dmd\bin\ddbg_gdb.exe bin\Debug\hworld.exe
Ddbg v0.0.5.3 alpha - D Debugger
Copyright (c) 2007 Jascha Wetzel
http://ddbg.mainia.de/

(gdb) run
ntdll.dll  loaded
KERNEL32.dll  loaded
USER32.dll  loaded
GDI32.dll  loaded
IMM32.dll  loaded
ADVAPI32.dll  loaded
RPCRT4.dll  loaded
LPK.dll  loaded
USP10.dll  loaded
msvcrt.dll  loaded
Program exited
(gdb)

....which flashes up a DOS box, presumably with the 'hello world' 
output, though it doesn't wait for a key press as it should. If I run 
the program from Code::Blocks (without trying to step) it works ok:

hello world
args.length = 1
args[0] = 'c:\d\hworld\bin\Debug\hworld.exe'

Process returned 0 (0x0)   execution time : 0.015 s
Press any key to continue.


....most odd!


-P


More information about the Digitalmars-d-debugger mailing list