[ddbg] trap to debugger?
BCS
ao at pathlink.com
Sun Jul 8 15:43:14 PDT 2007
Reply to Vladimir,
> It comes often that during programming, I'd like to add a breakpoint
> at source level. Since I don't use an IDE, having to specify
> breakpoints in file:line format every time I run Ddbg (the line
> numbers change, so the -cmd= parameter doesn't help much). It's common
> practice in other languages to add a "hard breakpoint", for example in
> case of a failed assert (which should never fail anyway, as they are
> checked only in debug builds, so depending on them isn't right). This
> is done by simply inserting an "int 3" instruction in the code:
> asm { int 3; }
> However, Ddbg seems to just ignore these at the moment (while, when
> running the executable as it is, a "Win32 Exception" is raised). Would
> it be hard to make Ddbg catch these exceptions and react as if a
> breakpoint was hit?
> P.S. I realise that this post may sound like it's written in an angry
> mood, but I'm actually very grateful for your work, Jascha :) D
> projects would be considerably harder to maintain on Windows without
> Ddbg!
>
if ddbg takes a "start up commands file" of some sort then you could add:
pragma(msg, "bp "~__FILE__~":"~itoa!(__LINE__));
everywhere you want a breakpoint and then have your build copy these lines
to a file.
build root.d > startup
I have a bunch of stuff like this on a project I'm working on but it's on
linux and uses bash/grep/sed/etc.
More information about the Digitalmars-d-debugger
mailing list