GDB (API)
/home/stan/gdb/src/gdb/amd64-windows-nat.c
Go to the documentation of this file.
00001 /* Copyright (C) 2008-2013 Free Software Foundation, Inc.
00002 
00003    This file is part of GDB.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 3 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00017 
00018 #include "defs.h"
00019 #include "windows-nat.h"
00020 #include "i386-nat.h"
00021 #include "amd64-tdep.h"
00022 
00023 #include <windows.h>
00024 
00025 #define context_offset(x) (offsetof (CONTEXT, x))
00026 static const int mappings[] =
00027 {
00028   context_offset (Rax),
00029   context_offset (Rbx),
00030   context_offset (Rcx),
00031   context_offset (Rdx),
00032   context_offset (Rsi),
00033   context_offset (Rdi),
00034   context_offset (Rbp),
00035   context_offset (Rsp),
00036   context_offset (R8),
00037   context_offset (R9),
00038   context_offset (R10),
00039   context_offset (R11),
00040   context_offset (R12),
00041   context_offset (R13),
00042   context_offset (R14),
00043   context_offset (R15),
00044   context_offset (Rip),
00045   context_offset (EFlags),
00046   context_offset (SegCs),
00047   context_offset (SegSs),
00048   context_offset (SegDs),
00049   context_offset (SegEs),
00050   context_offset (SegFs),
00051   context_offset (SegGs),
00052   context_offset (FloatSave.FloatRegisters[0]),
00053   context_offset (FloatSave.FloatRegisters[1]),
00054   context_offset (FloatSave.FloatRegisters[2]),
00055   context_offset (FloatSave.FloatRegisters[3]),
00056   context_offset (FloatSave.FloatRegisters[4]),
00057   context_offset (FloatSave.FloatRegisters[5]),
00058   context_offset (FloatSave.FloatRegisters[6]),
00059   context_offset (FloatSave.FloatRegisters[7]),
00060   context_offset (FloatSave.ControlWord),
00061   context_offset (FloatSave.StatusWord),
00062   context_offset (FloatSave.TagWord),
00063   context_offset (FloatSave.ErrorSelector),
00064   context_offset (FloatSave.ErrorOffset),
00065   context_offset (FloatSave.DataSelector),
00066   context_offset (FloatSave.DataOffset),
00067   context_offset (FloatSave.ErrorSelector)
00068   /* XMM0-7 */ ,
00069   context_offset (Xmm0),
00070   context_offset (Xmm1),
00071   context_offset (Xmm2),
00072   context_offset (Xmm3),
00073   context_offset (Xmm4),
00074   context_offset (Xmm5),
00075   context_offset (Xmm6),
00076   context_offset (Xmm7),
00077   context_offset (Xmm8),
00078   context_offset (Xmm9),
00079   context_offset (Xmm10),
00080   context_offset (Xmm11),
00081   context_offset (Xmm12),
00082   context_offset (Xmm13),
00083   context_offset (Xmm14),
00084   context_offset (Xmm15),
00085   /* MXCSR */
00086   context_offset (FloatSave.MxCsr)
00087 };
00088 #undef context_offset
00089 
00090 /* segment_register_p_ftype implementation for amd64.  */
00091 
00092 static int
00093 amd64_windows_segment_register_p (int regnum)
00094 {
00095   return regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM;
00096 }
00097 
00098 /* -Wmissing-prototypes */
00099 extern initialize_file_ftype _initialize_amd64_windows_nat;
00100 
00101 void
00102 _initialize_amd64_windows_nat (void)
00103 {
00104   windows_set_context_register_offsets (mappings);
00105   windows_set_segment_register_p (amd64_windows_segment_register_p);
00106   i386_set_debug_register_length (8);
00107 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines