Replies: 22 comments 16 replies
-
@zwilcox Is anything visible the Dynamic Listing window? If not, from the Regions window, use the top right pull-down to “Force full memory”. If that works (i.e. you see bytes), try adding the module by hand again. |
Beta Was this translation helpful? Give feedback.
-
There's nothing in the Dynamic Listing window. I didn't see a |
Beta Was this translation helpful? Give feedback.
-
Actually, I restarted the debugger and server after adding the dynamic view. |
Beta Was this translation helpful? Give feedback.
-
Oops - apologies. Don’t have my computer in front of me. Yes re “Force Full View”. Looking at the Static Mapping view in your snapshot, it looks like the ranges are backwards. (Again, can’t access my computer at the moment, so possibly I’m confused, but….) |
Beta Was this translation helpful? Give feedback.
-
In other words, an assuming your program (in Listing) has a base address of 0x400000. I haven’t done this in a while, so possibly a remembering the wrong order. |
Beta Was this translation helpful? Give feedback.
-
I'm also getting this exception in the GDB terminal. Not sure if it's related:
|
Beta Was this translation helpful? Give feedback.
-
OK, but am pretty sure you want that entered in the Static Range |
Beta Was this translation helpful? Give feedback.
-
The error is telling you you’re trying to read memory at address 0x0, which is presumably invalid |
Beta Was this translation helpful? Give feedback.
-
So I've tried the other way around too. Still doesn't allow me to save. No error message. |
Beta Was this translation helpful? Give feedback.
-
Here's the proc mappings:
|
Beta Was this translation helpful? Give feedback.
-
If you enter 0x400000 for both, does it accept it? Or easier, if you hit the button in Modules for map the current program identically (i.e. at the same address range), does that create the mapping? |
Beta Was this translation helpful? Give feedback.
-
Following up, I think the root of the problem here is a mismatch between the output returned by your target for “info proc mappings” and “maintenance info sections —all-objects”, assuming these work at all, and the pattern templates in Ghidra/Debug/Debugger-agent-gdb/src/main/py/ghidragdb/util.py. It’s a pretty easy fix to change these as a one-off for your target. Does the mapping list above correspond to “info proc mappings”? And does the “maintenance” command work? |
Beta Was this translation helpful? Give feedback.
-
When I run
The listing above was done by reading
|
Beta Was this translation helpful? Give feedback.
-
OK, that's interesting. Normally, I assume gdbstub authors may or may not choose to support various commands, but in your case it looks like both are supported, sort of. In the first case, it looks like the gdbserver is not running with sufficient privilege to access /proc. Could be a lot of reasons for that, but in some sense "Force Full View" sidesteps that issue. You may want to play around with the "maintenance info sections" command. If there is some variant/option that actually lists the section info, you could replace the invocation in "util.py" and get the Module list for free. That said, creating the mappings by hand should work. I am putting in a ticket to look at the "Add Static Mapping" dialog. I've always found it a little flaky / unintuitive, and at a minimum it should display an error when you enter invalid memory ranges. Have you gotten either method of making the identity mapping to work? |
Beta Was this translation helpful? Give feedback.
-
It had to do with how I had my emulation environment setup. I've created a hacky work around and now
Thank you
No. Unfortunately. I just ended up using GDB and IDA. I'd much rather use Ghidra though |
Beta Was this translation helpful? Give feedback.
-
Hmmm, what happens when you click the red double-arrow button in Modules? |
Beta Was this translation helpful? Give feedback.
-
OK, some I'm clearly not understanding something and probably need to discuss with @nsadeveloper789. I thought "Force Full View" would create the necessary memory block, but I may be wrong about that. Really the only way "Map the current trace..." could fail is for there to be no memory, I think. One other thing to try if you're game: in the Regions view, use "Add Region" to create a region from 0-7FFFFFFFFFFF (or any number that covers the /proc space), verify something shows up in Regions, and then try the "Map the current trace..." exercise. |
Beta Was this translation helpful? Give feedback.
-
There's also a gdb scipt in Ghidra/Debug/Debugger-agent-gdb/data/scripts called fallback_info_proc_mappings.gdb that implements a dummy version of "info proc mappings". Running that will also add default mappings, much like "Add Region". |
Beta Was this translation helpful? Give feedback.
-
Would it be easier for me to zip up my qemu environment and give you steps on how to reproduce so we don't have to have these back and forths?? |
Beta Was this translation helpful? Give feedback.
-
OK, on the (slightly) good new front, I can exactly reproduce your results. On the less good front, I haven't yet figured out what's going on. A couple of notes in the meantime: (1) Am putting "mips:5000" in for "Architecture" in the launch dialog. If I don't do this, the Registers view has only two skeleton values because we didn't anticipate "show architecture" returning only "mips". Adding a ticket for this. My current guess is that the timeout for the connection needs to be increased for this target, i.e. responses may be getting randomly dropped on the floor. More as I know more.... |
Beta Was this translation helpful? Give feedback.
-
I have an x86 binary that has the same (or at least similar) problem with it without gdb server. Admittedly there is some anti-debugging stuff going on in the binary. However, I would expect Ghidra to be able to attach to it before hitting that part of the code. I can step through it in normal gdb. Would you like this binary as well? |
Beta Was this translation helpful? Give feedback.
-
Okay. I have a theory. I think, oddly enough, it may be related to the
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm connecting to gdb server with Ghidra 11.4.
I'm able to connect. However, when I try to enable a break point i get the following error:
The module tab is empty.


I've tried to manually add them. However, clicking apply doesn't save. There's no way for me to save it :(
Beta Was this translation helpful? Give feedback.
All reactions