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 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux.


Walfred Tedeschi wrote:
> This patch allows examination of the registers FS_BASE and GS_BASE
> for Linux Systems running on 64bit. Tests for simple read and write
> of the new registers is also added with this patch.

I tried to add this support a while back and failed, so naturally I
think this is amazing--thank you for doing it!

> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index 3f2a92b..a8a0b79 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -103,7 +103,14 @@ int amd64_linux_gregset_reg_offset[] =
>    -1, -1, -1, -1, -1, -1, -1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1,
> +  /* System register added at the end.  */
> +#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
> +  21 * 8,  22 * 8,		/* fs_base and gs_base.  */
> +#else
> +  -1, -1,			/* fs_base and gs_base.  */
> +#endif
>    15 * 8			      /* "orig_rax" */
> +
>  };
>  
>  

What is the meaning of the comment?  And why did you add the new
fields before orig_rax?  I'm not disputing what you've done, I'd
just like to understand it.

I'm not a maintainer so can't approve this, but everything looks
right about it in terms of formatting, etc.

Thanks,
Gary

-- 
http://gbenson.net/


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