March 30, 2007 Re: How to debug in Visual studio? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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
| |||
March 30, 2007 Re: How to debug in Visual studio? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | Daniel Keep wrote: > > Frits van Bommel wrote: >> 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. 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... > 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 So in order to fix lots of bugs you just need to be quick to tell somebody about them so they'll fix themselves :P. | |||
March 30, 2007 Re: How to debug in Visual studio? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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 :P the 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. | |||
March 30, 2007 Re: How to debug in Visual studio? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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.
| |||
March 30, 2007 Re: How to debug in Visual studio? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Robin Min | 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
>
>
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply