-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give symbol file to GDB after connecting #213
Comments
Noted. This can be fixed. I ran into the same problem yesterday working on this task #6. |
BTW, with task #6, the user does a "load" command from gdb's command prompt after connecting. Do you do the same? I can build this into the "connect" dialog. |
Issue #216 shows my start setup. |
I am fine with adding 'add-symbol-file' into 'GDB commands after connect'. But I also think that I should not have to do it as this is duplication. |
I agree. I'll debug it to see why it's happening. |
I'm curious why you use 'add-symbol-file' and not 'symbol-file'. Does it matter? |
I am not good at gdb. 'add-symbol-file' was a command I found in some how to. It works so didn't bothered looking elsewhere. |
okay. I'll try it both ways. |
A couple questions. Are you connecting to a gdbserver? Is so, can you:
From your screenshots, it looks like you are using gdb version 14.1. But to confirm:
Thanks. |
I am connecting to QEMU which runs gdbserver on TCP port 1234. My QEMU run uses 'boot-sbsa-ref.sh' script from my sbsa-ref-status repo using firmware files which are stored in repo in compressed form:
Both from Fedora 39. |
I was hoping to clone your repo and duplicate the problem. I suspect I'm missing some stuff :^)
|
So Qemu is a VM. You don't actually run gdbserver directly yourself? Qemu is running it. Correct? gdb is run directly by you via seergdb. As Qemu is a VM, I wonder how/where it is getting the gdbserver program. I'm thinking it's not from your host machine? It may be old. |
Got passed this error. I've installed qemu with arm support on my opensuse machine. |
So I watched this video. Maybe related to what you're doing. https://www.youtube.com/watch?v=YoMs0RmWAQg A couple more questions. In the version of gdb that your Seergdb is configured with, what is the output of:
The video uses So I'm thinking the Sorry for my misunderstanding here. I don't have much experience with embedded/VM debugging. |
In gdb's simplest case, debugging a program with an external symbol file is:
|
https://www.qemu.org/docs/master/system/gdb.html says that QEMU runs gdbstub. Both host and VM are aarch64 architecture. I have only one version of gdbserver on my system. QEMU starts, initialises gdbstub and waits for GDB connection. Then run SBSA_FLASH0.fd ROM. At beginning of it is TF-A component which consists of few elements named BL1, BL2, BL31. I want to debug BL31 part so load symbols for it. "hbreak read_cpuinfo_from_dt" command allows me to run system until this function (in BL31) is started. Then I land in GDB and can debug what is going on. I do not need other elf files so I am not loading them. Once I exit from 'read_cpuinfo_from_dt' function I either terminate process or let it run. In first case I usually change code, recompile/build image and restart QEMU. And reconnect Seer. |
I have a theory with this (because of gdbstubs). I'll need to make a change to the "connect" mode. The current syntax is:
It think it should be this, where you can specify the executable name too.
So your usage would be:
I'll get back to you. |
I've updated "main" with, hopefully, a fix. This should be the new syntax when starting. It allows you to specify the executable as well as the symbol file. The executable, I think, is "vmlinux" in your case? Also, you shouldn't need the "add-symbol-file" line.
Try it out at your leisure. I'm interested in the contents of the the "Gdb Log" tab. Thanks. |
Launched QEMU as above and started Seer using GDB output:
Started session using 'Continue' button and ended in read_cpuinfo_from_dt file as expected: |
And in my case there is no need to give executable as this part is handled by QEMU. I debug firmware so it is far before Linux kernel gets loaded (if at all). |
It's this line that I'm focusing on.
It suggests some command was given to gdb but gdb isn't in the right state. No program has been loaded. I suspect by the gdbstub. It looks like you got things working, albeit, with some kludges. I'll come back to this task after I learn more about your environment. |
As symbol file is now loaded this issue can be closed. Thanks for making Seer! |
I run Seer, set symbol file, connection details for gdbserver:
But symbol file is not loaded in GDB after connection:
I have to load it by issuing GDB command:
The text was updated successfully, but these errors were encountered: