Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: jca3 on April 22, 2011, 08:04:07 pm

Title: Was D language debugging ever implemented?
Post by: jca3 on April 22, 2011, 08:04:07 pm

Like others before me, debugging D language in C::B returns these errors:

The command line option 'nx' is invalid
The command line option 'fullname' is invalid
The command line option 'quiet' is invalid

I've read the old messages on this subject and am curious if there is anything I can do now in 2011 to make this work better. 

Thanks,
John

Title: Re: Was D language debugging ever implemented?
Post by: ptDev on April 22, 2011, 09:26:28 pm
Is your compiler emitting GDB compatible symbols?

If using DMD, are you using the -gc switch (to emulate C)?
Title: Re: Was D language debugging ever implemented?
Post by: jca3 on April 22, 2011, 10:34:51 pm
 
  I am using DMD2 from Digital Mars. 
 
> Is your compiler emitting GDB compatible symbols?
> If using DMD, are you using the -gc switch (to emulate C)?
 
  Why no, I didn't even know about those options. 
 
  How do you implement them? 
 
 
Title: Re: Was D language debugging ever implemented?
Post by: ptDev on April 22, 2011, 10:46:01 pm
  I am using DMD2 from Digital Mars. 
 
> Is your compiler emitting GDB compatible symbols?
> If using DMD, are you using the -gc switch (to emulate C)?
 
  Why no, I didn't even know about those options. 
 
  How do you implement them?

I don't think you need to need to implement anything else. You just need GDB (in addition to DMD) installed to your system. Make sure that GDB is selected as the debugger for your project. Then pass the -gc switch (you can set it at the project build options) before you compile your debug binaries. This switch makes sure that debug information is passed to the binary, but tricks GDB into analyzing it as C debug information. Currently, this is the only way to ensure compatibility with GDB.

Title: Re: Was D language debugging ever implemented?
Post by: jca3 on April 22, 2011, 11:14:29 pm
 
> Make sure that GDB is selected as the debugger for your project.
 
  How do we check that?  I can debug my C++ projects fine, so something's running.  (This is C::B 10.05 BTW).
 
 
> Then pass the -gc switch (you can set it at the project build options)
 
  Is that to be added under Compiler Settings -> Other Options? 
 
  Thanks for your time...