How to debug in Visual studio?

Daniel Keep daniel.keep.lists at gmail.com
Fri Mar 30 05:18:11 PDT 2007



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.

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/



More information about the Digitalmars-d mailing list