1 //===-- RegisterContextKDP_arm.cpp ------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "RegisterContextKDP_arm.h"
11 
12 // C Includes
13 // C++ Includes
14 // Other libraries and framework includes
15 // Project includes
16 #include "ProcessKDP.h"
17 #include "ThreadKDP.h"
18 
19 using namespace lldb;
20 using namespace lldb_private;
21 
22 
23 RegisterContextKDP_arm::RegisterContextKDP_arm (ThreadKDP &thread, uint32_t concrete_frame_idx) :
24     RegisterContextDarwin_arm (thread, concrete_frame_idx),
25     m_kdp_thread (thread)
26 {
27 }
28 
29 RegisterContextKDP_arm::~RegisterContextKDP_arm()
30 {
31 }
32 
33 int
34 RegisterContextKDP_arm::DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
35 {
36     Error error;
37     if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, GPRRegSet, &gpr, sizeof(gpr), error))
38     {
39         if (error.Success())
40             return 0;
41     }
42     return -1;
43 }
44 
45 int
46 RegisterContextKDP_arm::DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
47 {
48     Error error;
49     if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, FPURegSet, &fpu, sizeof(fpu), error))
50     {
51         if (error.Success())
52             return 0;
53     }
54     return -1;
55 }
56 
57 int
58 RegisterContextKDP_arm::DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
59 {
60     Error error;
61     if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, EXCRegSet, &exc, sizeof(exc), error))
62     {
63         if (error.Success())
64             return 0;
65     }
66     return -1;
67 }
68 
69 int
70 RegisterContextKDP_arm::DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg)
71 {
72     Error error;
73     if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, DBGRegSet, &dbg, sizeof(dbg), error))
74     {
75         if (error.Success())
76             return 0;
77     }
78     return -1;
79 }
80 
81 int
82 RegisterContextKDP_arm::DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
83 {
84     return -1;
85 }
86 
87 int
88 RegisterContextKDP_arm::DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
89 {
90     return -1;
91 }
92 
93 int
94 RegisterContextKDP_arm::DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
95 {
96     return -1;
97 }
98 
99 int
100 RegisterContextKDP_arm::DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg)
101 {
102     return -1;
103 }
104 
105 
106