digitalmars.D - How to debug in Visual studio?
- Robin Min (11/11) Dec 08 2006 hi, guys
- Lionello Lunesu (5/17) Dec 08 2006 VS will understand DMD's objs just fine, but make sure you compile with ...
- Robin Min (14/34) Dec 08 2006 really? On my laptop, there is only VS2005, it is not work well as you'd...
- Lionello Lunesu (10/49) Dec 08 2006 ??? I'm using VS2005 too, and VS will happily show the line number for
- Patrick Byrne (4/5) Mar 29 2007 Same here. I can compile and run code in VS2005xpress, but I can't debug...
- Bill Baxter (8/15) Mar 29 2007 I tried to get this working a while back and came to the conclusion it
- kris (4/28) Mar 29 2007 FWIW, I use MSVC6 all the time with pretty decent success. It does suck
- Daniel Keep (17/46) Mar 29 2007 Same with windbg. When I'm actually debugging a procedure, and I want
- Patrick Byrne (4/8) Mar 29 2007 Is there any more information on this, please? I saw the vsplugind page ...
- Jascha Wetzel (4/6) Mar 30 2007 i'd suggest http://ddbg.mainia.de/
- Daniel Keep (35/42) Mar 30 2007 Clearly you have an unbiased opinion on the matter :P
- Jascha Wetzel (23/33) Mar 30 2007 i also use GUIs for debugging, since i feel the command line isn't
- Daniel Keep (54/117) Mar 30 2007 For me, it's more a case of "what the hell line am I on?" "what are my
- Jascha Wetzel (17/35) Mar 30 2007 this appears to be resolved in another branch of this thread.
- Patrick Byrne (26/29) Mar 30 2007 I am trying to get dmd/ddbg/cblocks working at the moment. It seems to
- Daniel Keep (21/59) Mar 30 2007 IIRC, there are a number of things you need to do to get DDBG to work in
- Patrick Byrne (6/14) Mar 30 2007 Thanks very much! Unfortunately, I had already scraped this info from
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (6/11) Mar 30 2007 So basically, if '-g' is automagically added to the linker options
- Jascha Wetzel (13/51) Mar 30 2007 check settings > compiler and debugger > debugger settings > display
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/7) Mar 30 2007 If you're talking about Bug #10658, it'll get fixed shortly...
- Daniel Keep (16/27) Mar 30 2007 Yup, that's mine :)
- Daniel Keep (22/42) Mar 30 2007 You know, I just tried this on a small test program, and it worked!
- Frits van Bommel (6/40) Mar 30 2007 Sorry for canceling that post, but I saw your other message posted about...
- Jascha Wetzel (3/6) Mar 30 2007 please consider testing it with ddbg as well and telling me if ddbg is
- Jascha Wetzel (17/32) Mar 30 2007 dmd produces OMF files with CodeView debug symbols in "version" NB09,
hi, guys I am a newbie need your help. I had config my MS-IDE to develop my D application.But my question is , after I using 'dmd -c',I got the .obj file,maybe as you know , this .obj is OMF format; It is mean that I can not use MS-Linker to get one .exe and .pdb file for debug . what can I do in this case? I know some tools using for convert COFF format to OMF, Is there any tools can help me conver OMF to COFF? any response will be appreciate. Best Regard Robin Min
Dec 08 2006
VS will understand DMD's objs just fine, but make sure you compile with -g for the symbolic info. L. "Robin Min" <luonbin hotmail.com> wrote in message news:elbshi$dc5$1 digitaldaemon.com...hi, guys I am a newbie need your help. I had config my MS-IDE to develop my D application.But my question is , after I using 'dmd -c',I got the .obj file,maybe as you know , this .obj is OMF format; It is mean that I can not use MS-Linker to get one .exe and .pdb file for debug . what can I do in this case? I know some tools using for convert COFF format to OMF, Is there any tools can help me conver OMF to COFF? any response will be appreciate. Best Regard Robin Min
Dec 08 2006
really? On my laptop, there is only VS2005, it is not work well as you'd said,although I had append the '-g'. I think maybe you mean some old version of Visual studio? for example ,VC6 or older, I do not check it , casuse do not installed this old dev-env. After google, I got some information about VS2005: from this version ,M$-linker will not support link OMF format .obj file. Otherwise your will get some link error message. So my question is is there already any solution on this problem? I belive someother linker can do this job, but I am not sure. BR Robin Min "Lionello Lunesu" <lionello lunesu.remove.com> 写入消息新闻:elcjln$16ud$1 digitaldaemon.com...VS will understand DMD's objs just fine, but make sure you compile with -g for the symbolic info. L. "Robin Min" <luonbin hotmail.com> wrote in message news:elbshi$dc5$1 digitaldaemon.com...hi, guys I am a newbie need your help. I had config my MS-IDE to develop my D application.But my question is , after I using 'dmd -c',I got the .obj file,maybe as you know , this .obj is OMF format; It is mean that I can not use MS-Linker to get one .exe and .pdb file for debug . what can I do in this case? I know some tools using for convert COFF format to OMF, Is there any tools can help me conver OMF to COFF? any response will be appreciate. Best Regard Robin Min
Dec 08 2006
??? I'm using VS2005 too, and VS will happily show the line number for exceptions. I've been debugging D with VC6 and VS2003 as well. The linker might not support OMF, but the debugger hasn't changed, I think. Have a look at vsplugind on dsource.org.. It will get you syntax highlighting and F7-building in VS2005, but it shouldn't be needed for debugging. (Not even for syntax highlighting, you can do that with a "usertype.dat" in the VS bin folder) L. "Robin Min" <luonbin hotmail.com> wrote in message news:eld95i$1r2b$1 digitaldaemon.com...really? On my laptop, there is only VS2005, it is not work well as you'd said,although I had append the '-g'. I think maybe you mean some old version of Visual studio? for example ,VC6 or older, I do not check it , casuse do not installed this old dev-env. After google, I got some information about VS2005: from this version ,M$-linker will not support link OMF format .obj file. Otherwise your will get some link error message. So my question is is there already any solution on this problem? I belive someother linker can do this job, but I am not sure. BR Robin Min "Lionello Lunesu" <lionello lunesu.remove.com> 写入消息新闻:elcjln$16ud$1 digitaldaemon.com...VS will understand DMD's objs just fine, but make sure you compile with -g for the symbolic info. L. "Robin Min" <luonbin hotmail.com> wrote in message news:elbshi$dc5$1 digitaldaemon.com...hi, guys I am a newbie need your help. I had config my MS-IDE to develop my D application.But my question is , after I using 'dmd -c',I got the .obj file,maybe as you know , this .obj is OMF format; It is mean that I can not use MS-Linker to get one .exe and .pdb file for debug . what can I do in this case? I know some tools using for convert COFF format to OMF, Is there any tools can help me conver OMF to COFF? any response will be appreciate. Best Regard Robin Min
Dec 08 2006
Lionello Lunesu Wrote:The linker might not support OMF, but the debugger hasn't changed, I think.Same here. I can compile and run code in VS2005xpress, but I can't debug. Is this possible to do at all, please? Thanks
Mar 29 2007
Patrick Byrne wrote:Lionello Lunesu Wrote:I tried to get this working a while back and came to the conclusion it wasn't possible. I think someone mentioned that VS2005 has dropped support for the debugging info format that DMD uses. But either way, debugging with VS2003 was no treat, because everything D specific just came out as longs and void*s. CodeBlocks with ddbg is much better. Or wait for the rumored VS add-in for D coming <real soon>. --bbThe linker might not support OMF, but the debugger hasn't changed, I think.Same here. I can compile and run code in VS2005xpress, but I can't debug. Is this possible to do at all, please? Thanks
Mar 29 2007
Bill Baxter wrote:Patrick Byrne wrote:FWIW, I use MSVC6 all the time with pretty decent success. It does suck that it can't see inside classes or arrays half the time, but after a while you just, erm, lower your expectations ;)Lionello Lunesu Wrote:I tried to get this working a while back and came to the conclusion it wasn't possible. I think someone mentioned that VS2005 has dropped support for the debugging info format that DMD uses. But either way, debugging with VS2003 was no treat, because everything D specific just came out as longs and void*s. CodeBlocks with ddbg is much better. Or wait for the rumored VS add-in for D coming <real soon>. --bbThe linker might not support OMF, but the debugger hasn't changed, I think.Same here. I can compile and run code in VS2005xpress, but I can't debug. Is this possible to do at all, please? Thanks
Mar 29 2007
kris wrote:Bill Baxter wrote:Same with windbg. When I'm actually debugging a procedure, and I want to watch arrays and such, I make a habit of adding stuff like this: debug auto somestr_ptr = somestr.ptr; debug auto somestr_length = somestr.length; Messy, but it works. I'd kill to have a better debugging environment, but I somehow doubt that's going to happen. *sigh* -- Daniel -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/Patrick Byrne wrote:FWIW, I use MSVC6 all the time with pretty decent success. It does suck that it can't see inside classes or arrays half the time, but after a while you just, erm, lower your expectations ;)Lionello Lunesu Wrote:I tried to get this working a while back and came to the conclusion it wasn't possible. I think someone mentioned that VS2005 has dropped support for the debugging info format that DMD uses. But either way, debugging with VS2003 was no treat, because everything D specific just came out as longs and void*s. CodeBlocks with ddbg is much better. Or wait for the rumored VS add-in for D coming <real soon>. --bbThe linker might not support OMF, but the debugger hasn't changed, I think.Same here. I can compile and run code in VS2005xpress, but I can't debug. Is this possible to do at all, please? Thanks
Mar 29 2007
Thanks for your replies, chaps.I tried to get this working a while back and came to the conclusion it wasn't possible. I think someone mentioned that VS2005 has dropped support for the debugging info format that DMD uses.VS8XPress docs indicate that LINK.EXE accepts OMF files....? Ho hum.Or wait for the rumored VS add-in for D coming <real soon>.Is there any more information on this, please? I saw the vsplugind page at dsource.org, but it looks as though that won't be available for Visual Studio Express edition. I presume that nice features like customisation plugins won't be available for the freebie version. :-( Patrick
Mar 29 2007
Daniel Keep wrote:Messy, but it works. I'd kill to have a better debugging environment, but I somehow doubt that's going to happen. *sigh*i'd suggest http://ddbg.mainia.de/ i might go as far as to claim that it's better than windbg.
Mar 30 2007
Jascha Wetzel wrote:Daniel Keep wrote:Clearly you have an unbiased opinion on the matter :P The problem with ddbg is that it doesn't have the... well, I can't say "nice" since the windbg GUI is rubbish... GUI that windbg offers. I always tend to get lost with the interactive text debuggers. [1] The *second* problem is that I'm coding in DWEB. What happens here is that my source .dw file is tangled into a .d file, which is then compiled. So when I go to debug, instead of displaying the line in my original source file, it displays the line in the horrific, unreadable mess that is the .d file. Basically, every single time I recompile, I have to go in, delete the .d files, and copy the .dw files to .d files in order to get the right lines to show up. [2] So yeah; debugging at the moment is a major pain the posterior. I doubt ddbg would help, but in all fairness, it wasn't designed for quite my circumstances :P Thankfully though, windbg doesn't seem to care so long as the debugging information is present. -- Daniel [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... -_- Also a pity that probably can't even understand my particular source files (see second problem above). [2] Yes, D encodes the *correct* line number, but the *wrong* filename! I posted a request to fix this, and never got a single reply :'( -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/Messy, but it works. I'd kill to have a better debugging environment, but I somehow doubt that's going to happen. *sigh*i'd suggest http://ddbg.mainia.de/ i might go as far as to claim that it's better than windbg.
Mar 30 2007
Daniel Keep wrote:Clearly you have an unbiased opinion on the matter :Pobviously ;)The problem with ddbg is that it doesn't have the... well, I can't say "nice" since the windbg GUI is rubbish... GUI that windbg offers. I always tend to get lost with the interactive text debuggers. [1]i also use GUIs for debugging, since i feel the command line isn't concise enough when debugging larger programs. i didn't write a GUI for ddbg, though, because they are a matter of taste and it's more flexible to have a debugger that integrates in different GUIs. that said, as of now, there clearly aren't enough GUIs you can use ddbg with (codeblocks and zeus only afaik). but codeblocks appears to be quite solid atm.The *second* problem is that ... my source .dw file is tangled into a .d file ...i could easily add an option to ddbg that will take care of that. i just wonder: are the lines in the .dw files the same as in the .d files, just with code added on the same line? else the line numbers couldn't be the same. with translation of the file extension, you should also be able to use codeblocks to debug .dw files.[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... -_-hm, i may misunderstand you, but there's a text field where you can add any option that will be passed on to DMD in build options > compiler settings > other options - this is per target. there can also be custom build commands per file.Also a pity that probably can't even understand my particular source files (see second problem above).if by "understand" you mean syntax sensitive editing stuff, the .dw extension can be added in settings > editor > syntax highlighting > filemasks. these filemasks are also used for goto function, code completion etc.
Mar 30 2007
Jascha Wetzel wrote:Daniel Keep wrote:For me, it's more a case of "what the hell line am I on?" "what are my local variables?" "what's the value of that damn global now?" etcetera :)Clearly you have an unbiased opinion on the matter :Pobviously ;)The problem with ddbg is that it doesn't have the... well, I can't say "nice" since the windbg GUI is rubbish... GUI that windbg offers. I always tend to get lost with the interactive text debuggers. [1]i also use GUIs for debugging, since i feel the command line isn't concise enough when debugging larger programs.i didn't write a GUI for ddbg, though, because they are a matter of taste and it's more flexible to have a debugger that integrates in different GUIs. that said, as of now, there clearly aren't enough GUIs you can use ddbg with (codeblocks and zeus only afaik). but codeblocks appears to be quite solid atm.Hopefully we'll see more support for ddbg; it's pretty much *the* best debugging tool for D in existence--certainly the only one targeted at D specifically.Not even close. CWEB (and DWEB, which is based on CWEB) are for literate programming. Here's a sample:The *second* problem is that ... my source .dw file is tangled into a .d file ...i could easily add an option to ddbg that will take care of that. i just wonder: are the lines in the .dw files the same as in the .d files, just with code added on the same line? else the line numbers couldn't be the same. with translation of the file extension, you should also be able to use codeblocks to debug .dw files.Now we'll deal with the peep's schedule. For the sake of simplicity, this model assumes that every person in the universe has a uniform nine-to-five work day. All we need to do is watch out for when the simulation ticks past 9:00 AM and 5:00 PM, and act accordingly. <Process peep's schedule >= if( sim.data.advancedToTime(9,0) ) { peepId.moveTo(params.work); } else if( sim.data.advancedToTime(17,0) ) { peepId.moveTo(params.home); }The first part is a (sometimes very verbose) explanation of the code, what it's for, etc. and is written using TeX. Then we have a named section, and its contents. The advantage of all this is that I can use "dweave foo && pdftex foo" to produce a perfectly typeset PDF book of the source code, and "dtangle foo" to produce a compilable source file. This is very handy given that the implementation of my project basically becomes the bulk of my honours thesis: I just have to weave the source files, stick them together with the rest of the thesis and have it printed off. But the best part (re: the discussion at hand)? This isn't even necessarily linear; I can use the <Process peep's schedule > section anywhere else in my code, potentially multiple times. Works a bit like a #define. Here's what the above becomes in the .d file:/*13:*/ #line 148 "simple.dw" if(sim.data.advancedToTime(9,0)) { peepId.moveTo(params.work); } else if(sim.data.advancedToTime(17,0)) { peepId.moveTo(params.home); }Section 13, sourced from line 148 of simple.dw. That starts on line 137 of simple.d. Also, for some reason that escapes me, Knuth saw fit to remove all whitespace when it outputs the code. [1] Which is what's weird: DMD outputs the correct line number, but the *wrong filename*, which is really what's causing problems.Yes, the option is there, but in the builds I've used, it doesn't work. Basically, Code::Blocks chews up any additional options you add, and dumps them into the "Defines" section... which isn't used by DMD, so the options are ignored. I've already filed a ticket on it, so it will hopefully be fixed sometime soon.[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... -_-hm, i may misunderstand you, but there's a text field where you can add any option that will be passed on to DMD in build options > compiler settings > other options - this is per target. there can also be custom build commands per file.As you can see above, getting it to highlight the D code is the easy part. Getting it to highlight the *TeX* code at the same time, let alone make *sense* of the file; that's the hard part ;) FYI, I'm currently using a hacked version of VIM's CWEB syntax files, modified to load the D syntax file instead of the C one, so the highlighting mostly works. I've never really missed the code completion stuff: I have all my code modules as indexed and cross-referenced PDFs :P -- Daniel [1] Even more fun: [0..5] gets turned into [0. .5] which is interpreted as [0.0 0.5], and you can't enter imaginary numbers *at all* without escaping them! I really should get around to fixing DWEB; at the moment it's basically just modified to read in .dw files instead of .w, and output .d instead of .c. -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/Also a pity that probably can't even understand my particular source files (see second problem above).if by "understand" you mean syntax sensitive editing stuff, the .dw extension can be added in settings > editor > syntax highlighting > filemasks. these filemasks are also used for goto function, code completion etc.
Mar 30 2007
Daniel Keep wrote:Not even close. CWEB (and DWEB, which is based on CWEB) are for literate programming. Here's a sample: ...this is neat, i'm likely to check this out in detail soon.Which is what's weird: DMD outputs the correct line number, but the *wrong filename*, which is really what's causing problems.this appears to be resolved in another branch of this thread.Yes, the option is there, but in the builds I've used, it doesn't work. Basically, Code::Blocks chews up any additional options you add, and dumps them into the "Defines" section... which isn't used by DMD, so the options are ignored. I've already filed a ticket on it, so it will hopefully be fixed sometime soon.ic - it worked for the simple cases that i had so far. besides the problems that CB still has with this, you can also use rebuild or similar. simply set the rebuild call to be the custom build step and remove all files from the target, such that the CB builder won't do anything for them. i'm using this on one project and i'm thinking about making it my default.As you can see above, getting it to highlight the D code is the easy part. Getting it to highlight the *TeX* code at the same time, let alone make *sense* of the file; that's the hard part ;)oh, ok - but since we started comparing CB+Ddbg to WINDBG, it still looks good ;)FYI, I'm currently using a hacked version of VIM's CWEB syntax files, modified to load the D syntax file instead of the C one, so the highlighting mostly works. I've never really missed the code completion stuff: I have all my code modules as indexed and cross-referenced PDFs :Pthe main syntax feature i use is "goto declaration". makes browsing the code a lot faster. VIM could actually work with Ddbg btw. AFAIK it has GDB support, and could therefore get along with Ddbg in GDB mode. If not it still might when i get to implement the GDB/MI interface, which will be sooner the more editors/IDEs and people need it.
Mar 30 2007
Jascha Wetzel wrote: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.....[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... -_-
Mar 30 2007
Patrick Byrne wrote:Jascha Wetzel wrote:IIRC, there are a number of things you need to do to get DDBG to work in Code::Blocks. The two that I can remember off the top of my head are: 1. Make sure you have "gdb" in ddbg's filename somewhere. I just copied ddbg.exe to ddbg_gdb.exe, and told CB to use that. 2. Code::Block's D template is a little iffy atm. You need to go in to linker options and add the '-g' switch; can't remember where, exactly. The reason is that dmd is both compiler and linker, and it seems that if you link debug code without '-g', OPTLINK will actually drop the debugging info. Hope that helps :) -- Daniel -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/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.....[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... -_-
Mar 30 2007
Daniel Keep wrote:1. Make sure you have "gdb" in ddbg's filename somewhere. I just copied ddbg.exe to ddbg_gdb.exe, and told CB to use that. 2. Code::Block's D template is a little iffy atm. You need to go in to linker options and add the '-g' switch; can't remember where, exactly. The reason is that dmd is both compiler and linker, and it seems that if you link debug code without '-g', OPTLINK will actually drop the debugging info.Thanks very much! Unfortunately, I had already scraped this info from the forums/webpages, and even with this set it isn't working. :-( I shall re-post this problem shortly to the ...debugger forum, in case people would rather it lived there. -P
Mar 30 2007
Daniel Keep wrote:2. Code::Block's D template is a little iffy atm. You need to go in to linker options and add the '-g' switch; can't remember where, exactly. The reason is that dmd is both compiler and linker, and it seems that if you link debug code without '-g', OPTLINK will actually drop the debugging info.So basically, if '-g' is automagically added to the linker options whenever the '-g' compiler switch is thrown - everything is peachy ? Wonder if this applies to the DigitalMars C/C++ (dmc) compiler too... If so, it should be flagged as a CB bug against both DMC/DMD plugin. --anders
Mar 30 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: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.....[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... -_-
Mar 30 2007
Daniel Keep 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... -_-See http://forums.codeblocks.org/index.php/topic,5553.0.html --anders
Mar 30 2007
Anders F Bj鰎klund wrote:Daniel Keep wrote:Yup, that's mine :) Glad to hear they've got a fix for it[1]. There's a project I've been thinking about that would *seriously* benefit from having a proper IDE with debugging support... -- Daniel [1] Actually, make that *impressed*. -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/[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... -_-See http://forums.codeblocks.org/index.php/topic,5553.0.html --anders
Mar 30 2007
Frits van Bommel wrote:Daniel Keep wrote:You know, I just tried this on a small test program, and it worked! Which is strange since it's never worked before... the only thing that didn't work properly was that it couldn't find source files for modules in subdirectories, which always worked before (albeit choosing the .d file instead of the .dw file). How bizarre. Once I've finished with the current refactoring, I'll give debugging another shot and see if something's magically changed since the last time I used it. Typical. It doesn't work until I tell someone, and then it works. If I didn't know better, I'd say either windbg or dmd is doing this to spite me :P -- Daniel -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/The *second* problem is that I'm coding in DWEB. What happens here is that my source .dw file is tangled into a .d file, which is then compiled. So when I go to debug, instead of displaying the line in my original source file, it displays the line in the horrific, unreadable mess that is the .d file. Basically, every single time I recompile, I have to go in, delete the .d files, and copy the .dw files to .d files in order to get the right lines to show up. [2][snip][2] Yes, D encodes the *correct* line number, but the *wrong* filename! I posted a request to fix this, and never got a single reply :'(Do the .d files contain the correct "#line" token sequences? I.e. something like '#line 6 "myfile.dw"' (_including_ the file name)? If so then DMD _should_ generate the correct debug info (according to http://www.digitalmars.com/d/lex.html#specialtokens). I haven't tested this, among other things because it probably wouldn't mean much since I'm not using Windows and debug info is different on Linux.
Mar 30 2007
Daniel Keep wrote:Frits van Bommel wrote:Sorry for canceling that post, but I saw your other message posted about 10 minutes before it which included a seemingly correct #line directive so I figured it was kind of useless...Daniel Keep wrote:The *second* problem is that I'm coding in DWEB. What happens here is that my source .dw file is tangled into a .d file, which is then compiled. So when I go to debug, instead of displaying the line in my original source file, it displays the line in the horrific, unreadable mess that is the .d file. Basically, every single time I recompile, I have to go in, delete the .d files, and copy the .dw files to .d files in order to get the right lines to show up. [2][snip][2] Yes, D encodes the *correct* line number, but the *wrong* filename! I posted a request to fix this, and never got a single reply :'(Do the .d files contain the correct "#line" token sequences? I.e. something like '#line 6 "myfile.dw"' (_including_ the file name)? If so then DMD _should_ generate the correct debug info (according to http://www.digitalmars.com/d/lex.html#specialtokens). I haven't tested this, among other things because it probably wouldn't mean much since I'm not using Windows and debug info is different on Linux.You know, I just tried this on a small test program, and it worked! Which is strange since it's never worked before... the only thing that didn't work properly was that it couldn't find source files for modules in subdirectories, which always worked before (albeit choosing the .d file instead of the .dw file). How bizarre. Once I've finished with the current refactoring, I'll give debugging another shot and see if something's magically changed since the last time I used it. Typical. It doesn't work until I tell someone, and then it works. If I didn't know better, I'd say either windbg or dmd is doing this to spite me :PSo in order to fix lots of bugs you just need to be quick to tell somebody about them so they'll fix themselves :P.
Mar 30 2007
Daniel Keep wrote:How bizarre. Once I've finished with the current refactoring, I'll give debugging another shot and see if something's magically changed since the last time I used it.please consider testing it with ddbg as well and telling me if ddbg is missing something to make it happen.
Mar 30 2007
dmd produces OMF files with CodeView debug symbols in "version" NB09, sometimes called CodeView 4.10 or CodeView 4 (which is misleading, since NB08 is also a CodeView 4 format) according to the version of the MS debugger that corresponds to that format version. there are two flavours of NB09 symbols. one with 16bit indeces and one with 32bit indeces. external debug symbols (.pdb files) are labeled NB10. the external file then contains NB09 or NB11 data. NB11 uses 32bit indeces only. it has been introduced with VC5. support for 16bit NB09 seems to have silently vanished from the MS debuggers after that. the old version of WINDBG that comes with DMD and the internal debugger from VS6 seem to be the last versions that support it. curiously, i tried WINDBG versions older than the one from the DMD distribution and they didn't support 16bit NB09 either - messy... Ddbg supports 16bit NB09 of course, since it's tailored to DMD ...mandatory footnote ;) Robin Min wrote:hi, guys I am a newbie need your help. I had config my MS-IDE to develop my D application.But my question is , after I using 'dmd -c',I got the .obj file,maybe as you know , this .obj is OMF format; It is mean that I can not use MS-Linker to get one .exe and .pdb file for debug . what can I do in this case? I know some tools using for convert COFF format to OMF, Is there any tools can help me conver OMF to COFF? any response will be appreciate. Best Regard Robin Min
Mar 30 2007