Stack Trace

BlitzMax Forums/BlitzMax Programming/Stack Trace

BLaBZ(Posted 2012) [#1]
How can I get a stack trace when an exception is thrown?

Thanks!


Brucey(Posted 2012) [#2]
To begin with, you will need to build/run your app in debug mode. Release apps do not contain stack debug information.

If you are running it from the editor, it should highlight the line in your program source, and show a stacktrace in the Debug view.

If you are not running it from the editor, you are screwed ;-)
(well, no, that's not entirely true… but the built-in support for interacting with debug is limited outside of the editor.)


BLaBZ(Posted 2012) [#3]
ohhh :(

Well, I'm releasing a beta version of my software and would like to have bug reporting.

Would I always need the source code in order to do a stack trace?

Thanks!


Brucey(Posted 2012) [#4]
No, debug mode doesn't require the source to be present. It's just something your Editor uses to highlight the line that is in the stacktrace.

If you are running in debug outside of the editor, and you have a shell/console window available, you will see a tilde (~) appear. If you then type "h", it will display a list of interactive debugging commands that you can use.
Not really suitable for end-users, though.

Otherwise, if you really need such information available for a release binary, you'll need to implement your own logging, or perhaps use a third-party logger.


BLaBZ(Posted 2012) [#5]
Ok! Great input!

Thanks a lot Brucey! :)