[Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

Kamil Rytarowski via lldb-commits lldb-commits at lists.llvm.org
Sun Jan 24 17:51:57 PST 2016


krytarowski added a comment.

It looks like UserArea will need to map this structure:

  typedef struct {
          __gregset_t     __gregs;
          __greg_t        _mc_tlsbase;
          __fpregset_t    __fpregs;
  } mcontext_t;

- src/sys/arch/amd64/include/mcontext.h

https://github.com/IIJ-NetBSD/netbsd-src/blob/master/sys/arch/amd64/include/mcontext.h#L61

I'm thinking if I need to customize FPR as well:

  /*
   * Floating point register state
   * The format of __fpregset_t is that of the fxsave instruction
   * which requires 16 byte alignment. However the mcontext version
   * is never directly accessed.
   */
  typedef char __fpregset_t[512] __aligned(8);

https://github.com/IIJ-NetBSD/netbsd-src/blob/master/sys/arch/amd64/include/mcontext.h#L53

Joerg Sonnenberg (I forgot @login) wrote:

> I think you want to keep at least the mc_tlsbase field as well.

>  Access to __thread variables will need it.


This will be handled by new UserArea.

I will research if I can skip the definition of `struct DBG`, as currently there is no support for debug registers on NetBSD.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508





More information about the lldb-commits mailing list