LLDB  mainline
ABISysV_mips64.cpp
Go to the documentation of this file.
1 //===-- ABISysV_mips64.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 
9 #include "ABISysV_mips64.h"
10 
11 #include "llvm/ADT/STLExtras.h"
12 #include "llvm/ADT/Triple.h"
13 
14 #include "lldb/Core/Module.h"
16 #include "lldb/Core/Value.h"
20 #include "lldb/Symbol/UnwindPlan.h"
21 #include "lldb/Target/Process.h"
23 #include "lldb/Target/StackFrame.h"
24 #include "lldb/Target/Target.h"
25 #include "lldb/Target/Thread.h"
28 #include "lldb/Utility/LLDBLog.h"
29 #include "lldb/Utility/Log.h"
31 #include "lldb/Utility/Status.h"
32 
33 using namespace lldb;
34 using namespace lldb_private;
35 
37 
39  dwarf_r0 = 0,
77 };
78 
79 static const RegisterInfo g_register_infos_mips64[] = {
80  // NAME ALT SZ OFF ENCODING FORMAT EH_FRAME
81  // DWARF GENERIC PROCESS PLUGIN
82  // LLDB NATIVE
83  // ======== ====== == === ============= ========== =============
84  // ================= ==================== =================
85  // ====================
86  {"r0",
87  "zero",
88  8,
89  0,
91  eFormatHex,
94  nullptr,
95  nullptr,
96  },
97  {"r1",
98  "AT",
99  8,
100  0,
102  eFormatHex,
105  nullptr,
106  nullptr,
107  },
108  {"r2",
109  "v0",
110  8,
111  0,
113  eFormatHex,
116  nullptr,
117  nullptr,
118  },
119  {"r3",
120  "v1",
121  8,
122  0,
124  eFormatHex,
127  nullptr,
128  nullptr,
129  },
130  {"r4",
131  nullptr,
132  8,
133  0,
135  eFormatHex,
138  nullptr,
139  nullptr,
140  },
141  {"r5",
142  nullptr,
143  8,
144  0,
146  eFormatHex,
149  nullptr,
150  nullptr,
151  },
152  {"r6",
153  nullptr,
154  8,
155  0,
157  eFormatHex,
160  nullptr,
161  nullptr,
162  },
163  {"r7",
164  nullptr,
165  8,
166  0,
168  eFormatHex,
171  nullptr,
172  nullptr,
173  },
174  {"r8",
175  nullptr,
176  8,
177  0,
179  eFormatHex,
182  nullptr,
183  nullptr,
184  },
185  {"r9",
186  nullptr,
187  8,
188  0,
190  eFormatHex,
193  nullptr,
194  nullptr,
195  },
196  {"r10",
197  nullptr,
198  8,
199  0,
201  eFormatHex,
204  nullptr,
205  nullptr,
206  },
207  {"r11",
208  nullptr,
209  8,
210  0,
212  eFormatHex,
215  nullptr,
216  nullptr,
217  },
218  {"r12",
219  nullptr,
220  8,
221  0,
223  eFormatHex,
226  nullptr,
227  nullptr,
228  },
229  {"r13",
230  nullptr,
231  8,
232  0,
234  eFormatHex,
237  nullptr,
238  nullptr,
239  },
240  {"r14",
241  nullptr,
242  8,
243  0,
245  eFormatHex,
248  nullptr,
249  nullptr,
250  },
251  {"r15",
252  nullptr,
253  8,
254  0,
256  eFormatHex,
259  nullptr,
260  nullptr,
261  },
262  {"r16",
263  nullptr,
264  8,
265  0,
267  eFormatHex,
270  nullptr,
271  nullptr,
272  },
273  {"r17",
274  nullptr,
275  8,
276  0,
278  eFormatHex,
281  nullptr,
282  nullptr,
283  },
284  {"r18",
285  nullptr,
286  8,
287  0,
289  eFormatHex,
292  nullptr,
293  nullptr,
294  },
295  {"r19",
296  nullptr,
297  8,
298  0,
300  eFormatHex,
303  nullptr,
304  nullptr,
305  },
306  {"r20",
307  nullptr,
308  8,
309  0,
311  eFormatHex,
314  nullptr,
315  nullptr,
316  },
317  {"r21",
318  nullptr,
319  8,
320  0,
322  eFormatHex,
325  nullptr,
326  nullptr,
327  },
328  {"r22",
329  nullptr,
330  8,
331  0,
333  eFormatHex,
336  nullptr,
337  nullptr,
338  },
339  {"r23",
340  nullptr,
341  8,
342  0,
344  eFormatHex,
347  nullptr,
348  nullptr,
349  },
350  {"r24",
351  nullptr,
352  8,
353  0,
355  eFormatHex,
358  nullptr,
359  nullptr,
360  },
361  {"r25",
362  nullptr,
363  8,
364  0,
366  eFormatHex,
369  nullptr,
370  nullptr,
371  },
372  {"r26",
373  nullptr,
374  8,
375  0,
377  eFormatHex,
380  nullptr,
381  nullptr,
382  },
383  {"r27",
384  nullptr,
385  8,
386  0,
388  eFormatHex,
391  nullptr,
392  nullptr,
393  },
394  {"r28",
395  "gp",
396  8,
397  0,
399  eFormatHex,
402  nullptr,
403  nullptr,
404  },
405  {"r29",
406  nullptr,
407  8,
408  0,
410  eFormatHex,
413  nullptr,
414  nullptr,
415  },
416  {"r30",
417  nullptr,
418  8,
419  0,
421  eFormatHex,
424  nullptr,
425  nullptr,
426  },
427  {"r31",
428  nullptr,
429  8,
430  0,
432  eFormatHex,
435  nullptr,
436  nullptr,
437  },
438  {"sr",
439  nullptr,
440  4,
441  0,
443  eFormatHex,
446  nullptr,
447  nullptr,
448  },
449  {"lo",
450  nullptr,
451  8,
452  0,
454  eFormatHex,
457  nullptr,
458  nullptr,
459  },
460  {"hi",
461  nullptr,
462  8,
463  0,
465  eFormatHex,
468  nullptr,
469  nullptr,
470  },
471  {"bad",
472  nullptr,
473  8,
474  0,
476  eFormatHex,
479  nullptr,
480  nullptr,
481  },
482  {"cause",
483  nullptr,
484  8,
485  0,
487  eFormatHex,
490  nullptr,
491  nullptr,
492  },
493  {"pc",
494  nullptr,
495  8,
496  0,
498  eFormatHex,
501  nullptr,
502  nullptr,
503  },
504 };
505 
507  llvm::array_lengthof(g_register_infos_mips64);
508 
509 const lldb_private::RegisterInfo *
511  count = k_num_register_infos;
513 }
514 
515 size_t ABISysV_mips64::GetRedZoneSize() const { return 0; }
516 
517 // Static Functions
518 
519 ABISP
520 ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
521  if (arch.GetTriple().isMIPS64())
522  return ABISP(
523  new ABISysV_mips64(std::move(process_sp), MakeMCRegisterInfo(arch)));
524  return ABISP();
525 }
526 
528  addr_t func_addr, addr_t return_addr,
529  llvm::ArrayRef<addr_t> args) const {
530  Log *log = GetLog(LLDBLog::Expressions);
531 
532  if (log) {
533  StreamString s;
534  s.Printf("ABISysV_mips64::PrepareTrivialCall (tid = 0x%" PRIx64
535  ", sp = 0x%" PRIx64 ", func_addr = 0x%" PRIx64
536  ", return_addr = 0x%" PRIx64,
537  thread.GetID(), (uint64_t)sp, (uint64_t)func_addr,
538  (uint64_t)return_addr);
539 
540  for (size_t i = 0; i < args.size(); ++i)
541  s.Printf(", arg%zd = 0x%" PRIx64, i + 1, args[i]);
542  s.PutCString(")");
543  log->PutString(s.GetString());
544  }
545 
546  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
547  if (!reg_ctx)
548  return false;
549 
550  const RegisterInfo *reg_info = nullptr;
551 
552  if (args.size() > 8) // TODO handle more than 8 arguments
553  return false;
554 
555  for (size_t i = 0; i < args.size(); ++i) {
556  reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
558  LLDB_LOGF(log, "About to write arg%zd (0x%" PRIx64 ") into %s", i + 1,
559  args[i], reg_info->name);
560  if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
561  return false;
562  }
563 
564  // First, align the SP
565 
566  LLDB_LOGF(log, "16-byte aligning SP: 0x%" PRIx64 " to 0x%" PRIx64,
567  (uint64_t)sp, (uint64_t)(sp & ~0xfull));
568 
569  sp &= ~(0xfull); // 16-byte alignment
570 
571  Status error;
572  const RegisterInfo *pc_reg_info =
574  const RegisterInfo *sp_reg_info =
576  const RegisterInfo *ra_reg_info =
578  const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
579  const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
580 
581  LLDB_LOGF(log, "Writing R0: 0x%" PRIx64, (uint64_t)0);
582 
583  /* Write r0 with 0, in case we are stopped in syscall,
584  * such setting prevents automatic decrement of the PC.
585  * This clears the bug 23659 for MIPS.
586  */
587  if (!reg_ctx->WriteRegisterFromUnsigned(r0_info, (uint64_t)0))
588  return false;
589 
590  LLDB_LOGF(log, "Writing SP: 0x%" PRIx64, (uint64_t)sp);
591 
592  // Set "sp" to the requested value
593  if (!reg_ctx->WriteRegisterFromUnsigned(sp_reg_info, sp))
594  return false;
595 
596  LLDB_LOGF(log, "Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
597 
598  // Set "ra" to the return address
599  if (!reg_ctx->WriteRegisterFromUnsigned(ra_reg_info, return_addr))
600  return false;
601 
602  LLDB_LOGF(log, "Writing PC: 0x%" PRIx64, (uint64_t)func_addr);
603 
604  // Set pc to the address of the called function.
605  if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_info, func_addr))
606  return false;
607 
608  LLDB_LOGF(log, "Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
609 
610  // All callers of position independent functions must place the address of
611  // the called function in t9 (r25)
612  if (!reg_ctx->WriteRegisterFromUnsigned(r25_info, func_addr))
613  return false;
614 
615  return true;
616 }
617 
619  ValueList &values) const {
620  return false;
621 }
622 
623 Status ABISysV_mips64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
624  lldb::ValueObjectSP &new_value_sp) {
625  Status error;
626  if (!new_value_sp) {
627  error.SetErrorString("Empty value object for return value.");
628  return error;
629  }
630 
631  CompilerType compiler_type = new_value_sp->GetCompilerType();
632  if (!compiler_type) {
633  error.SetErrorString("Null clang type for return value.");
634  return error;
635  }
636 
637  Thread *thread = frame_sp->GetThread().get();
638 
639  RegisterContext *reg_ctx = thread->GetRegisterContext().get();
640 
641  if (!reg_ctx)
642  error.SetErrorString("no registers are available");
643 
644  DataExtractor data;
645  Status data_error;
646  size_t num_bytes = new_value_sp->GetData(data, data_error);
647  if (data_error.Fail()) {
648  error.SetErrorStringWithFormat(
649  "Couldn't convert return value to raw data: %s",
650  data_error.AsCString());
651  return error;
652  }
653 
654  const uint32_t type_flags = compiler_type.GetTypeInfo(nullptr);
655 
656  if (type_flags & eTypeIsScalar || type_flags & eTypeIsPointer) {
657  if (type_flags & eTypeIsInteger || type_flags & eTypeIsPointer) {
658  lldb::offset_t offset = 0;
659 
660  if (num_bytes <= 16) {
661  const RegisterInfo *r2_info = reg_ctx->GetRegisterInfoByName("r2", 0);
662  if (num_bytes <= 8) {
663  uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
664 
665  if (!reg_ctx->WriteRegisterFromUnsigned(r2_info, raw_value))
666  error.SetErrorString("failed to write register r2");
667  } else {
668  uint64_t raw_value = data.GetMaxU64(&offset, 8);
669  if (reg_ctx->WriteRegisterFromUnsigned(r2_info, raw_value)) {
670  const RegisterInfo *r3_info =
671  reg_ctx->GetRegisterInfoByName("r3", 0);
672  raw_value = data.GetMaxU64(&offset, num_bytes - offset);
673 
674  if (!reg_ctx->WriteRegisterFromUnsigned(r3_info, raw_value))
675  error.SetErrorString("failed to write register r3");
676  } else
677  error.SetErrorString("failed to write register r2");
678  }
679  } else {
680  error.SetErrorString("We don't support returning longer than 128 bit "
681  "integer values at present.");
682  }
683  } else if (type_flags & eTypeIsFloat) {
684  error.SetErrorString("TODO: Handle Float Types.");
685  }
686  } else if (type_flags & eTypeIsVector) {
687  error.SetErrorString("returning vector values are not supported");
688  }
689 
690  return error;
691 }
692 
694  Thread &thread, CompilerType &return_compiler_type) const {
695  ValueObjectSP return_valobj_sp;
696  return return_valobj_sp;
697 }
698 
700  Thread &thread, CompilerType &return_compiler_type) const {
701  ValueObjectSP return_valobj_sp;
702  Value value;
703  Status error;
704 
705  ExecutionContext exe_ctx(thread.shared_from_this());
706  if (exe_ctx.GetTargetPtr() == nullptr || exe_ctx.GetProcessPtr() == nullptr)
707  return return_valobj_sp;
708 
709  value.SetCompilerType(return_compiler_type);
710 
711  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
712  if (!reg_ctx)
713  return return_valobj_sp;
714 
715  Target *target = exe_ctx.GetTargetPtr();
716  const ArchSpec target_arch = target->GetArchitecture();
717  ByteOrder target_byte_order = target_arch.GetByteOrder();
718  llvm::Optional<uint64_t> byte_size =
719  return_compiler_type.GetByteSize(&thread);
720  if (!byte_size)
721  return return_valobj_sp;
722  const uint32_t type_flags = return_compiler_type.GetTypeInfo(nullptr);
723  uint32_t fp_flag =
725 
726  const RegisterInfo *r2_info = reg_ctx->GetRegisterInfoByName("r2", 0);
727  const RegisterInfo *r3_info = reg_ctx->GetRegisterInfoByName("r3", 0);
728 
729  if (type_flags & eTypeIsScalar || type_flags & eTypeIsPointer) {
730  value.SetValueType(Value::ValueType::Scalar);
731 
732  bool success = false;
733  if (type_flags & eTypeIsInteger || type_flags & eTypeIsPointer) {
734  // Extract the register context so we can read arguments from registers
735  // In MIPS register "r2" (v0) holds the integer function return values
736 
737  uint64_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r2_info, 0);
738 
739  const bool is_signed = (type_flags & eTypeIsSigned) != 0;
740  switch (*byte_size) {
741  default:
742  break;
743 
744  case sizeof(uint64_t):
745  if (is_signed)
746  value.GetScalar() = (int64_t)(raw_value);
747  else
748  value.GetScalar() = (uint64_t)(raw_value);
749  success = true;
750  break;
751 
752  case sizeof(uint32_t):
753  if (is_signed)
754  value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);
755  else
756  value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
757  success = true;
758  break;
759 
760  case sizeof(uint16_t):
761  if (is_signed)
762  value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);
763  else
764  value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
765  success = true;
766  break;
767 
768  case sizeof(uint8_t):
769  if (is_signed)
770  value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);
771  else
772  value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
773  success = true;
774  break;
775  }
776  } else if (type_flags & eTypeIsFloat) {
777  if (type_flags & eTypeIsComplex) {
778  // Don't handle complex yet.
779  } else if (IsSoftFloat(fp_flag)) {
780  uint64_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r2_info, 0);
781  switch (*byte_size) {
782  case 4:
783  value.GetScalar() = *((float *)(&raw_value));
784  success = true;
785  break;
786  case 8:
787  value.GetScalar() = *((double *)(&raw_value));
788  success = true;
789  break;
790  case 16:
791  uint64_t result[2];
792  if (target_byte_order == eByteOrderLittle) {
793  result[0] = raw_value;
794  result[1] = reg_ctx->ReadRegisterAsUnsigned(r3_info, 0);
795  value.GetScalar() = *((long double *)(result));
796  } else {
797  result[0] = reg_ctx->ReadRegisterAsUnsigned(r3_info, 0);
798  result[1] = raw_value;
799  value.GetScalar() = *((long double *)(result));
800  }
801  success = true;
802  break;
803  }
804 
805  } else {
806  if (*byte_size <= sizeof(long double)) {
807  const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
808 
809  RegisterValue f0_value;
810  DataExtractor f0_data;
811 
812  reg_ctx->ReadRegister(f0_info, f0_value);
813 
814  f0_value.GetData(f0_data);
815 
816  lldb::offset_t offset = 0;
817  if (*byte_size == sizeof(float)) {
818  value.GetScalar() = (float)f0_data.GetFloat(&offset);
819  success = true;
820  } else if (*byte_size == sizeof(double)) {
821  value.GetScalar() = (double)f0_data.GetDouble(&offset);
822  success = true;
823  } else if (*byte_size == sizeof(long double)) {
824  const RegisterInfo *f2_info =
825  reg_ctx->GetRegisterInfoByName("f2", 0);
826  RegisterValue f2_value;
827  DataExtractor f2_data;
828  reg_ctx->ReadRegister(f2_info, f2_value);
829  DataExtractor *copy_from_extractor = nullptr;
830  WritableDataBufferSP data_sp(new DataBufferHeap(16, 0));
831  DataExtractor return_ext(
832  data_sp, target_byte_order,
833  target->GetArchitecture().GetAddressByteSize());
834 
835  if (target_byte_order == eByteOrderLittle) {
836  copy_from_extractor = &f0_data;
837  copy_from_extractor->CopyByteOrderedData(
838  0, 8, data_sp->GetBytes(), *byte_size - 8, target_byte_order);
839  f2_value.GetData(f2_data);
840  copy_from_extractor = &f2_data;
841  copy_from_extractor->CopyByteOrderedData(
842  0, 8, data_sp->GetBytes() + 8, *byte_size - 8,
843  target_byte_order);
844  } else {
845  copy_from_extractor = &f0_data;
846  copy_from_extractor->CopyByteOrderedData(
847  0, 8, data_sp->GetBytes() + 8, *byte_size - 8,
848  target_byte_order);
849  f2_value.GetData(f2_data);
850  copy_from_extractor = &f2_data;
851  copy_from_extractor->CopyByteOrderedData(
852  0, 8, data_sp->GetBytes(), *byte_size - 8, target_byte_order);
853  }
854 
855  return_valobj_sp = ValueObjectConstResult::Create(
856  &thread, return_compiler_type, ConstString(""), return_ext);
857  return return_valobj_sp;
858  }
859  }
860  }
861  }
862 
863  if (success)
864  return_valobj_sp = ValueObjectConstResult::Create(
865  thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
866  } else if (type_flags & eTypeIsStructUnion || type_flags & eTypeIsClass ||
867  type_flags & eTypeIsVector) {
868  // Any structure of up to 16 bytes in size is returned in the registers.
869  if (*byte_size <= 16) {
870  WritableDataBufferSP data_sp(new DataBufferHeap(16, 0));
871  DataExtractor return_ext(data_sp, target_byte_order,
872  target->GetArchitecture().GetAddressByteSize());
873 
874  RegisterValue r2_value, r3_value, f0_value, f1_value, f2_value;
875  // Tracks how much bytes of r2 and r3 registers we've consumed so far
876  uint32_t integer_bytes = 0;
877 
878  // True if return values are in FP return registers.
879  bool use_fp_regs = false;
880  // True if we found any non floating point field in structure.
881  bool found_non_fp_field = false;
882  // True if return values are in r2 register.
883  bool use_r2 = false;
884  // True if return values are in r3 register.
885  bool use_r3 = false;
886  // True if the result is copied into our data buffer
887  bool sucess = false;
888  std::string name;
889  bool is_complex;
890  uint32_t count;
891  const uint32_t num_children = return_compiler_type.GetNumFields();
892 
893  // A structure consisting of one or two FP values (and nothing else) will
894  // be returned in the two FP return-value registers i.e fp0 and fp2.
895  if (num_children <= 2) {
896  uint64_t field_bit_offset = 0;
897 
898  // Check if this structure contains only floating point fields
899  for (uint32_t idx = 0; idx < num_children; idx++) {
900  CompilerType field_compiler_type =
901  return_compiler_type.GetFieldAtIndex(idx, name, &field_bit_offset,
902  nullptr, nullptr);
903 
904  if (field_compiler_type.IsFloatingPointType(count, is_complex))
905  use_fp_regs = true;
906  else
907  found_non_fp_field = true;
908  }
909 
910  if (use_fp_regs && !found_non_fp_field) {
911  // We have one or two FP-only values in this structure. Get it from
912  // f0/f2 registers.
913  DataExtractor f0_data, f1_data, f2_data;
914  const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
915  const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
916  const RegisterInfo *f2_info = reg_ctx->GetRegisterInfoByName("f2", 0);
917 
918  reg_ctx->ReadRegister(f0_info, f0_value);
919  reg_ctx->ReadRegister(f2_info, f2_value);
920 
921  f0_value.GetData(f0_data);
922 
923  for (uint32_t idx = 0; idx < num_children; idx++) {
924  CompilerType field_compiler_type =
925  return_compiler_type.GetFieldAtIndex(
926  idx, name, &field_bit_offset, nullptr, nullptr);
927  llvm::Optional<uint64_t> field_byte_width =
928  field_compiler_type.GetByteSize(&thread);
929  if (!field_byte_width)
930  return return_valobj_sp;
931 
932  DataExtractor *copy_from_extractor = nullptr;
933  uint64_t return_value[2];
934  offset_t offset = 0;
935 
936  if (idx == 0) {
937  // This case is for long double type.
938  if (*field_byte_width == 16) {
939 
940  // If structure contains long double type, then it is returned
941  // in fp0/fp1 registers.
942  if (target_byte_order == eByteOrderLittle) {
943  return_value[0] = f0_data.GetU64(&offset);
944  reg_ctx->ReadRegister(f1_info, f1_value);
945  f1_value.GetData(f1_data);
946  offset = 0;
947  return_value[1] = f1_data.GetU64(&offset);
948  } else {
949  return_value[1] = f0_data.GetU64(&offset);
950  reg_ctx->ReadRegister(f1_info, f1_value);
951  f1_value.GetData(f1_data);
952  offset = 0;
953  return_value[0] = f1_data.GetU64(&offset);
954  }
955 
956  f0_data.SetData(return_value, *field_byte_width,
957  target_byte_order);
958  }
959  copy_from_extractor = &f0_data; // This is in f0, copy from
960  // register to our result
961  // structure
962  } else {
963  f2_value.GetData(f2_data);
964  // This is in f2, copy from register to our result structure
965  copy_from_extractor = &f2_data;
966  }
967 
968  // Sanity check to avoid crash
969  if (!copy_from_extractor ||
970  *field_byte_width > copy_from_extractor->GetByteSize())
971  return return_valobj_sp;
972 
973  // copy the register contents into our data buffer
974  copy_from_extractor->CopyByteOrderedData(
975  0, *field_byte_width,
976  data_sp->GetBytes() + (field_bit_offset / 8), *field_byte_width,
977  target_byte_order);
978  }
979 
980  // The result is in our data buffer. Create a variable object out of
981  // it
982  return_valobj_sp = ValueObjectConstResult::Create(
983  &thread, return_compiler_type, ConstString(""), return_ext);
984 
985  return return_valobj_sp;
986  }
987  }
988 
989  // If we reach here, it means this structure either contains more than
990  // two fields or it contains at least one non floating point type. In
991  // that case, all fields are returned in GP return registers.
992  for (uint32_t idx = 0; idx < num_children; idx++) {
993  uint64_t field_bit_offset = 0;
994  bool is_signed;
995  uint32_t padding;
996 
997  CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
998  idx, name, &field_bit_offset, nullptr, nullptr);
999  llvm::Optional<uint64_t> field_byte_width =
1000  field_compiler_type.GetByteSize(&thread);
1001 
1002  // if we don't know the size of the field (e.g. invalid type), just
1003  // bail out
1004  if (!field_byte_width || *field_byte_width == 0)
1005  break;
1006 
1007  uint32_t field_byte_offset = field_bit_offset / 8;
1008 
1009  if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
1010  field_compiler_type.IsPointerType() ||
1011  field_compiler_type.IsFloatingPointType(count, is_complex)) {
1012  padding = field_byte_offset - integer_bytes;
1013 
1014  if (integer_bytes < 8) {
1015  // We have not yet consumed r2 completely.
1016  if (integer_bytes + *field_byte_width + padding <= 8) {
1017  // This field fits in r2, copy its value from r2 to our result
1018  // structure
1019  integer_bytes = integer_bytes + *field_byte_width +
1020  padding; // Increase the consumed bytes.
1021  use_r2 = true;
1022  } else {
1023  // There isn't enough space left in r2 for this field, so this
1024  // will be in r3.
1025  integer_bytes = integer_bytes + *field_byte_width +
1026  padding; // Increase the consumed bytes.
1027  use_r3 = true;
1028  }
1029  }
1030  // We already have consumed at-least 8 bytes that means r2 is done,
1031  // and this field will be in r3. Check if this field can fit in r3.
1032  else if (integer_bytes + *field_byte_width + padding <= 16) {
1033  integer_bytes = integer_bytes + *field_byte_width + padding;
1034  use_r3 = true;
1035  } else {
1036  // There isn't any space left for this field, this should not
1037  // happen as we have already checked the overall size is not
1038  // greater than 16 bytes. For now, return a nullptr return value
1039  // object.
1040  return return_valobj_sp;
1041  }
1042  }
1043  }
1044  // Vector types up to 16 bytes are returned in GP return registers
1045  if (type_flags & eTypeIsVector) {
1046  if (*byte_size <= 8)
1047  use_r2 = true;
1048  else {
1049  use_r2 = true;
1050  use_r3 = true;
1051  }
1052  }
1053 
1054  if (use_r2) {
1055  reg_ctx->ReadRegister(r2_info, r2_value);
1056 
1057  const size_t bytes_copied = r2_value.GetAsMemoryData(
1058  r2_info, data_sp->GetBytes(), r2_info->byte_size, target_byte_order,
1059  error);
1060  if (bytes_copied != r2_info->byte_size)
1061  return return_valobj_sp;
1062  sucess = true;
1063  }
1064  if (use_r3) {
1065  reg_ctx->ReadRegister(r3_info, r3_value);
1066  const size_t bytes_copied = r3_value.GetAsMemoryData(
1067  r3_info, data_sp->GetBytes() + r2_info->byte_size,
1068  r3_info->byte_size, target_byte_order, error);
1069 
1070  if (bytes_copied != r3_info->byte_size)
1071  return return_valobj_sp;
1072  sucess = true;
1073  }
1074  if (sucess) {
1075  // The result is in our data buffer. Create a variable object out of
1076  // it
1077  return_valobj_sp = ValueObjectConstResult::Create(
1078  &thread, return_compiler_type, ConstString(""), return_ext);
1079  }
1080  return return_valobj_sp;
1081  }
1082 
1083  // Any structure/vector greater than 16 bytes in size is returned in
1084  // memory. The pointer to that memory is returned in r2.
1085  uint64_t mem_address = reg_ctx->ReadRegisterAsUnsigned(
1086  reg_ctx->GetRegisterInfoByName("r2", 0), 0);
1087 
1088  // We have got the address. Create a memory object out of it
1089  return_valobj_sp = ValueObjectMemory::Create(
1090  &thread, "", Address(mem_address, nullptr), return_compiler_type);
1091  }
1092  return return_valobj_sp;
1093 }
1094 
1096  unwind_plan.Clear();
1097  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
1098 
1100 
1101  // Our Call Frame Address is the stack pointer value
1102  row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
1103 
1104  // The previous PC is in the RA
1105  row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
1106  unwind_plan.AppendRow(row);
1107 
1108  // All other registers are the same.
1109 
1110  unwind_plan.SetSourceName("mips64 at-func-entry default");
1111  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
1112  unwind_plan.SetReturnAddressRegister(dwarf_r31);
1113  return true;
1114 }
1115 
1117  unwind_plan.Clear();
1118  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
1119 
1121 
1122  row->SetUnspecifiedRegistersAreUndefined(true);
1123  row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_r29, 0);
1124 
1125  row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
1126 
1127  unwind_plan.AppendRow(row);
1128  unwind_plan.SetSourceName("mips64 default unwind plan");
1129  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
1132  return true;
1133 }
1134 
1135 bool ABISysV_mips64::RegisterIsVolatile(const RegisterInfo *reg_info) {
1136  return !RegisterIsCalleeSaved(reg_info);
1137 }
1138 
1140  return (fp_flag == lldb_private::ArchSpec::eMIPS_ABI_FP_SOFT);
1141 }
1142 
1143 bool ABISysV_mips64::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
1144  if (reg_info) {
1145  // Preserved registers are :
1146  // r16-r23, r28, r29, r30, r31
1147 
1148  int reg = ((reg_info->byte_offset) / 8);
1149 
1150  bool save = (reg >= 16) && (reg <= 23);
1151  save |= (reg >= 28) && (reg <= 31);
1152 
1153  return save;
1154  }
1155  return false;
1156 }
1157 
1159  PluginManager::RegisterPlugin(
1160  GetPluginNameStatic(), "System V ABI for mips64 targets", CreateInstance);
1161 }
1162 
1164  PluginManager::UnregisterPlugin(CreateInstance);
1165 }
dwarf_r0
@ dwarf_r0
Definition: ABISysV_mips64.cpp:39
dwarf_r30
@ dwarf_r30
Definition: ABISysV_mips64.cpp:69
ABISysV_mips64::IsSoftFloat
bool IsSoftFloat(uint32_t fp_flag) const
Definition: ABISysV_mips64.cpp:1139
LLDB_REGNUM_GENERIC_ARG2
#define LLDB_REGNUM_GENERIC_ARG2
Definition: lldb-defines.h:58
dwarf_r12
@ dwarf_r12
Definition: ABISysV_mips64.cpp:51
LLDB_REGNUM_GENERIC_ARG3
#define LLDB_REGNUM_GENERIC_ARG3
Definition: lldb-defines.h:60
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
dwarf_r11
@ dwarf_r11
Definition: ABISysV_mips64.cpp:50
lldb_private::ArchSpec::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
Definition: ArchSpec.cpp:731
lldb_private::UnwindPlan::AppendRow
void AppendRow(const RowSP &row_sp)
Definition: UnwindPlan.cpp:362
dwarf_r18
@ dwarf_r18
Definition: ABISysV_mips64.cpp:57
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::Log::PutString
void PutString(llvm::StringRef str)
Definition: Log.cpp:134
LLDB_REGNUM_GENERIC_ARG1
#define LLDB_REGNUM_GENERIC_ARG1
Definition: lldb-defines.h:56
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:79
ABISysV_mips64::Initialize
static void Initialize()
Definition: ABISysV_mips64.cpp:1158
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::UnwindPlan::SetRegisterKind
void SetRegisterKind(lldb::RegisterKind kind)
Definition: UnwindPlan.h:437
lldb::eRegisterKindDWARF
@ eRegisterKindDWARF
the register numbers seen DWARF
Definition: lldb-enumerations.h:229
lldb_private::Value
Definition: Value.h:38
lldb_private::Value::SetValueType
void SetValueType(ValueType value_type)
Definition: Value.h:89
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:206
dwarf_r13
@ dwarf_r13
Definition: ABISysV_mips64.cpp:52
ABISysV_mips64::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABISysV_mips64.cpp:520
lldb::eRegisterKindGeneric
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
Definition: lldb-enumerations.h:230
ABISysV_mips64::GetReturnValueObjectSimple
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
Definition: ABISysV_mips64.cpp:693
dwarf_r5
@ dwarf_r5
Definition: ABISysV_mips64.cpp:44
LLDB_REGNUM_GENERIC_ARG5
#define LLDB_REGNUM_GENERIC_ARG5
Definition: lldb-defines.h:64
lldb_private::UnwindPlan::SetUnwindPlanValidAtAllInstructions
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
Definition: UnwindPlan.h:490
dwarf_r3
@ dwarf_r3
Definition: ABISysV_mips64.cpp:42
lldb_private::RegisterContext::ReadRegister
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:343
Module.h
dwarf_r17
@ dwarf_r17
Definition: ABISysV_mips64.cpp:56
lldb_private::RegisterContext::ReadRegisterAsUnsigned
uint64_t ReadRegisterAsUnsigned(uint32_t reg, uint64_t fail_value)
Definition: RegisterContext.cpp:188
lldb_private::ArchSpec::GetFlags
uint32_t GetFlags() const
Definition: ArchSpec.h:525
dwarf_sr
@ dwarf_sr
Definition: ABISysV_mips64.cpp:71
lldb_private::CompilerType::GetByteSize
llvm::Optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
Definition: CompilerType.cpp:489
lldb_private::UnwindPlan::SetUnwindPlanForSignalTrap
void SetUnwindPlanForSignalTrap(lldb_private::LazyBool is_for_signal_trap)
Definition: UnwindPlan.h:502
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
RegisterValue.h
lldb_private::ValueList
Definition: Value.h:157
dwarf_regnums
dwarf_regnums
Definition: ABISysV_mips.cpp:38
StackFrame.h
ValueObjectMemory.h
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:455
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::CompilerType::IsFloatingPointType
bool IsFloatingPointType(uint32_t &count, bool &is_complex) const
Definition: CompilerType.cpp:191
lldb_private::Target
Definition: Target.h:473
lldb_private::UnwindPlan::SetSourceName
void SetSourceName(const char *)
Definition: UnwindPlan.cpp:564
lldb_private::DataExtractor::GetU64
uint64_t GetU64(lldb::offset_t *offset_ptr) const
Extract a uint64_t value from *offset_ptr.
Definition: DataExtractor.cpp:474
lldb_private::DataExtractor::SetData
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
Definition: DataExtractor.cpp:223
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
LLDB_REGNUM_GENERIC_ARG6
#define LLDB_REGNUM_GENERIC_ARG6
Definition: lldb-defines.h:66
dwarf_r24
@ dwarf_r24
Definition: ABISysV_mips64.cpp:63
dwarf_r29
@ dwarf_r29
Definition: ABISysV_mips64.cpp:68
ABISysV_mips64::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABISysV_mips64.cpp:515
k_num_register_infos
static const uint32_t k_num_register_infos
Definition: ABISysV_mips64.cpp:506
Process.h
lldb_private::CompilerType::IsIntegerOrEnumerationType
bool IsIntegerOrEnumerationType(bool &is_signed) const
Definition: CompilerType.cpp:153
lldb_private::Value::SetCompilerType
void SetCompilerType(const CompilerType &compiler_type)
Definition: Value.cpp:251
dwarf_r19
@ dwarf_r19
Definition: ABISysV_mips64.cpp:58
Target.h
lldb_private::Value::GetScalar
const Scalar & GetScalar() const
Definition: Value.h:112
lldb_private::ArchSpec::eMIPS_ABI_FP_mask
@ eMIPS_ABI_FP_mask
Definition: ArchSpec.h:86
LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:55
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
ABISysV_mips64::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_mips64.cpp:1116
ABISysV_mips64::Terminate
static void Terminate()
Definition: ABISysV_mips64.cpp:1163
lldb_private::DataExtractor
Definition: DataExtractor.h:48
ABISysV_mips64::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABISysV_mips64.cpp:618
Log.h
lldb_private::UnwindPlan::SetReturnAddressRegister
void SetReturnAddressRegister(uint32_t regnum)
Definition: UnwindPlan.h:439
dwarf_r4
@ dwarf_r4
Definition: ABISysV_mips64.cpp:43
lldb_private::Thread
Definition: Thread.h:61
lldb_private::Status::Fail
bool Fail() const
Test for error condition.
Definition: Status.cpp:181
g_register_infos_mips64
static const RegisterInfo g_register_infos_mips64[]
Definition: ABISysV_mips64.cpp:79
lldb_private::ArchSpec::eMIPS_ABI_FP_SOFT
@ eMIPS_ABI_FP_SOFT
Definition: ArchSpec.h:81
ABISysV_mips64::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Definition: ABISysV_mips64.cpp:699
lldb_private::DataExtractor::GetDouble
double GetDouble(lldb::offset_t *offset_ptr) const
Definition: DataExtractor.cpp:626
lldb_private::RegisterValue::GetData
bool GetData(DataExtractor &data) const
Definition: RegisterValue.cpp:34
dwarf_r23
@ dwarf_r23
Definition: ABISysV_mips64.cpp:62
dwarf_r20
@ dwarf_r20
Definition: ABISysV_mips64.cpp:59
dwarf_r14
@ dwarf_r14
Definition: ABISysV_mips64.cpp:53
lldb_private::RegisterContext::GetRegisterInfo
const RegisterInfo * GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num)
Definition: RegisterContext.cpp:80
lldb_private::UnwindPlan::SetSourcedFromCompiler
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
Definition: UnwindPlan.h:478
ValueObjectRegister.h
lldb::eEncodingUint
@ eEncodingUint
unsigned integer
Definition: lldb-enumerations.h:148
lldb_private::ConstString
Definition: ConstString.h:40
dwarf_r21
@ dwarf_r21
Definition: ABISysV_mips64.cpp:60
lldb_private::StreamString
Definition: StreamString.h:23
dwarf_r16
@ dwarf_r16
Definition: ABISysV_mips64.cpp:55
dwarf_r2
@ dwarf_r2
Definition: ABISysV_mips64.cpp:41
ABISysV_mips64
Definition: ABISysV_mips64.h:15
sp
@ sp
Definition: CompactUnwindInfo.cpp:1250
ABISysV_mips64::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABISysV_mips64.cpp:1135
lldb_private::CompilerType::GetNumFields
uint32_t GetNumFields() const
Definition: CompilerType.cpp:537
dwarf_r26
@ dwarf_r26
Definition: ABISysV_mips64.cpp:65
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
dwarf_r8
@ dwarf_r8
Definition: ABISysV_mips64.cpp:47
lldb_private::DataExtractor::GetFloat
float GetFloat(lldb::offset_t *offset_ptr) const
Extract a float from *offset_ptr.
Definition: DataExtractor.cpp:622
dwarf_r9
@ dwarf_r9
Definition: ABISysV_mips64.cpp:48
Thread.h
dwarf_hi
@ dwarf_hi
Definition: ABISysV_mips64.cpp:73
UnwindPlan.h
lldb_private::RegisterContext
Definition: RegisterContext.h:17
ABISysV_mips64::PrepareTrivialCall
bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const override
Definition: ABISysV_mips64.cpp:527
lldb_private::ArchSpec::GetAddressByteSize
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:684
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
ValueObjectConstResult.h
lldb_private::UnwindPlan::RowSP
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:395
ABISysV_mips64.h
ABISysV_mips64::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABISysV_mips64.cpp:623
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:989
lldb_private::UnwindPlan::Clear
void Clear()
Definition: UnwindPlan.h:508
lldb_private::Status
Definition: Status.h:44
lldb_private::RegisterContext::WriteRegisterFromUnsigned
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
Definition: RegisterContext.cpp:205
lldb_private::UnwindPlan::Row
Definition: UnwindPlan.h:55
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::Address
Definition: Address.h:59
dwarf_r27
@ dwarf_r27
Definition: ABISysV_mips64.cpp:66
LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:52
lldb_private::CompilerType::IsPointerType
bool IsPointerType(CompilerType *pointee_type=nullptr) const
Definition: CompilerType.cpp:157
lldb_private::DataExtractor::GetMaxU64
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
Definition: DataExtractor.cpp:524
lldb_private::RegisterValue::GetAsMemoryData
uint32_t GetAsMemoryData(const RegisterInfo *reg_info, void *dst, uint32_t dst_len, lldb::ByteOrder dst_byte_order, Status &error) const
Definition: RegisterValue.cpp:38
dwarf_lo
@ dwarf_lo
Definition: ABISysV_mips64.cpp:72
dwarf_r7
@ dwarf_r7
Definition: ABISysV_mips64.cpp:46
lldb_private::CompilerType::GetTypeInfo
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
Definition: CompilerType.cpp:290
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
dwarf_r31
@ dwarf_r31
Definition: ABISysV_mips64.cpp:70
uint16_t
dwarf_r22
@ dwarf_r22
Definition: ABISysV_mips64.cpp:61
PluginManager.h
dwarf_r1
@ dwarf_r1
Definition: ABISysV_mips64.cpp:40
DataExtractor.h
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
dwarf_r25
@ dwarf_r25
Definition: ABISysV_mips64.cpp:64
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
Status.h
dwarf_r15
@ dwarf_r15
Definition: ABISysV_mips64.cpp:54
LLDB_REGNUM_GENERIC_ARG4
#define LLDB_REGNUM_GENERIC_ARG4
Definition: lldb-defines.h:62
dwarf_cause
@ dwarf_cause
Definition: ABISysV_mips64.cpp:75
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::eFormatHex
@ eFormatHex
Definition: lldb-enumerations.h:169
dwarf_bad
@ dwarf_bad
Definition: ABISysV_mips64.cpp:74
LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:53
ABISysV_mips64::GetRegisterInfoArray
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
Definition: ABISysV_mips64.cpp:510
dwarf_r6
@ dwarf_r6
Definition: ABISysV_mips64.cpp:45
ABISysV_mips64::RegisterIsCalleeSaved
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
Definition: ABISysV_mips64.cpp:1143
LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:51
ConstString.h
lldb_private::DataExtractor::CopyByteOrderedData
lldb::offset_t CopyByteOrderedData(lldb::offset_t src_offset, lldb::offset_t src_len, void *dst, lldb::offset_t dst_len, lldb::ByteOrder dst_byte_order) const
Copy dst_len bytes from *offset_ptr and ensure the copied data is treated as a value that can be swap...
Definition: DataExtractor.cpp:690
dwarf_pc
@ dwarf_pc
Definition: ABISysV_mips64.cpp:76
LLDB_PLUGIN_DEFINE
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
lldb_private::Log
Definition: Log.h:115
lldb_private::CompilerType::GetFieldAtIndex
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
Definition: CompilerType.cpp:543
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:398
LLDB_REGNUM_GENERIC_ARG8
#define LLDB_REGNUM_GENERIC_ARG8
Definition: lldb-defines.h:70
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
LLDB_REGNUM_GENERIC_ARG7
#define LLDB_REGNUM_GENERIC_ARG7
Definition: lldb-defines.h:68
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:308
dwarf_r28
@ dwarf_r28
Definition: ABISysV_mips64.cpp:67
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
lldb::eByteOrderLittle
@ eByteOrderLittle
Definition: lldb-enumerations.h:142
lldb_private::DataBufferHeap
Definition: DataBufferHeap.h:30
ABISysV_mips64::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_mips64.cpp:1095
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
lldb
Definition: SBAddress.h:15
RegisterContext.h
Value.h
LLDBLog.h
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:198
lldb_private::RegisterContext::GetRegisterInfoByName
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
Definition: RegisterContext.cpp:52
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
dwarf_r10
@ dwarf_r10
Definition: ABISysV_mips64.cpp:49
lldb_private::Status::AsCString
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition: Status.cpp:130
LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_RA
Definition: lldb-defines.h:54