How to debug in Visual studio?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Fri Mar 30 05:31:30 PDT 2007


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.



More information about the Digitalmars-d mailing list