Default Debugger issue?

I’ve cheked today with the official Haiku apps sources, and the issue is the same : from what I can see, the debug files are not well handled.

Below is the use case :
clock application

Activate debugging for apps : build/jam/UserBuildConfig

# Enable debugging for directory src/system/boot/loader recursively.
SetConfigVar DEBUG : HAIKU_TOP src apps : 1 : global ;

Then compile :
jam -q Clock

Then launch debugger from the “generated.x86_64” dir :
Debugger objects/haiku/x86_64/debug_1/apps/clock/Clock

No source code is visible.

Versus GDB :

So I’m really wondering in which use cases today Debugger is working fine.
So far I’ve got only 1 application recognized by Debugger : a one 1 file application (simple OpenGL app)

Anybody has some success on this ?

I’m currently working on a article on how to generate debug infos for haiku official apps and the way to debug them.
EDIT : I will advice both Debugger and GDB

Again, for specific issues please open tickets.
Dwarf5 is implementef iirc, so a lack of implementation is not the problem. Potentially problems with it still exist (but then you can tell gcc to use a previous dwarf format too.)

https://cgit.haiku-os.org/haiku/log/src/kits/debugger

Have you actually tried the “Click to locate source file” option?

Presumeably gdb in qt creator, in the context of a project, has to know where the source file is… But i don’t see how you expect Debugger to figure this out without info

What do you mean by “Click to locate source file” option.

Maybe I don’t know this feature, but I can’t see this in Debugger.

Ok I find something : if I put the source files in the directory “generated.x86_64” ii’s working fine !

So maybe it’s something relative to how Debugger is determining the sources directory to look for, or another option is that during the build the directory indicated is not accurate ? (I don’t know if debug info are putting directory location for files)

Notice that line of text below the “Run” / “Step over” / “Step into” / “Step out” buttons on your screenshot of Debugger debugging Clock.

From your screenshot

Ok got it thanks ! So I confirm it’s working fine now.

The “issue” seems to be relative to the build :
“jam -q Clock” is considering the sources files are in “generated.x86_64” instead of “src/apps/clock” hence the confusion + I didn’t see that nice feature to select the sources path.

Perhaps this can be made a bit more prominent, to indicate this is an actionable item and not an informative text string

1 Like

A thing to note here, when apps crash the “generate report” option is quite helpfull for debugging the OS, it gives a text readable backtrace etc for upload, compared to a core dumb the debug symbols are only needed on the generting system, not for the insoecting person (and the report is readable online directly)

Ok thanks for this information, I will report this “generate report” feature

And I will close the ticket I’ve created on that topic as it’s more a “feature” not understood on my side and not a bug