1 //===-- RegisterContextFreeBSD_i386.cpp ------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===---------------------------------------------------------------------===//
10 #include "RegisterContextPOSIX_x86.h"
11 #include "RegisterContextFreeBSD_i386.h"
13 using namespace lldb_private;
16 // http://svnweb.freebsd.org/base/head/sys/x86/include/reg.h
41 uint32_t dr[8]; /* debug registers */
42 /* Index 0-3: debug address registers */
43 /* Index 4-5: reserved */
44 /* Index 6: debug status */
45 /* Index 7: debug control */
49 #define DR_SIZE sizeof(uint32_t)
50 #define DR_OFFSET(reg_index) \
51 (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
53 //---------------------------------------------------------------------------
54 // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
55 //---------------------------------------------------------------------------
56 #define DECLARE_REGISTER_INFOS_I386_STRUCT
57 #include "RegisterInfos_i386.h"
58 #undef DECLARE_REGISTER_INFOS_I386_STRUCT
60 RegisterContextFreeBSD_i386::RegisterContextFreeBSD_i386(const ArchSpec &target_arch) :
61 RegisterInfoInterface(target_arch)
65 RegisterContextFreeBSD_i386::~RegisterContextFreeBSD_i386()
70 RegisterContextFreeBSD_i386::GetGPRSize()
76 RegisterContextFreeBSD_i386::GetRegisterInfo()
78 switch (m_target_arch.GetCore())
80 case ArchSpec::eCore_x86_32_i386:
81 case ArchSpec::eCore_x86_32_i486:
82 case ArchSpec::eCore_x86_32_i486sx:
83 return g_register_infos_i386;
85 assert(false && "Unhandled target architecture.");