Replies: 2 comments 13 replies
-
OK, so you're probably going to have to make a few modifications to /etc/ssh/sshd_config, using nano or your favorite editor from the WSL shell. In particular, because we're using a somewhat dated ssh library, you'll need to support older key exchange algorithms. (Yeah, we know - we're working on it, but the options in the Java ssh library space are a bit weak.) My config contains a handful of things. Not sure these are all necessary, but will copy them here for completeness: AllowUsers Am pretty sure I only modified the first four of those, but again for completeness. After modifying the config, you'll probably have to "sudo service ssh --full-restart". Ssh in once to insure the initial queries have been answered and won't require attention from Ghidra. At this point, you should be able to select "GDB over SSH" using the Targets window "New connection" icon, and specifiy: GDB launch command: /usr/bin/gdb-multiarch Assuming that works (!), you can then do the target-specific stuff in the Interpreter window. This will certainly include "target remote localhost:24689", but might also include things like "set architecture xxx". Keep in mind if your target doesn't support certain commands like "info proc mappings" and "maintenance info sections ALLOBJ", you may have to dummy out those commands in a script and run that script to get various aspects of the debugger working. Specifics are discussed in the help files and Issues/Discussions on GitHub, but, if windows other than Objects and the Interpreter are empty or the Dynamic Listing isn't tracking, this is where you need to start. Using "set debug remote 1" or "set debug serial 1" should redirect to the Interpreter ("should") and should not have an effect on the debugger behavior. That said, maybe try the basic functionality without them first to be sure. Re emulator comments in the DebuggerDevGuide, those were meant to apply to building either a front- or back-edge for pcode emulation. As you may notice, we have support for stepping forward via the emulator while debugging as exploratory execution. Our intention is to build that out moving forward, possibly to include other forms of execution. Debugging support for emulators in general is a topic we're very interested in, but, as noted in our releases notes, not our primary immediate focus. As a result (see all of the above), getting the debugger up and connected to your favorite emulator may be a bit cumbersome. Suggestions appreciated - we're definitely open to ideas at this point. And, of course, if anything I've said here is incorrect or insufficient, feel free to give us a shout. Will do our best to fill in the blanks. |
Beta Was this translation helpful? Give feedback.
-
I've definitely noticed some weirdness, especially regarding the new entries in sshd_config. For example, I've occasionally gotten it in a state where I can ssh from Ghidra but not from cmd. With luck, the move from Ganymed to JSch will resolve some of these problems. My ssh expertise is a little weak generally, but @nsadeveloper789 is working the issue and am confident he'll come up with a more stable solution. |
Beta Was this translation helpful? Give feedback.
-
This is going to be super rough as I have no idea what I am doing. I'm trying to use
GNU gdb via SSH1
and can't figure out how to establish a connection. Here is what I do know how to do.Connecting to WSL via SSH:
ssh astre@DESKTOP-3RR5B89
.(Note: That is what appears when opening the normal WSL terminal 😉)
Connecting gdb to remote target:
gdb-multiarch
target remote localhost:24689
Regarding this DebuggerDevGuide, is this specifically referring to pcode emulation or emulation in general?
I also usually enter
set debug remote 1
in the gdb interpreter prior to connecting since the remote gdb stub is still a work in progress. Is it safe to assume that these extra details won't interfere with anything?Beta Was this translation helpful? Give feedback.
All reactions