This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdbserver does not work correctly
- From: Doug Evans <xdje42 at gmail dot com>
- To: fei ding <fdingiit at gmail dot com>
- Cc: gdb <gdb at sourceware dot org>
- Date: Sat, 7 Feb 2015 21:33:52 -0800
- Subject: Re: gdbserver does not work correctly
- Authentication-results: sourceware.org; auth=none
- References: <CAGmPkf+WEZYE=EHLuEVrXgoUokw9-M+zWzqc-A53GCzFPtejtQ at mail dot gmail dot com>
On Wed, Jan 21, 2015 at 5:40 PM, fei ding <fdingiit@gmail.com> wrote:
> Hi everyone:
>
> I have a program, which uses LJMP instruction to switch from i386 to
> amd64 (both in Linux), and GDB does not support this architecture
> switch, but we have fixed this problem, and everything goes well, the
> registers' values are correct and 'disas' command also works well
> after 'set architecture i386:x86_64', but when we compile a gdbserver,
> and use it to debug a remote target(and this target is just the same
> as the program we test early, which we used as a local target), it
> cannot work well. Almost every registers' values are wrong, and all
> the new registers, such as R8-R15, are assigned as 0, RIP is 0 also.
> does anyone familiar with this problem? or does anyone know which
> piece of source code I should see.
The remote protocol doesn't AFAICT support changing the architecture
in a live program.
If you want to try to make this work you'll need to extend the protocol somehow.
The main file on the gdb side is remote.c.