-
Notifications
You must be signed in to change notification settings - Fork 85
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
GDB Docs #510
Comments
@xobs I can confirm that the GDB default port on my machine is For the binary to use, any RV GDB should work (I haven't rigorously checked but I also have been pretty will-nilly about which host/arch combo I use and it's never been a problem). That being said, we're trying to harmonize around the xpack target triple so I think for (3): I see two possible problems that I'll clarify in the docs now.
|
i pushed up some changes to the GDB chapter that should address the major issues brought up here. sorry you had to step on the |
There are basically two ways to debug something under Renode:
The port for the Renode GDB server is 3333, which is the port you should use if you're debugging the kernel. I believe there are some commands that are missing from the Renode script in order to support debugging using the Xous gdbserver:
With that, you can use the same application-aware gdbserver that is present on hardware by connecting to port 3456. |
huh. which script is that? can you add a PR to put those missing lines into the main repo? |
Also, I'm confused, since I've only ever used GDB on hardware. Are you saying that what I get on port Or is it the case that on hardware, you can't get application aware gdbserver? Or that on hardware, you never get the port |
(This is the first time I've even been aware there was a difference and multiple ports possibly available on GDB, so clearly I'm missing something really important about how this is all configured...) |
I don't think hardware exposes a network port, unless you're talking about the gdb server presented by The GDB server mentioned above on port 3456 is what you get when you attach The snippet above comes from a line that I've made a PR for: #513 |
Ah I see, so the difference is that in hardware, we have ... 3 actual UARTs, which are muxed. But in Renode you have...well, I guess you do have as many UARTs as you want. But you still have to tell GDB which one to use. Why not use the It's a rhetorical question, I am just trying to understand the differences because I have to grok it if I'm to correctly guide other people on how to use this feature. |
|
That's a great explanation. I've added that to the Xous Book chapter: https://betrusted.io/xous-book/ch03-04-debugging-programs.html |
It should be noted that |
When attempting to use gdb to debug why a process crashed with renode, I attempted to follow the docs: https://betrusted.io/xous-book/ch03-04-debugging-programs.html, but ran into some issues.
The docs reference port
:3456
, but doesn't seem to exist. GDB seems to be started in renode on :3333 on the SoC here.The book recommends to use
riscv-none-elf-gdb
. It is unclear which binary that is. Is it from here? I tried just usingriscv64-unknown-elf-gdb
from here and usingset architecture riscv:rv32
. It seems to work, but could be causing the issues I see below?I changed opt-level to
1
and debug totrue
in the profile in the main Cargo.toml, rancargo xtask renode-image --gdb-stub
, ranrenode emulation/xous-release.resc
, and connected usingriscv64-unknown-elf-gdb -ex 'tar ext :3333'
. Loading symbols for the kernel withfile target/riscv32imac-unknown-none-elf/release/xous-kernel
seems to work, but loading symbols for any process, e.g.file target/riscv32imac-unknown-xous-elf/release/shellchat
, does not. I can enable breakpoints in the kernel, but breakpoints seem to be ignored in processes. Furthermore,mon pr
does not work sayingNo such command or device: pr
.I did all of this on
main
without my changes to any process to see if I had messed something up. When running on my branch, root-keys crashes, and I would like to connect over gdb to see why, but could not. Does it appear that I am doing anything incorrect?The text was updated successfully, but these errors were encountered: