You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A c based user application on QEMU in Ubuntu can be debugged in Eclipse c++. The kernel can also be debugged -see below
1.Eclipse -new project- makefile project with existing code
2. Right click on the project in the project explorer debug configuration -remote application.
In the main tab:
c/c++ application:
select /output/test/runtime/bin/creat (for the creat example)
select manual debug launcher ( option is at the bottom left corner of the dialog)
debugger->main tab:
stop at startup : main
I have gdb-multiarch in the gdb debugger text box (normal gdb does not seem to work when debugging the kernel).
debugger->connection:
port:1234 (this is for qemu)
starting debugging in eclipse -> open the debug configuration dialog
To debug the kernel use
/output/stage3/bin/stage3.img as c++ application
For the creat example ( calls into kernel with the creat call which calls open_internal)
use open_internal as stop at startup option
There will be no symbols for the user application but we can load them using the gdb console once debugging has started.
at the (gdb) prompt using the add-symbol-file command
add-symbol-file path to /nanos/output/image/test/creat 0x77777777....
the 0x77777.... is the address of the text section in the user application, which can be obtained using readelf. see here for example- https://stackoverflow.com/questions/21508357/the-address-where-filename-has-been-loaded-is-missing-gdb
There will be no symbols for libc but these should be available with libc source linked to the app - I have not tried this.
Ideally we should have one elf "binary symbols file" that can be used to debug both the user app, libc and the kernel
The text was updated successfully, but these errors were encountered: