This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3] Add support for recording xsave x86 instruction


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]