1 //===-- GDBRemoteRegisterContext.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 "GDBRemoteRegisterContext.h"
11 
12 // C Includes
13 // C++ Includes
14 // Other libraries and framework includes
15 #include "lldb/Core/DataBufferHeap.h"
16 #include "lldb/Core/DataExtractor.h"
17 #include "lldb/Core/RegisterValue.h"
18 #include "lldb/Core/Scalar.h"
19 #include "lldb/Core/StreamString.h"
20 #include "lldb/Target/ExecutionContext.h"
21 // Project includes
22 #include "Utility/StringExtractorGDBRemote.h"
23 #include "ProcessGDBRemote.h"
24 #include "ThreadGDBRemote.h"
25 #include "Utility/ARM_GCC_Registers.h"
26 #include "Utility/ARM_DWARF_Registers.h"
27 
28 using namespace lldb;
29 using namespace lldb_private;
30 
31 //----------------------------------------------------------------------
32 // GDBRemoteRegisterContext constructor
33 //----------------------------------------------------------------------
34 GDBRemoteRegisterContext::GDBRemoteRegisterContext
35 (
36     ThreadGDBRemote &thread,
37     uint32_t concrete_frame_idx,
38     GDBRemoteDynamicRegisterInfo &reg_info,
39     bool read_all_at_once
40 ) :
41     RegisterContext (thread, concrete_frame_idx),
42     m_reg_info (reg_info),
43     m_reg_valid (),
44     m_reg_data (),
45     m_read_all_at_once (read_all_at_once)
46 {
47     // Resize our vector of bools to contain one bool for every register.
48     // We will use these boolean values to know when a register value
49     // is valid in m_reg_data.
50     m_reg_valid.resize (reg_info.GetNumRegisters());
51 
52     // Make a heap based buffer that is big enough to store all registers
53     DataBufferSP reg_data_sp(new DataBufferHeap (reg_info.GetRegisterDataByteSize(), 0));
54     m_reg_data.SetData (reg_data_sp);
55 
56 }
57 
58 //----------------------------------------------------------------------
59 // Destructor
60 //----------------------------------------------------------------------
61 GDBRemoteRegisterContext::~GDBRemoteRegisterContext()
62 {
63 }
64 
65 void
66 GDBRemoteRegisterContext::InvalidateAllRegisters ()
67 {
68     SetAllRegisterValid (false);
69 }
70 
71 void
72 GDBRemoteRegisterContext::SetAllRegisterValid (bool b)
73 {
74     std::vector<bool>::iterator pos, end = m_reg_valid.end();
75     for (pos = m_reg_valid.begin(); pos != end; ++pos)
76         *pos = b;
77 }
78 
79 size_t
80 GDBRemoteRegisterContext::GetRegisterCount ()
81 {
82     return m_reg_info.GetNumRegisters ();
83 }
84 
85 const RegisterInfo *
86 GDBRemoteRegisterContext::GetRegisterInfoAtIndex (uint32_t reg)
87 {
88     return m_reg_info.GetRegisterInfoAtIndex (reg);
89 }
90 
91 size_t
92 GDBRemoteRegisterContext::GetRegisterSetCount ()
93 {
94     return m_reg_info.GetNumRegisterSets ();
95 }
96 
97 
98 
99 const RegisterSet *
100 GDBRemoteRegisterContext::GetRegisterSet (uint32_t reg_set)
101 {
102     return m_reg_info.GetRegisterSet (reg_set);
103 }
104 
105 
106 
107 bool
108 GDBRemoteRegisterContext::ReadRegister (const RegisterInfo *reg_info, RegisterValue &value)
109 {
110     // Read the register
111     if (ReadRegisterBytes (reg_info, m_reg_data))
112     {
113         const bool partial_data_ok = false;
114         Error error (value.SetValueFromData(reg_info, m_reg_data, reg_info->byte_offset, partial_data_ok));
115         return error.Success();
116     }
117     return false;
118 }
119 
120 bool
121 GDBRemoteRegisterContext::PrivateSetRegisterValue (uint32_t reg, StringExtractor &response)
122 {
123     const RegisterInfo *reg_info = GetRegisterInfoAtIndex (reg);
124     if (reg_info == NULL)
125         return false;
126 
127     // Invalidate if needed
128     InvalidateIfNeeded(false);
129 
130     const uint32_t reg_byte_size = reg_info->byte_size;
131     const size_t bytes_copied = response.GetHexBytes (const_cast<uint8_t*>(m_reg_data.PeekData(reg_info->byte_offset, reg_byte_size)), reg_byte_size, '\xcc');
132     bool success = bytes_copied == reg_byte_size;
133     if (success)
134     {
135         m_reg_valid[reg] = true;
136     }
137     else if (bytes_copied > 0)
138     {
139         // Only set register is valid to false if we copied some bytes, else
140         // leave it as it was.
141         m_reg_valid[reg] = false;
142     }
143     return success;
144 }
145 
146 
147 bool
148 GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataExtractor &data)
149 {
150     ExecutionContext exe_ctx (CalculateThread());
151 
152     Process *process = exe_ctx.GetProcessPtr();
153     Thread *thread = exe_ctx.GetThreadPtr();
154     if (process == NULL || thread == NULL)
155         return false;
156 
157     GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *)process)->GetGDBRemote());
158 
159     InvalidateIfNeeded(false);
160 
161     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
162 
163     if (!m_reg_valid[reg])
164     {
165         Mutex::Locker locker;
166         if (gdb_comm.GetSequenceMutex (locker))
167         {
168             const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
169             ProcessSP process_sp (m_thread.GetProcess());
170             if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
171             {
172                 char packet[64];
173                 StringExtractorGDBRemote response;
174                 int packet_len = 0;
175                 if (m_read_all_at_once)
176                 {
177                     // Get all registers in one packet
178                     if (thread_suffix_supported)
179                         packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx;", m_thread.GetID());
180                     else
181                         packet_len = ::snprintf (packet, sizeof(packet), "g");
182                     assert (packet_len < (sizeof(packet) - 1));
183                     if (gdb_comm.SendPacketAndWaitForResponse(packet, response, false))
184                     {
185                         if (response.IsNormalResponse())
186                             if (response.GetHexBytes ((void *)m_reg_data.GetDataStart(), m_reg_data.GetByteSize(), '\xcc') == m_reg_data.GetByteSize())
187                                 SetAllRegisterValid (true);
188                     }
189                 }
190                 else
191                 {
192                     // Get each register individually
193 
194                     if (thread_suffix_supported)
195                         packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4llx;", reg, m_thread.GetID());
196                     else
197                         packet_len = ::snprintf (packet, sizeof(packet), "p%x", reg);
198                     assert (packet_len < (sizeof(packet) - 1));
199                     if (gdb_comm.SendPacketAndWaitForResponse(packet, response, false))
200                         PrivateSetRegisterValue (reg, response);
201                 }
202             }
203         }
204 
205         // Make sure we got a valid register value after reading it
206         if (!m_reg_valid[reg])
207             return false;
208     }
209 
210     if (&data != &m_reg_data)
211     {
212         // If we aren't extracting into our own buffer (which
213         // only happens when this function is called from
214         // ReadRegisterValue(uint32_t, Scalar&)) then
215         // we transfer bytes from our buffer into the data
216         // buffer that was passed in
217         data.SetByteOrder (m_reg_data.GetByteOrder());
218         data.SetData (m_reg_data, reg_info->byte_offset, reg_info->byte_size);
219     }
220     return true;
221 }
222 
223 
224 bool
225 GDBRemoteRegisterContext::WriteRegister (const RegisterInfo *reg_info,
226                                          const RegisterValue &value)
227 {
228     DataExtractor data;
229     if (value.GetData (data))
230         return WriteRegisterBytes (reg_info, data, 0);
231     return false;
232 }
233 
234 
235 bool
236 GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset)
237 {
238     ExecutionContext exe_ctx (CalculateThread());
239 
240     Process *process = exe_ctx.GetProcessPtr();
241     Thread *thread = exe_ctx.GetThreadPtr();
242     if (process == NULL || thread == NULL)
243         return false;
244 
245     GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *)process)->GetGDBRemote());
246 // FIXME: This check isn't right because IsRunning checks the Public state, but this
247 // is work you need to do - for instance in ShouldStop & friends - before the public
248 // state has been changed.
249 //    if (gdb_comm.IsRunning())
250 //        return false;
251 
252     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
253 
254     // Grab a pointer to where we are going to put this register
255     uint8_t *dst = const_cast<uint8_t*>(m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size));
256 
257     if (dst == NULL)
258         return false;
259 
260 
261     if (data.CopyByteOrderedData (data_offset,                  // src offset
262                                   reg_info->byte_size,          // src length
263                                   dst,                          // dst
264                                   reg_info->byte_size,          // dst length
265                                   m_reg_data.GetByteOrder()))   // dst byte order
266     {
267         Mutex::Locker locker;
268         if (gdb_comm.GetSequenceMutex (locker))
269         {
270             const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
271             ProcessSP process_sp (m_thread.GetProcess());
272             if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
273             {
274                 uint32_t offset, end_offset;
275                 StreamString packet;
276                 StringExtractorGDBRemote response;
277                 if (m_read_all_at_once)
278                 {
279                     // Get all registers in one packet
280                     packet.PutChar ('G');
281                     offset = 0;
282                     end_offset = m_reg_data.GetByteSize();
283 
284                     packet.PutBytesAsRawHex8 (m_reg_data.GetDataStart(),
285                                               m_reg_data.GetByteSize(),
286                                               lldb::endian::InlHostByteOrder(),
287                                               lldb::endian::InlHostByteOrder());
288 
289                     if (thread_suffix_supported)
290                         packet.Printf (";thread:%4.4llx;", m_thread.GetID());
291 
292                     // Invalidate all register values
293                     InvalidateIfNeeded (true);
294 
295                     if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
296                                                               packet.GetString().size(),
297                                                               response,
298                                                               false))
299                     {
300                         SetAllRegisterValid (false);
301                         if (response.IsOKResponse())
302                         {
303                             return true;
304                         }
305                     }
306                 }
307                 else
308                 {
309                     // Get each register individually
310                     packet.Printf ("P%x=", reg);
311                     packet.PutBytesAsRawHex8 (m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size),
312                                               reg_info->byte_size,
313                                               lldb::endian::InlHostByteOrder(),
314                                               lldb::endian::InlHostByteOrder());
315 
316                     if (thread_suffix_supported)
317                         packet.Printf (";thread:%4.4llx;", m_thread.GetID());
318 
319                     // Invalidate just this register
320                     m_reg_valid[reg] = false;
321                     if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
322                                                               packet.GetString().size(),
323                                                               response,
324                                                               false))
325                     {
326                         if (response.IsOKResponse())
327                         {
328                             return true;
329                         }
330                     }
331                 }
332             }
333         }
334     }
335     return false;
336 }
337 
338 
339 bool
340 GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
341 {
342     ExecutionContext exe_ctx (CalculateThread());
343 
344     Process *process = exe_ctx.GetProcessPtr();
345     Thread *thread = exe_ctx.GetThreadPtr();
346     if (process == NULL || thread == NULL)
347         return false;
348 
349     GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *)process)->GetGDBRemote());
350 
351     StringExtractorGDBRemote response;
352 
353     Mutex::Locker locker;
354     if (gdb_comm.GetSequenceMutex (locker))
355     {
356         char packet[32];
357         const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
358         ProcessSP process_sp (m_thread.GetProcess());
359         if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
360         {
361             int packet_len = 0;
362             if (thread_suffix_supported)
363                 packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx", m_thread.GetID());
364             else
365                 packet_len = ::snprintf (packet, sizeof(packet), "g");
366             assert (packet_len < (sizeof(packet) - 1));
367 
368             if (gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, false))
369             {
370                 if (response.IsErrorResponse())
371                     return false;
372 
373                 std::string &response_str = response.GetStringRef();
374                 if (isxdigit(response_str[0]))
375                 {
376                     response_str.insert(0, 1, 'G');
377                     if (thread_suffix_supported)
378                     {
379                         char thread_id_cstr[64];
380                         ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4llx;", m_thread.GetID());
381                         response_str.append (thread_id_cstr);
382                     }
383                     data_sp.reset (new DataBufferHeap (response_str.c_str(), response_str.size()));
384                     return true;
385                 }
386             }
387         }
388     }
389     data_sp.reset();
390     return false;
391 }
392 
393 bool
394 GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)
395 {
396     if (!data_sp || data_sp->GetBytes() == NULL || data_sp->GetByteSize() == 0)
397         return false;
398 
399     ExecutionContext exe_ctx (CalculateThread());
400 
401     Process *process = exe_ctx.GetProcessPtr();
402     Thread *thread = exe_ctx.GetThreadPtr();
403     if (process == NULL || thread == NULL)
404         return false;
405 
406     GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *)process)->GetGDBRemote());
407 
408     StringExtractorGDBRemote response;
409     Mutex::Locker locker;
410     if (gdb_comm.GetSequenceMutex (locker))
411     {
412         const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
413         ProcessSP process_sp (m_thread.GetProcess());
414         if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
415         {
416             // The data_sp contains the entire G response packet including the
417             // G, and if the thread suffix is supported, it has the thread suffix
418             // as well.
419             const char *G_packet = (const char *)data_sp->GetBytes();
420             size_t G_packet_len = data_sp->GetByteSize();
421             if (gdb_comm.SendPacketAndWaitForResponse (G_packet,
422                                                        G_packet_len,
423                                                        response,
424                                                        false))
425             {
426                 if (response.IsOKResponse())
427                     return true;
428                 else if (response.IsErrorResponse())
429                 {
430                     uint32_t num_restored = 0;
431                     // We need to manually go through all of the registers and
432                     // restore them manually
433 
434                     response.GetStringRef().assign (G_packet, G_packet_len);
435                     response.SetFilePos(1); // Skip the leading 'G'
436                     DataBufferHeap buffer (m_reg_data.GetByteSize(), 0);
437                     DataExtractor restore_data (buffer.GetBytes(),
438                                                 buffer.GetByteSize(),
439                                                 m_reg_data.GetByteOrder(),
440                                                 m_reg_data.GetAddressByteSize());
441 
442                     const uint32_t bytes_extracted = response.GetHexBytes ((void *)restore_data.GetDataStart(),
443                                                                            restore_data.GetByteSize(),
444                                                                            '\xcc');
445 
446                     if (bytes_extracted < restore_data.GetByteSize())
447                         restore_data.SetData(restore_data.GetDataStart(), bytes_extracted, m_reg_data.GetByteOrder());
448 
449                     //ReadRegisterBytes (const RegisterInfo *reg_info, RegisterValue &value, DataExtractor &data)
450                     const RegisterInfo *reg_info;
451                     // We have to march the offset of each register along in the
452                     // buffer to make sure we get the right offset.
453                     uint32_t reg_byte_offset = 0;
454                     for (uint32_t reg_idx=0; (reg_info = GetRegisterInfoAtIndex (reg_idx)) != NULL; ++reg_idx, reg_byte_offset += reg_info->byte_size)
455                     {
456                         const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
457 
458                         // Only write down the registers that need to be written
459                         // if we are going to be doing registers individually.
460                         bool write_reg = true;
461                         const uint32_t reg_byte_size = reg_info->byte_size;
462 
463                         const char *restore_src = (const char *)restore_data.PeekData(reg_byte_offset, reg_byte_size);
464                         if (restore_src)
465                         {
466                             if (m_reg_valid[reg])
467                             {
468                                 const char *current_src = (const char *)m_reg_data.PeekData(reg_byte_offset, reg_byte_size);
469                                 if (current_src)
470                                     write_reg = memcmp (current_src, restore_src, reg_byte_size) != 0;
471                             }
472 
473                             if (write_reg)
474                             {
475                                 StreamString packet;
476                                 packet.Printf ("P%x=", reg);
477                                 packet.PutBytesAsRawHex8 (restore_src,
478                                                           reg_byte_size,
479                                                           lldb::endian::InlHostByteOrder(),
480                                                           lldb::endian::InlHostByteOrder());
481 
482                                 if (thread_suffix_supported)
483                                     packet.Printf (";thread:%4.4llx;", m_thread.GetID());
484 
485                                 m_reg_valid[reg] = false;
486                                 if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
487                                                                           packet.GetString().size(),
488                                                                           response,
489                                                                           false))
490                                 {
491                                     if (response.IsOKResponse())
492                                         ++num_restored;
493                                 }
494                             }
495                         }
496                     }
497                     return num_restored > 0;
498                 }
499             }
500         }
501     }
502     return false;
503 }
504 
505 
506 uint32_t
507 GDBRemoteRegisterContext::ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num)
508 {
509     return m_reg_info.ConvertRegisterKindToRegisterNumber (kind, num);
510 }
511 
512 void
513 GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters()
514 {
515     // For Advanced SIMD and VFP register mapping.
516     static uint32_t g_d0_regs[] =  { 26, 27, LLDB_INVALID_REGNUM }; // (s0, s1)
517     static uint32_t g_d1_regs[] =  { 28, 29, LLDB_INVALID_REGNUM }; // (s2, s3)
518     static uint32_t g_d2_regs[] =  { 30, 31, LLDB_INVALID_REGNUM }; // (s4, s5)
519     static uint32_t g_d3_regs[] =  { 32, 33, LLDB_INVALID_REGNUM }; // (s6, s7)
520     static uint32_t g_d4_regs[] =  { 34, 35, LLDB_INVALID_REGNUM }; // (s8, s9)
521     static uint32_t g_d5_regs[] =  { 36, 37, LLDB_INVALID_REGNUM }; // (s10, s11)
522     static uint32_t g_d6_regs[] =  { 38, 39, LLDB_INVALID_REGNUM }; // (s12, s13)
523     static uint32_t g_d7_regs[] =  { 40, 41, LLDB_INVALID_REGNUM }; // (s14, s15)
524     static uint32_t g_d8_regs[] =  { 42, 43, LLDB_INVALID_REGNUM }; // (s16, s17)
525     static uint32_t g_d9_regs[] =  { 44, 45, LLDB_INVALID_REGNUM }; // (s18, s19)
526     static uint32_t g_d10_regs[] = { 46, 47, LLDB_INVALID_REGNUM }; // (s20, s21)
527     static uint32_t g_d11_regs[] = { 48, 49, LLDB_INVALID_REGNUM }; // (s22, s23)
528     static uint32_t g_d12_regs[] = { 50, 51, LLDB_INVALID_REGNUM }; // (s24, s25)
529     static uint32_t g_d13_regs[] = { 52, 53, LLDB_INVALID_REGNUM }; // (s26, s27)
530     static uint32_t g_d14_regs[] = { 54, 55, LLDB_INVALID_REGNUM }; // (s28, s29)
531     static uint32_t g_d15_regs[] = { 56, 57, LLDB_INVALID_REGNUM }; // (s30, s31)
532     static uint32_t g_q0_regs[] =  { 26, 27, 28, 29, LLDB_INVALID_REGNUM }; // (d0, d1) -> (s0, s1, s2, s3)
533     static uint32_t g_q1_regs[] =  { 30, 31, 32, 33, LLDB_INVALID_REGNUM }; // (d2, d3) -> (s4, s5, s6, s7)
534     static uint32_t g_q2_regs[] =  { 34, 35, 36, 37, LLDB_INVALID_REGNUM }; // (d4, d5) -> (s8, s9, s10, s11)
535     static uint32_t g_q3_regs[] =  { 38, 39, 40, 41, LLDB_INVALID_REGNUM }; // (d6, d7) -> (s12, s13, s14, s15)
536     static uint32_t g_q4_regs[] =  { 42, 43, 44, 45, LLDB_INVALID_REGNUM }; // (d8, d9) -> (s16, s17, s18, s19)
537     static uint32_t g_q5_regs[] =  { 46, 47, 48, 49, LLDB_INVALID_REGNUM }; // (d10, d11) -> (s20, s21, s22, s23)
538     static uint32_t g_q6_regs[] =  { 50, 51, 52, 53, LLDB_INVALID_REGNUM }; // (d12, d13) -> (s24, s25, s26, s27)
539     static uint32_t g_q7_regs[] =  { 54, 55, 56, 57, LLDB_INVALID_REGNUM }; // (d14, d15) -> (s28, s29, s30, s31)
540     static uint32_t g_q8_regs[] =  { 59, 60, LLDB_INVALID_REGNUM }; // (d16, d17)
541     static uint32_t g_q9_regs[] =  { 61, 62, LLDB_INVALID_REGNUM }; // (d18, d19)
542     static uint32_t g_q10_regs[] = { 63, 64, LLDB_INVALID_REGNUM }; // (d20, d21)
543     static uint32_t g_q11_regs[] = { 65, 66, LLDB_INVALID_REGNUM }; // (d22, d23)
544     static uint32_t g_q12_regs[] = { 67, 68, LLDB_INVALID_REGNUM }; // (d24, d25)
545     static uint32_t g_q13_regs[] = { 69, 70, LLDB_INVALID_REGNUM }; // (d26, d27)
546     static uint32_t g_q14_regs[] = { 71, 72, LLDB_INVALID_REGNUM }; // (d28, d29)
547     static uint32_t g_q15_regs[] = { 73, 74, LLDB_INVALID_REGNUM }; // (d30, d31)
548 
549     static RegisterInfo g_register_infos[] = {
550 //   NAME    ALT    SZ  OFF  ENCODING          FORMAT          COMPILER             DWARF                GENERIC                 GDB    LLDB      VALUE REGS    INVALIDATE REGS
551 //   ======  ====== === ===  =============     ============    ===================  ===================  ======================  ===    ====      ==========    ===============
552     { "r0", "arg1",   4,   0, eEncodingUint,    eFormatHex,   { gcc_r0,              dwarf_r0,            LLDB_REGNUM_GENERIC_ARG1,0,      0 },        NULL,              NULL},
553     { "r1", "arg2",   4,   0, eEncodingUint,    eFormatHex,   { gcc_r1,              dwarf_r1,            LLDB_REGNUM_GENERIC_ARG2,1,      1 },        NULL,              NULL},
554     { "r2", "arg3",   4,   0, eEncodingUint,    eFormatHex,   { gcc_r2,              dwarf_r2,            LLDB_REGNUM_GENERIC_ARG3,2,      2 },        NULL,              NULL},
555     { "r3", "arg4",   4,   0, eEncodingUint,    eFormatHex,   { gcc_r3,              dwarf_r3,            LLDB_REGNUM_GENERIC_ARG4,3,      3 },        NULL,              NULL},
556     { "r4",   NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r4,              dwarf_r4,            LLDB_INVALID_REGNUM,     4,      4 },        NULL,              NULL},
557     { "r5",   NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r5,              dwarf_r5,            LLDB_INVALID_REGNUM,     5,      5 },        NULL,              NULL},
558     { "r6",   NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r6,              dwarf_r6,            LLDB_INVALID_REGNUM,     6,      6 },        NULL,              NULL},
559     { "r7",   "fp",   4,   0, eEncodingUint,    eFormatHex,   { gcc_r7,              dwarf_r7,            LLDB_REGNUM_GENERIC_FP,  7,      7 },        NULL,              NULL},
560     { "r8",   NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r8,              dwarf_r8,            LLDB_INVALID_REGNUM,     8,      8 },        NULL,              NULL},
561     { "r9",   NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r9,              dwarf_r9,            LLDB_INVALID_REGNUM,     9,      9 },        NULL,              NULL},
562     { "r10",  NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r10,             dwarf_r10,           LLDB_INVALID_REGNUM,    10,     10 },        NULL,              NULL},
563     { "r11",  NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r11,             dwarf_r11,           LLDB_INVALID_REGNUM,    11,     11 },        NULL,              NULL},
564     { "r12",  NULL,   4,   0, eEncodingUint,    eFormatHex,   { gcc_r12,             dwarf_r12,           LLDB_INVALID_REGNUM,    12,     12 },        NULL,              NULL},
565     { "sp",   "r13",  4,   0, eEncodingUint,    eFormatHex,   { gcc_sp,              dwarf_sp,            LLDB_REGNUM_GENERIC_SP, 13,     13 },        NULL,              NULL},
566     { "lr",   "r14",  4,   0, eEncodingUint,    eFormatHex,   { gcc_lr,              dwarf_lr,            LLDB_REGNUM_GENERIC_RA, 14,     14 },        NULL,              NULL},
567     { "pc",   "r15",  4,   0, eEncodingUint,    eFormatHex,   { gcc_pc,              dwarf_pc,            LLDB_REGNUM_GENERIC_PC, 15,     15 },        NULL,              NULL},
568     { "f0",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    16,     16 },        NULL,              NULL},
569     { "f1",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    17,     17 },        NULL,              NULL},
570     { "f2",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    18,     18 },        NULL,              NULL},
571     { "f3",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    19,     19 },        NULL,              NULL},
572     { "f4",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    20,     20 },        NULL,              NULL},
573     { "f5",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    21,     21 },        NULL,              NULL},
574     { "f6",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    22,     22 },        NULL,              NULL},
575     { "f7",   NULL,  12,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    23,     23 },        NULL,              NULL},
576     { "fps",  NULL,   4,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    24,     24 },        NULL,              NULL},
577     { "cpsr","flags", 4,   0, eEncodingUint,    eFormatHex,   { gcc_cpsr,            dwarf_cpsr,          LLDB_INVALID_REGNUM,    25,     25 },        NULL,              NULL},
578     { "s0",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s0,            LLDB_INVALID_REGNUM,    26,     26 },        NULL,              NULL},
579     { "s1",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s1,            LLDB_INVALID_REGNUM,    27,     27 },        NULL,              NULL},
580     { "s2",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s2,            LLDB_INVALID_REGNUM,    28,     28 },        NULL,              NULL},
581     { "s3",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s3,            LLDB_INVALID_REGNUM,    29,     29 },        NULL,              NULL},
582     { "s4",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s4,            LLDB_INVALID_REGNUM,    30,     30 },        NULL,              NULL},
583     { "s5",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s5,            LLDB_INVALID_REGNUM,    31,     31 },        NULL,              NULL},
584     { "s6",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s6,            LLDB_INVALID_REGNUM,    32,     32 },        NULL,              NULL},
585     { "s7",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s7,            LLDB_INVALID_REGNUM,    33,     33 },        NULL,              NULL},
586     { "s8",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s8,            LLDB_INVALID_REGNUM,    34,     34 },        NULL,              NULL},
587     { "s9",   NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s9,            LLDB_INVALID_REGNUM,    35,     35 },        NULL,              NULL},
588     { "s10",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s10,           LLDB_INVALID_REGNUM,    36,     36 },        NULL,              NULL},
589     { "s11",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s11,           LLDB_INVALID_REGNUM,    37,     37 },        NULL,              NULL},
590     { "s12",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s12,           LLDB_INVALID_REGNUM,    38,     38 },        NULL,              NULL},
591     { "s13",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s13,           LLDB_INVALID_REGNUM,    39,     39 },        NULL,              NULL},
592     { "s14",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s14,           LLDB_INVALID_REGNUM,    40,     40 },        NULL,              NULL},
593     { "s15",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s15,           LLDB_INVALID_REGNUM,    41,     41 },        NULL,              NULL},
594     { "s16",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s16,           LLDB_INVALID_REGNUM,    42,     42 },        NULL,              NULL},
595     { "s17",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s17,           LLDB_INVALID_REGNUM,    43,     43 },        NULL,              NULL},
596     { "s18",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s18,           LLDB_INVALID_REGNUM,    44,     44 },        NULL,              NULL},
597     { "s19",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s19,           LLDB_INVALID_REGNUM,    45,     45 },        NULL,              NULL},
598     { "s20",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s20,           LLDB_INVALID_REGNUM,    46,     46 },        NULL,              NULL},
599     { "s21",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s21,           LLDB_INVALID_REGNUM,    47,     47 },        NULL,              NULL},
600     { "s22",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s22,           LLDB_INVALID_REGNUM,    48,     48 },        NULL,              NULL},
601     { "s23",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s23,           LLDB_INVALID_REGNUM,    49,     49 },        NULL,              NULL},
602     { "s24",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s24,           LLDB_INVALID_REGNUM,    50,     50 },        NULL,              NULL},
603     { "s25",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s25,           LLDB_INVALID_REGNUM,    51,     51 },        NULL,              NULL},
604     { "s26",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s26,           LLDB_INVALID_REGNUM,    52,     52 },        NULL,              NULL},
605     { "s27",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s27,           LLDB_INVALID_REGNUM,    53,     53 },        NULL,              NULL},
606     { "s28",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s28,           LLDB_INVALID_REGNUM,    54,     54 },        NULL,              NULL},
607     { "s29",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s29,           LLDB_INVALID_REGNUM,    55,     55 },        NULL,              NULL},
608     { "s30",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s30,           LLDB_INVALID_REGNUM,    56,     56 },        NULL,              NULL},
609     { "s31",  NULL,   4,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s31,           LLDB_INVALID_REGNUM,    57,     57 },        NULL,              NULL},
610     { "fpscr",NULL,   4,   0, eEncodingUint,    eFormatHex,   { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    58,     58 },        NULL,              NULL},
611     { "d16",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d16,           LLDB_INVALID_REGNUM,    59,     59 },        NULL,              NULL},
612     { "d17",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d17,           LLDB_INVALID_REGNUM,    60,     60 },        NULL,              NULL},
613     { "d18",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d18,           LLDB_INVALID_REGNUM,    61,     61 },        NULL,              NULL},
614     { "d19",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d19,           LLDB_INVALID_REGNUM,    62,     62 },        NULL,              NULL},
615     { "d20",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d20,           LLDB_INVALID_REGNUM,    63,     63 },        NULL,              NULL},
616     { "d21",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d21,           LLDB_INVALID_REGNUM,    64,     64 },        NULL,              NULL},
617     { "d22",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d22,           LLDB_INVALID_REGNUM,    65,     65 },        NULL,              NULL},
618     { "d23",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d23,           LLDB_INVALID_REGNUM,    66,     66 },        NULL,              NULL},
619     { "d24",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d24,           LLDB_INVALID_REGNUM,    67,     67 },        NULL,              NULL},
620     { "d25",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d25,           LLDB_INVALID_REGNUM,    68,     68 },        NULL,              NULL},
621     { "d26",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d26,           LLDB_INVALID_REGNUM,    69,     69 },        NULL,              NULL},
622     { "d27",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d27,           LLDB_INVALID_REGNUM,    70,     70 },        NULL,              NULL},
623     { "d28",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d28,           LLDB_INVALID_REGNUM,    71,     71 },        NULL,              NULL},
624     { "d29",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d29,           LLDB_INVALID_REGNUM,    72,     72 },        NULL,              NULL},
625     { "d30",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d30,           LLDB_INVALID_REGNUM,    73,     73 },        NULL,              NULL},
626     { "d31",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d31,           LLDB_INVALID_REGNUM,    74,     74 },        NULL,              NULL},
627     { "d0",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d0,            LLDB_INVALID_REGNUM,    75,     75 },   g_d0_regs,              NULL},
628     { "d1",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d1,            LLDB_INVALID_REGNUM,    76,     76 },   g_d1_regs,              NULL},
629     { "d2",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d2,            LLDB_INVALID_REGNUM,    77,     77 },   g_d2_regs,              NULL},
630     { "d3",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d3,            LLDB_INVALID_REGNUM,    78,     78 },   g_d3_regs,              NULL},
631     { "d4",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d4,            LLDB_INVALID_REGNUM,    79,     79 },   g_d4_regs,              NULL},
632     { "d5",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d5,            LLDB_INVALID_REGNUM,    80,     80 },   g_d5_regs,              NULL},
633     { "d6",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d6,            LLDB_INVALID_REGNUM,    81,     81 },   g_d6_regs,              NULL},
634     { "d7",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d7,            LLDB_INVALID_REGNUM,    82,     82 },   g_d7_regs,              NULL},
635     { "d8",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d8,            LLDB_INVALID_REGNUM,    83,     83 },   g_d8_regs,              NULL},
636     { "d9",   NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d9,            LLDB_INVALID_REGNUM,    84,     84 },   g_d9_regs,              NULL},
637     { "d10",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d10,           LLDB_INVALID_REGNUM,    85,     85 },  g_d10_regs,              NULL},
638     { "d11",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d11,           LLDB_INVALID_REGNUM,    86,     86 },  g_d11_regs,              NULL},
639     { "d12",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d12,           LLDB_INVALID_REGNUM,    87,     87 },  g_d12_regs,              NULL},
640     { "d13",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d13,           LLDB_INVALID_REGNUM,    88,     88 },  g_d13_regs,              NULL},
641     { "d14",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d14,           LLDB_INVALID_REGNUM,    89,     89 },  g_d14_regs,              NULL},
642     { "d15",  NULL,   8,   0, eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d15,           LLDB_INVALID_REGNUM,    90,     90 },  g_d15_regs,              NULL},
643     { "q0",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q0,    LLDB_INVALID_REGNUM,    91,     91 },   g_q0_regs,              NULL},
644     { "q1",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q1,    LLDB_INVALID_REGNUM,    92,     92 },   g_q1_regs,              NULL},
645     { "q2",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q2,    LLDB_INVALID_REGNUM,    93,     93 },   g_q2_regs,              NULL},
646     { "q3",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q3,    LLDB_INVALID_REGNUM,    94,     94 },   g_q3_regs,              NULL},
647     { "q4",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q4,    LLDB_INVALID_REGNUM,    95,     95 },   g_q4_regs,              NULL},
648     { "q5",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q5,    LLDB_INVALID_REGNUM,    96,     96 },   g_q5_regs,              NULL},
649     { "q6",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q6,    LLDB_INVALID_REGNUM,    97,     97 },   g_q6_regs,              NULL},
650     { "q7",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q7,    LLDB_INVALID_REGNUM,    98,     98 },   g_q7_regs,              NULL},
651     { "q8",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q8,    LLDB_INVALID_REGNUM,    99,     99 },   g_q8_regs,              NULL},
652     { "q9",   NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q9,    LLDB_INVALID_REGNUM,   100,    100 },   g_q9_regs,              NULL},
653     { "q10",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q10,   LLDB_INVALID_REGNUM,   101,    101 },  g_q10_regs,              NULL},
654     { "q11",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q11,   LLDB_INVALID_REGNUM,   102,    102 },  g_q11_regs,              NULL},
655     { "q12",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q12,   LLDB_INVALID_REGNUM,   103,    103 },  g_q12_regs,              NULL},
656     { "q13",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q13,   LLDB_INVALID_REGNUM,   104,    104 },  g_q13_regs,              NULL},
657     { "q14",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q14,   LLDB_INVALID_REGNUM,   105,    105 },  g_q14_regs,              NULL},
658     { "q15",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15,   LLDB_INVALID_REGNUM,   106,    106 },  g_q15_regs,              NULL}
659     };
660 
661     static const uint32_t num_registers = sizeof (g_register_infos)/sizeof (RegisterInfo);
662     static ConstString gpr_reg_set ("General Purpose Registers");
663     static ConstString sfp_reg_set ("Software Floating Point Registers");
664     static ConstString vfp_reg_set ("Floating Point Registers");
665     uint32_t i;
666     // Calculate the offsets of the registers
667     // Note that the layout of the "composite" registers (d0-d15 and q0-q15) which comes after the
668     // "primordial" registers is important.  This enables us to calculate the offset of the composite
669     // register by using the offset of its first primordial register.  For example, to calculate the
670     // offset of q0, use s0's offset.
671     if (g_register_infos[2].byte_offset == 0)
672     {
673         uint32_t byte_offset = 0;
674         for (i=0; i<num_registers; ++i)
675         {
676             // For primordial registers, increment the byte_offset by the byte_size to arrive at the
677             // byte_offset for the next register.  Otherwise, we have a composite register whose
678             // offset can be calculated by consulting the offset of its first primordial register.
679             if (!g_register_infos[i].value_regs)
680             {
681                 g_register_infos[i].byte_offset = byte_offset;
682                 byte_offset += g_register_infos[i].byte_size;
683             }
684             else
685             {
686                 const uint32_t first_primordial_reg = g_register_infos[i].value_regs[0];
687                 g_register_infos[i].byte_offset = g_register_infos[first_primordial_reg].byte_offset;
688             }
689         }
690     }
691     for (i=0; i<num_registers; ++i)
692     {
693         ConstString name;
694         ConstString alt_name;
695         if (g_register_infos[i].name && g_register_infos[i].name[0])
696             name.SetCString(g_register_infos[i].name);
697         if (g_register_infos[i].alt_name && g_register_infos[i].alt_name[0])
698             alt_name.SetCString(g_register_infos[i].alt_name);
699 
700         if (i <= 15 || i == 25)
701             AddRegister (g_register_infos[i], name, alt_name, gpr_reg_set);
702         else if (i <= 24)
703             AddRegister (g_register_infos[i], name, alt_name, sfp_reg_set);
704         else
705             AddRegister (g_register_infos[i], name, alt_name, vfp_reg_set);
706     }
707 }
708 
709