[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests



On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
> gdb 8.0 fixed bounds checking for 'g' packet (commit
> 9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
> registers in process_g_packet"). This revealed that gdbsx did
> not properly formatted 'g' packet - segment registers and eflags are
> expected to be 32-bit fields in the response (according to
> gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:
> 
>     Truncated register 26 in remote 'g' packet
> 
> instead of silently truncating part of register.
> 
> Additionally, it looks like segment registers of 64bit guests were never
> reported correctly, because of type mismatch.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> ---
>  tools/debugger/gdbsx/gx/gx_local.c  |  6 +++---
>  tools/debugger/gdbsx/xg/xg_main.c   | 20 ++++++++++----------
>  tools/debugger/gdbsx/xg/xg_public.h | 18 +++++++++---------
>  3 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/tools/debugger/gdbsx/gx/gx_local.c 
> b/tools/debugger/gdbsx/gx/gx_local.c
> index 1bec03d49c..33556a582d 100644
> --- a/tools/debugger/gdbsx/gx/gx_local.c
> +++ b/tools/debugger/gdbsx/gx/gx_local.c
> @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
>  static void
>  prnt_64regs(struct xg_gdb_regs64 *r64p)
>  {
> -    printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
> -           r64p->rflags);
> +    printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
> +           r64p->eflags);

I think it would be better to introduce XGF32 and XGFM32 in the header.

The rest looks good to me.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.