LLDB  mainline
RegisterContextDarwin_i386.cpp
Go to the documentation of this file.
1 //===-- RegisterContextDarwin_i386.cpp ------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
11 #include "lldb/Utility/Endian.h"
12 #include "lldb/Utility/Log.h"
14 #include "lldb/Utility/Scalar.h"
15 #include "llvm/ADT/STLExtras.h"
16 #include "llvm/Support/Compiler.h"
17 
18 #include <cstddef>
19 
20 #include <memory>
21 
23 
24 using namespace lldb;
25 using namespace lldb_private;
26 
27 enum {
28  gpr_eax = 0,
44 
71 
75 
77 
78  // Aliases
86 };
87 
88 enum {
99 };
100 
101 enum {
128 };
129 
130 #define GPR_OFFSET(reg) \
131  (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::GPR, reg))
132 #define FPU_OFFSET(reg) \
133  (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::FPU, reg) + \
134  sizeof(RegisterContextDarwin_i386::GPR))
135 #define EXC_OFFSET(reg) \
136  (LLVM_EXTENSION offsetof(RegisterContextDarwin_i386::EXC, reg) + \
137  sizeof(RegisterContextDarwin_i386::GPR) + \
138  sizeof(RegisterContextDarwin_i386::FPU))
139 
140 // These macros will auto define the register name, alt name, register size,
141 // register offset, encoding, format and native register. This ensures that the
142 // register state structures are defined correctly and have the correct sizes
143 // and offsets.
144 #define DEFINE_GPR(reg, alt) \
145  #reg, alt, sizeof(((RegisterContextDarwin_i386::GPR *) NULL)->reg), \
146  GPR_OFFSET(reg), eEncodingUint, eFormatHex
147 #define DEFINE_FPU_UINT(reg) \
148  #reg, NULL, sizeof(((RegisterContextDarwin_i386::FPU *) NULL)->reg), \
149  FPU_OFFSET(reg), eEncodingUint, eFormatHex
150 #define DEFINE_FPU_VECT(reg, i) \
151  #reg #i, NULL, \
152  sizeof(((RegisterContextDarwin_i386::FPU *) NULL)->reg[i].bytes), \
153  FPU_OFFSET(reg[i]), eEncodingVector, eFormatVectorOfUInt8, \
154  {LLDB_INVALID_REGNUM, dwarf_##reg##i, \
155  LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
156  fpu_##reg##i }, \
157  nullptr, nullptr,
158 
159 #define DEFINE_EXC(reg) \
160  #reg, NULL, sizeof(((RegisterContextDarwin_i386::EXC *) NULL)->reg), \
161  EXC_OFFSET(reg), eEncodingUint, eFormatHex
162 #define REG_CONTEXT_SIZE \
163  (sizeof(RegisterContextDarwin_i386::GPR) + \
164  sizeof(RegisterContextDarwin_i386::FPU) + \
165  sizeof(RegisterContextDarwin_i386::EXC))
166 
167 static RegisterInfo g_register_infos[] = {
168  // Macro auto defines most stuff eh_frame DWARF
169  // GENERIC PROCESS PLUGIN LLDB
170  // =============================== =======================
171  // =================== ========================= ==================
172  // =================
173  {DEFINE_GPR(eax, nullptr),
175  gpr_eax},
176  nullptr,
177  nullptr,
178  },
179  {DEFINE_GPR(ebx, nullptr),
181  gpr_ebx},
182  nullptr,
183  nullptr,
184  },
185  {DEFINE_GPR(ecx, nullptr),
187  gpr_ecx},
188  nullptr,
189  nullptr,
190  },
191  {DEFINE_GPR(edx, nullptr),
193  gpr_edx},
194  nullptr,
195  nullptr,
196  },
197  {DEFINE_GPR(edi, nullptr),
199  gpr_edi},
200  nullptr,
201  nullptr,
202  },
203  {DEFINE_GPR(esi, nullptr),
205  gpr_esi},
206  nullptr,
207  nullptr,
208  },
209  {DEFINE_GPR(ebp, "fp"),
211  gpr_ebp},
212  nullptr,
213  nullptr,
214  },
215  {DEFINE_GPR(esp, "sp"),
217  gpr_esp},
218  nullptr,
219  nullptr,
220  },
221  {DEFINE_GPR(ss, nullptr),
224  nullptr,
225  nullptr,
226  },
227  {DEFINE_GPR(eflags, "flags"),
230  nullptr,
231  nullptr,
232  },
233  {DEFINE_GPR(eip, "pc"),
235  gpr_eip},
236  nullptr,
237  nullptr,
238  },
239  {DEFINE_GPR(cs, nullptr),
242  nullptr,
243  nullptr,
244  },
245  {DEFINE_GPR(ds, nullptr),
248  nullptr,
249  nullptr,
250  },
251  {DEFINE_GPR(es, nullptr),
254  nullptr,
255  nullptr,
256  },
257  {DEFINE_GPR(fs, nullptr),
260  nullptr,
261  nullptr,
262  },
263  {DEFINE_GPR(gs, nullptr),
266  nullptr,
267  nullptr,
268  },
269 
270  {DEFINE_FPU_UINT(fcw),
273  nullptr,
274  nullptr,
275  },
276  {DEFINE_FPU_UINT(fsw),
279  nullptr,
280  nullptr,
281  },
282  {DEFINE_FPU_UINT(ftw),
285  nullptr,
286  nullptr,
287  },
288  {DEFINE_FPU_UINT(fop),
291  nullptr,
292  nullptr,
293  },
294  {DEFINE_FPU_UINT(ip),
297  nullptr,
298  nullptr,
299  },
300  {DEFINE_FPU_UINT(cs),
303  nullptr,
304  nullptr,
305  },
306  {DEFINE_FPU_UINT(dp),
309  nullptr,
310  nullptr,
311  },
312  {DEFINE_FPU_UINT(ds),
315  nullptr,
316  nullptr,
317  },
318  {DEFINE_FPU_UINT(mxcsr),
321  nullptr,
322  nullptr,
323  },
324  {DEFINE_FPU_UINT(mxcsrmask),
327  nullptr,
328  nullptr,
329  },
330  {DEFINE_FPU_VECT(stmm, 0)},
331  {DEFINE_FPU_VECT(stmm, 1)},
332  {DEFINE_FPU_VECT(stmm, 2)},
333  {DEFINE_FPU_VECT(stmm, 3)},
334  {DEFINE_FPU_VECT(stmm, 4)},
335  {DEFINE_FPU_VECT(stmm, 5)},
336  {DEFINE_FPU_VECT(stmm, 6)},
337  {DEFINE_FPU_VECT(stmm, 7)},
338  {DEFINE_FPU_VECT(xmm, 0)},
339  {DEFINE_FPU_VECT(xmm, 1)},
340  {DEFINE_FPU_VECT(xmm, 2)},
341  {DEFINE_FPU_VECT(xmm, 3)},
342  {DEFINE_FPU_VECT(xmm, 4)},
343  {DEFINE_FPU_VECT(xmm, 5)},
344  {DEFINE_FPU_VECT(xmm, 6)},
345  {DEFINE_FPU_VECT(xmm, 7)},
346 
347  {DEFINE_EXC(trapno),
350  nullptr,
351  nullptr,
352  },
353  {DEFINE_EXC(err),
356  nullptr,
357  nullptr,
358  },
359  {DEFINE_EXC(faultvaddr),
362  nullptr,
363  nullptr,
364  }};
365 
366 static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
367 
369  Thread &thread, uint32_t concrete_frame_idx)
370  : RegisterContext(thread, concrete_frame_idx), gpr(), fpu(), exc() {
371  uint32_t i;
372  for (i = 0; i < kNumErrors; i++) {
373  gpr_errs[i] = -1;
374  fpu_errs[i] = -1;
375  exc_errs[i] = -1;
376  }
377 }
378 
380 
383 }
384 
387  return k_num_registers;
388 }
389 
390 const RegisterInfo *
393  if (reg < k_num_registers)
394  return &g_register_infos[reg];
395  return nullptr;
396 }
397 
399  return k_num_register_infos;
400 }
401 
403  return g_register_infos;
404 }
405 
406 // General purpose registers
410 
411 // Floating point registers
417  fpu_xmm6, fpu_xmm7};
418 
419 // Exception registers
420 
422 
423 // Number of registers in each register set
424 const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
425 const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
426 const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
427 
428 // Register set definitions. The first definitions at register set index of
429 // zero is for all registers, followed by other registers sets. The register
430 // information for the all register set need not be filled in.
431 static const RegisterSet g_reg_sets[] = {
432  {
433  "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums,
434  },
435  {"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
436  {"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
437 
438 const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
439 
441  return k_num_regsets;
442 }
443 
444 const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) {
445  if (reg_set < k_num_regsets)
446  return &g_reg_sets[reg_set];
447  return nullptr;
448 }
449 
450 // Register information definitions for 32 bit i386.
452  if (reg_num < fpu_fcw)
453  return GPRRegSet;
454  else if (reg_num < exc_trapno)
455  return FPURegSet;
456  else if (reg_num < k_num_registers)
457  return EXCRegSet;
458  return -1;
459 }
460 
461 void RegisterContextDarwin_i386::LogGPR(Log *log, const char *title) {
462  if (log) {
463  if (title)
464  LLDB_LOGF(log, "%s", title);
465  for (uint32_t i = 0; i < k_num_gpr_registers; i++) {
466  uint32_t reg = gpr_eax + i;
467  LLDB_LOGF(log, "%12s = 0x%8.8x", g_register_infos[reg].name,
468  (&gpr.eax)[reg]);
469  }
470  }
471 }
472 
474  int set = GPRRegSet;
475  if (force || !RegisterSetIsCached(set)) {
477  }
478  return GetError(set, Read);
479 }
480 
482  int set = FPURegSet;
483  if (force || !RegisterSetIsCached(set)) {
485  }
486  return GetError(set, Read);
487 }
488 
490  int set = EXCRegSet;
491  if (force || !RegisterSetIsCached(set)) {
493  }
494  return GetError(set, Read);
495 }
496 
498  int set = GPRRegSet;
499  if (!RegisterSetIsCached(set)) {
500  SetError(set, Write, -1);
501  return -1;
502  }
504  SetError(set, Read, -1);
505  return GetError(set, Write);
506 }
507 
509  int set = FPURegSet;
510  if (!RegisterSetIsCached(set)) {
511  SetError(set, Write, -1);
512  return -1;
513  }
515  SetError(set, Read, -1);
516  return GetError(set, Write);
517 }
518 
520  int set = EXCRegSet;
521  if (!RegisterSetIsCached(set)) {
522  SetError(set, Write, -1);
523  return -1;
524  }
526  SetError(set, Read, -1);
527  return GetError(set, Write);
528 }
529 
531  switch (set) {
532  case GPRRegSet:
533  return ReadGPR(force);
534  case FPURegSet:
535  return ReadFPU(force);
536  case EXCRegSet:
537  return ReadEXC(force);
538  default:
539  break;
540  }
541  return -1;
542 }
543 
545  // Make sure we have a valid context to set.
546  if (RegisterSetIsCached(set)) {
547  switch (set) {
548  case GPRRegSet:
549  return WriteGPR();
550  case FPURegSet:
551  return WriteFPU();
552  case EXCRegSet:
553  return WriteEXC();
554  default:
555  break;
556  }
557  }
558  return -1;
559 }
560 
561 bool RegisterContextDarwin_i386::ReadRegister(const RegisterInfo *reg_info,
562  RegisterValue &value) {
563  const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
565 
566  if (set == -1)
567  return false;
568 
569  if (ReadRegisterSet(set, false) != 0)
570  return false;
571 
572  switch (reg) {
573  case gpr_eax:
574  case gpr_ebx:
575  case gpr_ecx:
576  case gpr_edx:
577  case gpr_edi:
578  case gpr_esi:
579  case gpr_ebp:
580  case gpr_esp:
581  case gpr_ss:
582  case gpr_eflags:
583  case gpr_eip:
584  case gpr_cs:
585  case gpr_ds:
586  case gpr_es:
587  case gpr_fs:
588  case gpr_gs:
589  value = (&gpr.eax)[reg - gpr_eax];
590  break;
591 
592  case fpu_fcw:
593  value = fpu.fcw;
594  break;
595 
596  case fpu_fsw:
597  value = fpu.fsw;
598  break;
599 
600  case fpu_ftw:
601  value = fpu.ftw;
602  break;
603 
604  case fpu_fop:
605  value = fpu.fop;
606  break;
607 
608  case fpu_ip:
609  value = fpu.ip;
610  break;
611 
612  case fpu_cs:
613  value = fpu.cs;
614  break;
615 
616  case fpu_dp:
617  value = fpu.dp;
618  break;
619 
620  case fpu_ds:
621  value = fpu.ds;
622  break;
623 
624  case fpu_mxcsr:
625  value = fpu.mxcsr;
626  break;
627 
628  case fpu_mxcsrmask:
629  value = fpu.mxcsrmask;
630  break;
631 
632  case fpu_stmm0:
633  case fpu_stmm1:
634  case fpu_stmm2:
635  case fpu_stmm3:
636  case fpu_stmm4:
637  case fpu_stmm5:
638  case fpu_stmm6:
639  case fpu_stmm7:
640  // These values don't fit into scalar types,
641  // RegisterContext::ReadRegisterBytes() must be used for these registers
642  //::memcpy (reg_value.value.vector.uint8, fpu.stmm[reg - fpu_stmm0].bytes,
643  //10);
644  return false;
645 
646  case fpu_xmm0:
647  case fpu_xmm1:
648  case fpu_xmm2:
649  case fpu_xmm3:
650  case fpu_xmm4:
651  case fpu_xmm5:
652  case fpu_xmm6:
653  case fpu_xmm7:
654  // These values don't fit into scalar types,
655  // RegisterContext::ReadRegisterBytes() must be used for these registers
656  //::memcpy (reg_value.value.vector.uint8, fpu.xmm[reg - fpu_xmm0].bytes,
657  //16);
658  return false;
659 
660  case exc_trapno:
661  value = exc.trapno;
662  break;
663 
664  case exc_err:
665  value = exc.err;
666  break;
667 
668  case exc_faultvaddr:
669  value = exc.faultvaddr;
670  break;
671 
672  default:
673  return false;
674  }
675  return true;
676 }
677 
678 bool RegisterContextDarwin_i386::WriteRegister(const RegisterInfo *reg_info,
679  const RegisterValue &value) {
680  const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
681  int set = GetSetForNativeRegNum(reg);
682 
683  if (set == -1)
684  return false;
685 
686  if (ReadRegisterSet(set, false) != 0)
687  return false;
688 
689  switch (reg) {
690  case gpr_eax:
691  case gpr_ebx:
692  case gpr_ecx:
693  case gpr_edx:
694  case gpr_edi:
695  case gpr_esi:
696  case gpr_ebp:
697  case gpr_esp:
698  case gpr_ss:
699  case gpr_eflags:
700  case gpr_eip:
701  case gpr_cs:
702  case gpr_ds:
703  case gpr_es:
704  case gpr_fs:
705  case gpr_gs:
706  (&gpr.eax)[reg - gpr_eax] = value.GetAsUInt32();
707  break;
708 
709  case fpu_fcw:
710  fpu.fcw = value.GetAsUInt16();
711  break;
712 
713  case fpu_fsw:
714  fpu.fsw = value.GetAsUInt16();
715  break;
716 
717  case fpu_ftw:
718  fpu.ftw = value.GetAsUInt8();
719  break;
720 
721  case fpu_fop:
722  fpu.fop = value.GetAsUInt16();
723  break;
724 
725  case fpu_ip:
726  fpu.ip = value.GetAsUInt32();
727  break;
728 
729  case fpu_cs:
730  fpu.cs = value.GetAsUInt16();
731  break;
732 
733  case fpu_dp:
734  fpu.dp = value.GetAsUInt32();
735  break;
736 
737  case fpu_ds:
738  fpu.ds = value.GetAsUInt16();
739  break;
740 
741  case fpu_mxcsr:
742  fpu.mxcsr = value.GetAsUInt32();
743  break;
744 
745  case fpu_mxcsrmask:
746  fpu.mxcsrmask = value.GetAsUInt32();
747  break;
748 
749  case fpu_stmm0:
750  case fpu_stmm1:
751  case fpu_stmm2:
752  case fpu_stmm3:
753  case fpu_stmm4:
754  case fpu_stmm5:
755  case fpu_stmm6:
756  case fpu_stmm7:
757  // These values don't fit into scalar types,
758  // RegisterContext::ReadRegisterBytes() must be used for these registers
759  ::memcpy(fpu.stmm[reg - fpu_stmm0].bytes, value.GetBytes(),
760  value.GetByteSize());
761  return false;
762 
763  case fpu_xmm0:
764  case fpu_xmm1:
765  case fpu_xmm2:
766  case fpu_xmm3:
767  case fpu_xmm4:
768  case fpu_xmm5:
769  case fpu_xmm6:
770  case fpu_xmm7:
771  // These values don't fit into scalar types,
772  // RegisterContext::ReadRegisterBytes() must be used for these registers
773  ::memcpy(fpu.xmm[reg - fpu_xmm0].bytes, value.GetBytes(),
774  value.GetByteSize());
775  return false;
776 
777  case exc_trapno:
778  exc.trapno = value.GetAsUInt32();
779  break;
780 
781  case exc_err:
782  exc.err = value.GetAsUInt32();
783  break;
784 
785  case exc_faultvaddr:
786  exc.faultvaddr = value.GetAsUInt32();
787  break;
788 
789  default:
790  return false;
791  }
792  return WriteRegisterSet(set) == 0;
793 }
794 
796  lldb::DataBufferSP &data_sp) {
797  data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
798  if (ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) {
799  uint8_t *dst = data_sp->GetBytes();
800  ::memcpy(dst, &gpr, sizeof(gpr));
801  dst += sizeof(gpr);
802 
803  ::memcpy(dst, &fpu, sizeof(fpu));
804  dst += sizeof(gpr);
805 
806  ::memcpy(dst, &exc, sizeof(exc));
807  return true;
808  }
809  return false;
810 }
811 
813  const lldb::DataBufferSP &data_sp) {
814  if (data_sp && data_sp->GetByteSize() == REG_CONTEXT_SIZE) {
815  const uint8_t *src = data_sp->GetBytes();
816  ::memcpy(&gpr, src, sizeof(gpr));
817  src += sizeof(gpr);
818 
819  ::memcpy(&fpu, src, sizeof(fpu));
820  src += sizeof(gpr);
821 
822  ::memcpy(&exc, src, sizeof(exc));
823  uint32_t success_count = 0;
824  if (WriteGPR() == 0)
825  ++success_count;
826  if (WriteFPU() == 0)
827  ++success_count;
828  if (WriteEXC() == 0)
829  ++success_count;
830  return success_count == 3;
831  }
832  return false;
833 }
834 
836  lldb::RegisterKind kind, uint32_t reg) {
837  if (kind == eRegisterKindGeneric) {
838  switch (reg) {
840  return gpr_eip;
842  return gpr_esp;
844  return gpr_ebp;
846  return gpr_eflags;
848  default:
849  break;
850  }
851  } else if (kind == eRegisterKindEHFrame || kind == eRegisterKindDWARF) {
852  switch (reg) {
853  case dwarf_eax:
854  return gpr_eax;
855  case dwarf_ecx:
856  return gpr_ecx;
857  case dwarf_edx:
858  return gpr_edx;
859  case dwarf_ebx:
860  return gpr_ebx;
861  case dwarf_esp:
862  return gpr_esp;
863  case dwarf_ebp:
864  return gpr_ebp;
865  case dwarf_esi:
866  return gpr_esi;
867  case dwarf_edi:
868  return gpr_edi;
869  case dwarf_eip:
870  return gpr_eip;
871  case dwarf_eflags:
872  return gpr_eflags;
873  case dwarf_stmm0:
874  return fpu_stmm0;
875  case dwarf_stmm1:
876  return fpu_stmm1;
877  case dwarf_stmm2:
878  return fpu_stmm2;
879  case dwarf_stmm3:
880  return fpu_stmm3;
881  case dwarf_stmm4:
882  return fpu_stmm4;
883  case dwarf_stmm5:
884  return fpu_stmm5;
885  case dwarf_stmm6:
886  return fpu_stmm6;
887  case dwarf_stmm7:
888  return fpu_stmm7;
889  case dwarf_xmm0:
890  return fpu_xmm0;
891  case dwarf_xmm1:
892  return fpu_xmm1;
893  case dwarf_xmm2:
894  return fpu_xmm2;
895  case dwarf_xmm3:
896  return fpu_xmm3;
897  case dwarf_xmm4:
898  return fpu_xmm4;
899  case dwarf_xmm5:
900  return fpu_xmm5;
901  case dwarf_xmm6:
902  return fpu_xmm6;
903  case dwarf_xmm7:
904  return fpu_xmm7;
905  default:
906  break;
907  }
908  } else if (kind == eRegisterKindLLDB) {
909  return reg;
910  }
911  return LLDB_INVALID_REGNUM;
912 }
913 
915  if (ReadGPR(false) != 0)
916  return false;
917 
918  const uint32_t trace_bit = 0x100u;
919  if (enable) {
920  // If the trace bit is already set, there is nothing to do
921  if (gpr.eflags & trace_bit)
922  return true;
923  else
924  gpr.eflags |= trace_bit;
925  } else {
926  // If the trace bit is already cleared, there is nothing to do
927  if (gpr.eflags & trace_bit)
928  gpr.eflags &= ~trace_bit;
929  else
930  return true;
931  }
932 
933  return WriteGPR() == 0;
934 }
fpu_stmm4
@ fpu_stmm4
Definition: RegisterContextDarwin_i386.cpp:59
fpu_stmm3
@ fpu_stmm3
Definition: RegisterContextDarwin_i386.cpp:58
RegisterContextDarwin_i386::GPR::eflags
uint32_t eflags
Definition: RegisterContextDarwin_i386.h:57
RegisterContextDarwin_i386::ReadRegister
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
Definition: RegisterContextDarwin_i386.cpp:561
gpr_ds
@ gpr_ds
Definition: RegisterContextDarwin_i386.cpp:40
RegisterContextDarwin_i386::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextDarwin_i386.cpp:385
gpr_edx
@ gpr_edx
Definition: RegisterContextDarwin_i386.cpp:31
Scalar.h
ehframe_ecx
@ ehframe_ecx
Definition: RegisterContextDarwin_i386.cpp:90
ehframe_edx
@ ehframe_edx
Definition: RegisterContextDarwin_i386.cpp:91
RegisterContextDarwin_i386::FPU::dp
uint32_t dp
Definition: RegisterContextDarwin_i386.h:85
fpu_cs
@ fpu_cs
Definition: RegisterContextDarwin_i386.cpp:50
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:91
RegisterContextDarwin_i386::RegisterContextDarwin_i386
RegisterContextDarwin_i386(lldb_private::Thread &thread, uint32_t concrete_frame_idx)
Definition: RegisterContextDarwin_i386.cpp:368
lldb_private::RegisterValue::GetByteSize
uint32_t GetByteSize() const
Definition: RegisterValue.cpp:713
fpu_ftw
@ fpu_ftw
Definition: RegisterContextDarwin_i386.cpp:47
dwarf_edx
@ dwarf_edx
Definition: RegisterContextDarwin_i386.cpp:104
RegisterContextDarwin_i386::LogGPR
void LogGPR(lldb_private::Log *log, const char *title)
Definition: RegisterContextDarwin_i386.cpp:461
lldb_private::RegisterValue
Definition: RegisterValue.h:28
k_num_regsets
const size_t k_num_regsets
Definition: RegisterContextDarwin_i386.cpp:438
exc_err
@ exc_err
Definition: RegisterContextDarwin_i386.cpp:73
RegisterContextDarwin_i386::WriteEXC
int WriteEXC()
Definition: RegisterContextDarwin_i386.cpp:519
lldb::eRegisterKindDWARF
@ eRegisterKindDWARF
the register numbers seen DWARF
Definition: lldb-enumerations.h:229
esp
@ esp
Definition: CompactUnwindInfo.cpp:978
g_register_infos
static RegisterInfo g_register_infos[]
Definition: RegisterContextDarwin_i386.cpp:167
RegisterContextDarwin_i386::WriteFPU
int WriteFPU()
Definition: RegisterContextDarwin_i386.cpp:508
RegisterContextDarwin_i386::MMSReg::bytes
uint8_t bytes[10]
Definition: RegisterContextDarwin_i386.h:67
RegisterContextDarwin_i386::GetError
int GetError(int flavor, uint32_t err_idx) const
Definition: RegisterContextDarwin_i386.h:126
lldb::eRegisterKindGeneric
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
Definition: lldb-enumerations.h:230
gpr_ebx
@ gpr_ebx
Definition: RegisterContextDarwin_i386.cpp:29
g_fpu_regnums
static uint32_t g_fpu_regnums[]
Definition: RegisterContextDarwin_i386.cpp:412
fpu_stmm0
@ fpu_stmm0
Definition: RegisterContextDarwin_i386.cpp:55
fpu_mxcsrmask
@ fpu_mxcsrmask
Definition: RegisterContextDarwin_i386.cpp:54
gpr_gs
@ gpr_gs
Definition: RegisterContextDarwin_i386.cpp:43
dwarf_eax
@ dwarf_eax
Definition: RegisterContextDarwin_i386.cpp:102
RegisterContextDarwin_i386::HardwareSingleStep
bool HardwareSingleStep(bool enable) override
Definition: RegisterContextDarwin_i386.cpp:914
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
fpu_ip
@ fpu_ip
Definition: RegisterContextDarwin_i386.cpp:49
RegisterContextDarwin_i386::XMMReg::bytes
uint8_t bytes[16]
Definition: RegisterContextDarwin_i386.h:72
gpr_es
@ gpr_es
Definition: RegisterContextDarwin_i386.cpp:41
ehframe_eip
@ ehframe_eip
Definition: RegisterContextDarwin_i386.cpp:97
fpu_stmm7
@ fpu_stmm7
Definition: RegisterContextDarwin_i386.cpp:62
ebp
@ ebp
Definition: CompactUnwindInfo.cpp:977
k_num_exc_registers
const size_t k_num_exc_registers
Definition: RegisterContextDarwin_i386.cpp:426
dwarf_edi
@ dwarf_edi
Definition: RegisterContextDarwin_i386.cpp:109
ehframe_ebx
@ ehframe_ebx
Definition: RegisterContextDarwin_i386.cpp:92
RegisterValue.h
ebx
@ ebx
Definition: CompactUnwindInfo.cpp:976
RegisterContextDarwin_i386::WriteRegisterSet
int WriteRegisterSet(uint32_t set)
Definition: RegisterContextDarwin_i386.cpp:544
dwarf_ebx
@ dwarf_ebx
Definition: RegisterContextDarwin_i386.cpp:105
fpu_fiseg
@ fpu_fiseg
Definition: RegisterContextDarwin_i386.cpp:82
fpu_fioff
@ fpu_fioff
Definition: RegisterContextDarwin_i386.cpp:83
edx
@ edx
Definition: CompactUnwindInfo.cpp:975
RegisterContextDarwin_i386::DoWriteEXC
virtual int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc)=0
dwarf_stmm5
@ dwarf_stmm5
Definition: RegisterContextDarwin_i386.cpp:117
exc_trapno
@ exc_trapno
Definition: RegisterContextDarwin_i386.cpp:72
gpr_esi
@ gpr_esi
Definition: RegisterContextDarwin_i386.cpp:33
RegisterContextDarwin_i386::Read
@ Read
Definition: RegisterContextDarwin_i386.h:111
dwarf_eip
@ dwarf_eip
Definition: RegisterContextDarwin_i386.cpp:110
lldb_private::RegisterContext::GetThreadID
virtual lldb::tid_t GetThreadID() const
Definition: RegisterContext.cpp:256
RegisterContextDarwin_i386::FPU::fsw
uint16_t fsw
Definition: RegisterContextDarwin_i386.h:78
dwarf_stmm0
@ dwarf_stmm0
Definition: RegisterContextDarwin_i386.cpp:112
dwarf_xmm0
@ dwarf_xmm0
Definition: RegisterContextDarwin_i386.cpp:120
fpu_fcw
@ fpu_fcw
Definition: RegisterContextDarwin_i386.cpp:45
RegisterContextDarwin_i386::GPR::eax
uint32_t eax
Definition: RegisterContextDarwin_i386.h:48
fpu_fctrl
@ fpu_fctrl
Definition: RegisterContextDarwin_i386.cpp:79
RegisterContextDarwin_i386::GetRegisterInfosCount
static size_t GetRegisterInfosCount()
Definition: RegisterContextDarwin_i386.cpp:398
RegisterContextDarwin_i386::fpu_errs
int fpu_errs[2]
Definition: RegisterContextDarwin_i386.h:117
gpr_eip
@ gpr_eip
Definition: RegisterContextDarwin_i386.cpp:38
dwarf_ecx
@ dwarf_ecx
Definition: RegisterContextDarwin_i386.cpp:103
RegisterContextDarwin_i386::ReadFPU
int ReadFPU(bool force)
Definition: RegisterContextDarwin_i386.cpp:481
fpu_xmm4
@ fpu_xmm4
Definition: RegisterContextDarwin_i386.cpp:67
dwarf_xmm6
@ dwarf_xmm6
Definition: RegisterContextDarwin_i386.cpp:126
RegisterContextDarwin_i386::DoReadFPU
virtual int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu)=0
lldb::eRegisterKindEHFrame
@ eRegisterKindEHFrame
the register numbers seen in eh_frame
Definition: lldb-enumerations.h:228
fpu_dp
@ fpu_dp
Definition: RegisterContextDarwin_i386.cpp:51
RegisterContextDarwin_i386::exc_errs
int exc_errs[2]
Definition: RegisterContextDarwin_i386.h:118
DEFINE_EXC
#define DEFINE_EXC(reg)
Definition: RegisterContextDarwin_i386.cpp:159
RegisterContextDarwin_i386::FPURegSet
@ FPURegSet
Definition: RegisterContextDarwin_i386.h:103
LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:67
RegisterContextDarwin_i386::ConvertRegisterKindToRegisterNumber
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
Definition: RegisterContextDarwin_i386.cpp:835
ehframe_esp
@ ehframe_esp
Definition: RegisterContextDarwin_i386.cpp:94
RegisterContextDarwin_i386::EXC::err
uint32_t err
Definition: RegisterContextDarwin_i386.h:98
RegisterContextDarwin_i386::gpr
GPR gpr
Definition: RegisterContextDarwin_i386.h:113
RegisterContextDarwin_i386::kNumErrors
@ kNumErrors
Definition: RegisterContextDarwin_i386.h:111
dwarf_stmm3
@ dwarf_stmm3
Definition: RegisterContextDarwin_i386.cpp:115
g_gpr_regnums
static uint32_t g_gpr_regnums[]
Definition: RegisterContextDarwin_i386.cpp:407
DEFINE_FPU_UINT
#define DEFINE_FPU_UINT(reg)
Definition: RegisterContextDarwin_i386.cpp:147
lldb::eRegisterKindLLDB
@ eRegisterKindLLDB
lldb's internal register numbers
Definition: lldb-enumerations.h:234
fpu_stmm5
@ fpu_stmm5
Definition: RegisterContextDarwin_i386.cpp:60
dwarf_xmm5
@ dwarf_xmm5
Definition: RegisterContextDarwin_i386.cpp:125
g_reg_sets
static const RegisterSet g_reg_sets[]
Definition: RegisterContextDarwin_i386.cpp:431
Log.h
fpu_stmm1
@ fpu_stmm1
Definition: RegisterContextDarwin_i386.cpp:56
RegisterContextDarwin_i386::~RegisterContextDarwin_i386
~RegisterContextDarwin_i386() override
RegisterContextDarwin_i386::FPU::fcw
uint16_t fcw
Definition: RegisterContextDarwin_i386.h:77
RegisterContextDarwin_i386::ReadAllRegisterValues
bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override
Definition: RegisterContextDarwin_i386.cpp:795
ehframe_esi
@ ehframe_esi
Definition: RegisterContextDarwin_i386.cpp:95
RegisterContextDarwin_i386::fpu
FPU fpu
Definition: RegisterContextDarwin_i386.h:114
RegisterContextDarwin_i386::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextDarwin_i386.cpp:391
lldb_private::Thread
Definition: Thread.h:60
lldb_private::RegisterValue::GetBytes
const void * GetBytes() const
Definition: RegisterValue.cpp:693
RegisterContextDarwin_i386::DoWriteGPR
virtual int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr)=0
fpu_fooff
@ fpu_fooff
Definition: RegisterContextDarwin_i386.cpp:85
lldb_private::RegisterValue::GetAsUInt16
uint16_t GetAsUInt16(uint16_t fail_value=UINT16_MAX, bool *success_ptr=nullptr) const
Definition: RegisterValue.cpp:507
gpr_eax
@ gpr_eax
Definition: RegisterContextDarwin_i386.cpp:28
REG_CONTEXT_SIZE
#define REG_CONTEXT_SIZE
Definition: RegisterContextDarwin_i386.cpp:162
ehframe_eax
@ ehframe_eax
Definition: RegisterContextDarwin_i386.cpp:89
fpu_fstat
@ fpu_fstat
Definition: RegisterContextDarwin_i386.cpp:80
gpr_edi
@ gpr_edi
Definition: RegisterContextDarwin_i386.cpp:32
RegisterContextDarwin_i386::FPU::cs
uint16_t cs
Definition: RegisterContextDarwin_i386.h:83
dwarf_esi
@ dwarf_esi
Definition: RegisterContextDarwin_i386.cpp:108
lldb_private::RegisterValue::GetAsUInt8
uint8_t GetAsUInt8(uint8_t fail_value=UINT8_MAX, bool *success_ptr=nullptr) const
Definition: RegisterValue.h:108
gpr_ecx
@ gpr_ecx
Definition: RegisterContextDarwin_i386.cpp:30
k_num_registers
@ k_num_registers
Definition: RegisterContextDarwin_i386.cpp:76
RegisterContextDarwin_i386::FPU::fop
uint16_t fop
Definition: RegisterContextDarwin_i386.h:81
RegisterContextDarwin_i386::GetRegisterInfos
static const lldb_private::RegisterInfo * GetRegisterInfos()
Definition: RegisterContextDarwin_i386.cpp:402
dwarf_ebp
@ dwarf_ebp
Definition: RegisterContextDarwin_i386.cpp:107
RegisterContextDarwin_i386.h
RegisterContextDarwin_i386::Write
@ Write
Definition: RegisterContextDarwin_i386.h:111
gpr_ebp
@ gpr_ebp
Definition: RegisterContextDarwin_i386.cpp:34
ehframe_ebp
@ ehframe_ebp
Definition: RegisterContextDarwin_i386.cpp:93
RegisterContextDarwin_i386::DoReadGPR
virtual int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr)=0
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
fpu_fop
@ fpu_fop
Definition: RegisterContextDarwin_i386.cpp:48
RegisterContextDarwin_i386::FPU::ip
uint32_t ip
Definition: RegisterContextDarwin_i386.h:82
k_num_register_infos
static size_t k_num_register_infos
Definition: RegisterContextDarwin_i386.cpp:366
RegisterContextDarwin_i386::WriteAllRegisterValues
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
Definition: RegisterContextDarwin_i386.cpp:812
fpu_foseg
@ fpu_foseg
Definition: RegisterContextDarwin_i386.cpp:84
fpu_ds
@ fpu_ds
Definition: RegisterContextDarwin_i386.cpp:52
RegisterContextDarwin_i386::FPU::ds
uint16_t ds
Definition: RegisterContextDarwin_i386.h:86
RegisterContextDarwin_i386::ReadGPR
int ReadGPR(bool force)
Definition: RegisterContextDarwin_i386.cpp:473
RegisterContextDarwin_i386::ReadRegisterSet
int ReadRegisterSet(uint32_t set, bool force)
Definition: RegisterContextDarwin_i386.cpp:530
lldb_private::RegisterContext
Definition: RegisterContext.h:17
ehframe_eflags
@ ehframe_eflags
Definition: RegisterContextDarwin_i386.cpp:98
fpu_xmm5
@ fpu_xmm5
Definition: RegisterContextDarwin_i386.cpp:68
RegisterContextDarwin_i386::WriteGPR
int WriteGPR()
Definition: RegisterContextDarwin_i386.cpp:497
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
RegisterContextDarwin_i386::GetSetForNativeRegNum
static int GetSetForNativeRegNum(int reg_num)
Definition: RegisterContextDarwin_i386.cpp:451
gpr_esp
@ gpr_esp
Definition: RegisterContextDarwin_i386.cpp:35
DEFINE_FPU_VECT
#define DEFINE_FPU_VECT(reg, i)
Definition: RegisterContextDarwin_i386.cpp:150
RegisterContextDarwin_i386::FPU::xmm
XMMReg xmm[8]
Definition: RegisterContextDarwin_i386.h:91
RegisterContextDarwin_i386::GPRRegSet
@ GPRRegSet
Definition: RegisterContextDarwin_i386.h:103
ecx
@ ecx
Definition: CompactUnwindInfo.cpp:974
gpr_eflags
@ gpr_eflags
Definition: RegisterContextDarwin_i386.cpp:37
fpu_stmm2
@ fpu_stmm2
Definition: RegisterContextDarwin_i386.cpp:57
RegisterContextDarwin_i386::SetError
bool SetError(int flavor, uint32_t err_idx, int err)
Definition: RegisterContextDarwin_i386.h:144
uint32_t
fpu_xmm0
@ fpu_xmm0
Definition: RegisterContextDarwin_i386.cpp:63
RegisterContextDarwin_i386::RegisterSetIsCached
bool RegisterSetIsCached(int set) const
Definition: RegisterContextDarwin_i386.h:166
gpr_ss
@ gpr_ss
Definition: RegisterContextDarwin_i386.cpp:36
dwarf_eflags
@ dwarf_eflags
Definition: RegisterContextDarwin_i386.cpp:111
dwarf_xmm1
@ dwarf_xmm1
Definition: RegisterContextDarwin_i386.cpp:121
fpu_ftag
@ fpu_ftag
Definition: RegisterContextDarwin_i386.cpp:81
LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:64
fpu_xmm6
@ fpu_xmm6
Definition: RegisterContextDarwin_i386.cpp:69
edi
@ edi
Definition: CompactUnwindInfo.cpp:980
DEFINE_GPR
#define DEFINE_GPR(reg, alt)
Definition: RegisterContextDarwin_i386.cpp:144
RegisterContextDarwin_i386::exc
EXC exc
Definition: RegisterContextDarwin_i386.h:115
RegisterContextDarwin_i386::FPU::mxcsr
uint32_t mxcsr
Definition: RegisterContextDarwin_i386.h:88
eax
@ eax
Definition: CompactUnwindInfo.cpp:973
dwarf_esp
@ dwarf_esp
Definition: RegisterContextDarwin_i386.cpp:106
g_exc_regnums
static uint32_t g_exc_regnums[]
Definition: RegisterContextDarwin_i386.cpp:421
k_num_fpu_registers
const size_t k_num_fpu_registers
Definition: RegisterContextDarwin_i386.cpp:425
dwarf_stmm7
@ dwarf_stmm7
Definition: RegisterContextDarwin_i386.cpp:119
DataExtractor.h
RegisterContextDarwin_i386::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
Definition: RegisterContextDarwin_i386.cpp:444
RegisterContextDarwin_i386::DoWriteFPU
virtual int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu)=0
RegisterContextDarwin_i386::gpr_errs
int gpr_errs[2]
Definition: RegisterContextDarwin_i386.h:116
RegisterContextDarwin_i386::EXC::trapno
uint32_t trapno
Definition: RegisterContextDarwin_i386.h:97
fpu_xmm7
@ fpu_xmm7
Definition: RegisterContextDarwin_i386.cpp:70
fpu_fsw
@ fpu_fsw
Definition: RegisterContextDarwin_i386.cpp:46
RegisterContextDarwin_i386::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextDarwin_i386.cpp:381
RegisterContextDarwin_i386::InvalidateAllRegisterStates
void InvalidateAllRegisterStates()
Definition: RegisterContextDarwin_i386.h:120
RegisterContextDarwin_i386::FPU::ftw
uint8_t ftw
Definition: RegisterContextDarwin_i386.h:79
RegisterContextDarwin_i386::FPU::mxcsrmask
uint32_t mxcsrmask
Definition: RegisterContextDarwin_i386.h:89
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:65
RegisterContextDarwin_i386::EXC::faultvaddr
uint32_t faultvaddr
Definition: RegisterContextDarwin_i386.h:99
gpr_fs
@ gpr_fs
Definition: RegisterContextDarwin_i386.cpp:42
RegisterContextDarwin_i386::DoReadEXC
virtual int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc)=0
fpu_xmm3
@ fpu_xmm3
Definition: RegisterContextDarwin_i386.cpp:66
fpu_xmm1
@ fpu_xmm1
Definition: RegisterContextDarwin_i386.cpp:64
exc_faultvaddr
@ exc_faultvaddr
Definition: RegisterContextDarwin_i386.cpp:74
fpu_stmm6
@ fpu_stmm6
Definition: RegisterContextDarwin_i386.cpp:61
LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:63
dwarf_stmm1
@ dwarf_stmm1
Definition: RegisterContextDarwin_i386.cpp:113
RegisterContextDarwin_i386::ReadEXC
int ReadEXC(bool force)
Definition: RegisterContextDarwin_i386.cpp:489
dwarf_stmm6
@ dwarf_stmm6
Definition: RegisterContextDarwin_i386.cpp:118
dwarf_xmm4
@ dwarf_xmm4
Definition: RegisterContextDarwin_i386.cpp:124
gpr_cs
@ gpr_cs
Definition: RegisterContextDarwin_i386.cpp:39
ehframe_edi
@ ehframe_edi
Definition: RegisterContextDarwin_i386.cpp:96
dwarf_stmm4
@ dwarf_stmm4
Definition: RegisterContextDarwin_i386.cpp:116
lldb_private::Log
Definition: Log.h:49
RegisterContextDarwin_i386::FPU::stmm
MMSReg stmm[8]
Definition: RegisterContextDarwin_i386.h:90
esi
@ esi
Definition: CompactUnwindInfo.cpp:979
k_num_gpr_registers
const size_t k_num_gpr_registers
Definition: RegisterContextDarwin_i386.cpp:424
lldb_private::RegisterValue::GetAsUInt32
uint32_t GetAsUInt32(uint32_t fail_value=UINT32_MAX, bool *success_ptr=nullptr) const
Definition: RegisterValue.cpp:533
lldb
Definition: SBAddress.h:15
fpu_mxcsr
@ fpu_mxcsr
Definition: RegisterContextDarwin_i386.cpp:53
fpu_xmm2
@ fpu_xmm2
Definition: RegisterContextDarwin_i386.cpp:65
Endian.h
dwarf_xmm7
@ dwarf_xmm7
Definition: RegisterContextDarwin_i386.cpp:127
dwarf_stmm2
@ dwarf_stmm2
Definition: RegisterContextDarwin_i386.cpp:114
RegisterContextDarwin_i386::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextDarwin_i386.cpp:440
RegisterContextDarwin_i386::WriteRegister
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
Definition: RegisterContextDarwin_i386.cpp:678
DataBufferHeap.h
RegisterContextDarwin_i386::EXCRegSet
@ EXCRegSet
Definition: RegisterContextDarwin_i386.h:103
dwarf_xmm3
@ dwarf_xmm3
Definition: RegisterContextDarwin_i386.cpp:123
LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_RA
Definition: lldb-defines.h:66
dwarf_xmm2
@ dwarf_xmm2
Definition: RegisterContextDarwin_i386.cpp:122
eip
@ eip
Definition: CompactUnwindInfo.cpp:981