This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] Add support for recording xsave x86 instruction
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: pierre dot marsais at lse dot epita dot fr
- Cc: GDB <gdb-patches at sourceware dot org>
- Date: Tue, 2 Oct 2018 18:10:54 -0700
- Subject: Re: [PATCH v3] Add support for recording xsave x86 instruction
- References: <20180921003827.1525-1-pierre.marsais@lse.epita.fr> <20181002235548.16030-1-pierre.marsais@lse.epita.fr>
On Tue, Oct 2, 2018 at 4:56 PM Pierre Marsais
<pierre.marsais@lse.epita.fr> wrote:
>
> Latest version of glibc's ld.so use the xsave instruction in the
> resolver. This breaks gdb record when calling shared libraries:
>
> ```
> $ gcc -o fail -ggdb -x c - <<EOF
> #include <stdlib.h>
>
> int main() {
> exit(0);
> }
> EOF
> $ gdb ./fail
> Reading symbols from ./fail...done.
> (gdb) b main
> Breakpoint 1 at 0x113d: file <stdin>, line 4.
> (gdb) r
> Starting program: /tmp/fail
>
> Breakpoint 1, main () at <stdin>:4
> 4 <stdin>: No such file or directory.
> (gdb) record
> (gdb) c
> Continuing.
> Process record does not support instruction 0xfae64 at address
> 0x7ffff7fe96dc.
> ```
>
> In order to record xsave instructions, we record the from the beginning
> of the XSAVE area to the end of the last state component in the Request
> Feature Bitmap (whose value is XCR0 & EDX:EAX). At the moment we don't
> account for non requested state component within the XSAVE area.
>
> gdb/ChangeLog:
> 2018-09-21 Pierre Marsais <pierre.marsais@lse.epita.fr>
>
> * i386-tdep.c: (i386_process_record): Handle xsave instruction.
>
Don't you also need to handle xsavec since ld.so uses if it is usable?
H.J.