diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-05-04 18:36:28 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-05-04 18:36:28 +0000 |
commit | be99a4846257d665e0a0db366a4aa0068f3a4568 (patch) | |
tree | f33b2b1d35b7d7833ae40e13ca574f1b618b913a /gdb/amd64-windows-nat.c | |
parent | 0599b1780d127fff8f7c29af624921b987b4d7b4 (diff) | |
download | gdb-be99a4846257d665e0a0db366a4aa0068f3a4568.tar.gz |
Segment register reading on Windows targets.
This patch makes sure that the value of segment registers are
read properly as 16bit values on Windows.
gdb/ChangeLog:
* windows-nat.h (segment_register_p_ftype): New typedef.
(windows_set_segment_register_p): Add declaration.
* windows-nat.c (segment_register_p): New static global.
(windows_set_segment_register_p): New function.
(do_windows_fetch_inferior_registers): Add special handling
for segment registers.
* amd64-windows-nat.c: #include "amd64-tdep.h".
(amd64_windows_segment_register_p): New function.
(_initialize_amd64_windows_nat): Call windows_set_segment_register_p.
* i386-windows-nat.c: #include "i386-tdep.h".
(i386_windows_segment_register_p): New function.
(_initialize_i386_windows_nat): Call windows_set_segment_register_p.
Diffstat (limited to 'gdb/amd64-windows-nat.c')
-rw-r--r-- | gdb/amd64-windows-nat.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/amd64-windows-nat.c b/gdb/amd64-windows-nat.c index bc2c0475ebc..e5fb0e00318 100644 --- a/gdb/amd64-windows-nat.c +++ b/gdb/amd64-windows-nat.c @@ -18,6 +18,8 @@ #include "defs.h" #include "windows-nat.h" #include "i386-nat.h" +#include "amd64-tdep.h" + #include <windows.h> #define context_offset(x) (offsetof (CONTEXT, x)) @@ -85,6 +87,14 @@ static const int mappings[] = }; #undef context_offset +/* segment_register_p_ftype implementation for amd64. */ + +static int +amd64_windows_segment_register_p (int regnum) +{ + return regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM; +} + /* -Wmissing-prototypes */ extern initialize_file_ftype _initialize_amd64_windows_nat; @@ -92,5 +102,6 @@ void _initialize_amd64_windows_nat (void) { windows_set_context_register_offsets (mappings); + windows_set_segment_register_p (amd64_windows_segment_register_p); i386_set_debug_register_length (8); } |