Hard crash in debugger: full stack trace?

Recent Xojo versions have the ability to detect a hard crash when running the debug app in the IDE. It shows you the line where the crash happened.

This is good.

However, it also seems to suppress the actual stack trace, which you could normally find in the Console app.

Without the full track trace, it makes debugging a little harder.

Can we have it both ways? Have the IDE catch the hard crash and show us the line #, and cause a crash log to be created?

I put this in the macOS category since it’s not easy to get crash logs on other OSs by default.

2 Likes

That would be really convenient.

When I run into that, I end up building the app and then after it crashes I grab the log from ~/Library/Logs/DiagnosticReports

We can catch this in code and print a backtrace.

See SignalHandlerMBS class and the QueryStacktrace function there.

Or just use SetPrintBacktraceAndAbortHandler there to have the plugin print a stack trace before crashing.

@Christian Schmitz: What does the method do? I still get “Application crashed” but no crash log:

Well, I just tried it in a console app where the printout ends up in the Terminal:

For a GUI app, you may need to check Console.app or the messages tab?

2 Likes

The messages tab only has started/ended, but the Console has the information.