tags:

views:

146

answers:

4

I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack.

Alternatively, is there another debugger that works with d? Is there another way to get a stack trace when there is an exception?

A: 

Haven't used ddbg yet, but according to the documentation at http://ddbg.mainia.de/doc.html there is the

onex <cmd; cmd; ...> on exception execute list of commands

command.

VolkerK
A: 

I saw the onex command, but I couldn't find a break command. The two commands below don't seem to work.

onex break
onex b
This isn't a discussion form, you should edit the question to add this information and delete this answer.
he_the_great
+1  A: 

You want to break when there's any exception thrown or just uncaught exceptions? Because I think the latter is already the default behavior.

You probably know this, but you get the stack trace by typing 'us' (unwind stack) at the prompt. Just trying to eliminate the obvious.

Anyway, I've never had to use onex. Never even heard of it. Another thing you could try is forcing execution to stop by putting in asserts.

Baxissimo
I want to break at the throw site so that I can inspect local variables.
+1  A: 

You can get stack traces on exceptions by modding the runtime, by the way. The best resource is probably this backtrace hack page

larsivi