LLDB  mainline
ABISysV_ppc.cpp
Go to the documentation of this file.
1 //===-- ABISysV_ppc.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_ppc.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/Log.h"
30 #include "lldb/Utility/Status.h"
31 
32 using namespace lldb;
33 using namespace lldb_private;
34 
36 
38  dwarf_r0 = 0,
104  dwarf_xer = 101,
105  dwarf_lr = 108,
109 };
110 
111 // Note that the size and offset will be updated by platform-specific classes.
112 #define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
113  { \
114  #reg, alt, 8, 0, eEncodingUint, eFormatHex, {kind1, kind2, kind3, kind4 }, \
115  nullptr, nullptr, \
116  }
117 
118 static const RegisterInfo g_register_infos[] = {
119  // General purpose registers. eh_frame, DWARF,
120  // Generic, Process Plugin
195  {nullptr,
196  nullptr,
197  8,
198  0,
200  eFormatHex,
202  nullptr,
203  nullptr,
204  }};
205 
207  llvm::array_lengthof(g_register_infos);
208 
209 const lldb_private::RegisterInfo *
211  count = k_num_register_infos;
212  return g_register_infos;
213 }
214 
215 size_t ABISysV_ppc::GetRedZoneSize() const { return 224; }
216 
217 // Static Functions
218 
219 ABISP
220 ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
221  if (arch.GetTriple().getArch() == llvm::Triple::ppc) {
222  return ABISP(
223  new ABISysV_ppc(std::move(process_sp), MakeMCRegisterInfo(arch)));
224  }
225  return ABISP();
226 }
227 
229  addr_t func_addr, addr_t return_addr,
230  llvm::ArrayRef<addr_t> args) const {
232 
233  if (log) {
234  StreamString s;
235  s.Printf("ABISysV_ppc::PrepareTrivialCall (tid = 0x%" PRIx64
236  ", sp = 0x%" PRIx64 ", func_addr = 0x%" PRIx64
237  ", return_addr = 0x%" PRIx64,
238  thread.GetID(), (uint64_t)sp, (uint64_t)func_addr,
239  (uint64_t)return_addr);
240 
241  for (size_t i = 0; i < args.size(); ++i)
242  s.Printf(", arg%" PRIu64 " = 0x%" PRIx64, static_cast<uint64_t>(i + 1),
243  args[i]);
244  s.PutCString(")");
245  log->PutString(s.GetString());
246  }
247 
248  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
249  if (!reg_ctx)
250  return false;
251 
252  const RegisterInfo *reg_info = nullptr;
253 
254  if (args.size() > 8) // TODO handle more than 8 arguments
255  return false;
256 
257  for (size_t i = 0; i < args.size(); ++i) {
258  reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
260  LLDB_LOGF(log, "About to write arg%" PRIu64 " (0x%" PRIx64 ") into %s",
261  static_cast<uint64_t>(i + 1), args[i], reg_info->name);
262  if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
263  return false;
264  }
265 
266  // First, align the SP
267 
268  LLDB_LOGF(log, "16-byte aligning SP: 0x%" PRIx64 " to 0x%" PRIx64,
269  (uint64_t)sp, (uint64_t)(sp & ~0xfull));
270 
271  sp &= ~(0xfull); // 16-byte alignment
272 
273  sp -= 8;
274 
275  Status error;
276  const RegisterInfo *pc_reg_info =
278  const RegisterInfo *sp_reg_info =
280  ProcessSP process_sp(thread.GetProcess());
281 
282  RegisterValue reg_value;
283 
284  LLDB_LOGF(log,
285  "Pushing the return address onto the stack: 0x%" PRIx64
286  ": 0x%" PRIx64,
287  (uint64_t)sp, (uint64_t)return_addr);
288 
289  // Save return address onto the stack
290  if (!process_sp->WritePointerToMemory(sp, return_addr, error))
291  return false;
292 
293  // %r1 is set to the actual stack value.
294 
295  LLDB_LOGF(log, "Writing SP: 0x%" PRIx64, (uint64_t)sp);
296 
297  if (!reg_ctx->WriteRegisterFromUnsigned(sp_reg_info, sp))
298  return false;
299 
300  // %pc is set to the address of the called function.
301 
302  LLDB_LOGF(log, "Writing IP: 0x%" PRIx64, (uint64_t)func_addr);
303 
304  if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_info, func_addr))
305  return false;
306 
307  return true;
308 }
309 
310 static bool ReadIntegerArgument(Scalar &scalar, unsigned int bit_width,
311  bool is_signed, Thread &thread,
312  uint32_t *argument_register_ids,
313  unsigned int &current_argument_register,
314  addr_t &current_stack_argument) {
315  if (bit_width > 64)
316  return false; // Scalar can't hold large integer arguments
317 
318  if (current_argument_register < 6) {
319  scalar = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
320  argument_register_ids[current_argument_register], 0);
321  current_argument_register++;
322  if (is_signed)
323  scalar.SignExtend(bit_width);
324  } else {
325  uint32_t byte_size = (bit_width + (8 - 1)) / 8;
326  Status error;
327  if (thread.GetProcess()->ReadScalarIntegerFromMemory(
328  current_stack_argument, byte_size, is_signed, scalar, error)) {
329  current_stack_argument += byte_size;
330  return true;
331  }
332  return false;
333  }
334  return true;
335 }
336 
337 bool ABISysV_ppc::GetArgumentValues(Thread &thread, ValueList &values) const {
338  unsigned int num_values = values.GetSize();
339  unsigned int value_index;
340 
341  // Extract the register context so we can read arguments from registers
342 
343  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
344 
345  if (!reg_ctx)
346  return false;
347 
348  // Get the pointer to the first stack argument so we have a place to start
349  // when reading data
350 
351  addr_t sp = reg_ctx->GetSP(0);
352 
353  if (!sp)
354  return false;
355 
356  addr_t current_stack_argument = sp + 48; // jump over return address
357 
358  uint32_t argument_register_ids[8];
359 
360  argument_register_ids[0] =
362  ->kinds[eRegisterKindLLDB];
363  argument_register_ids[1] =
365  ->kinds[eRegisterKindLLDB];
366  argument_register_ids[2] =
368  ->kinds[eRegisterKindLLDB];
369  argument_register_ids[3] =
371  ->kinds[eRegisterKindLLDB];
372  argument_register_ids[4] =
374  ->kinds[eRegisterKindLLDB];
375  argument_register_ids[5] =
377  ->kinds[eRegisterKindLLDB];
378  argument_register_ids[6] =
380  ->kinds[eRegisterKindLLDB];
381  argument_register_ids[7] =
383  ->kinds[eRegisterKindLLDB];
384 
385  unsigned int current_argument_register = 0;
386 
387  for (value_index = 0; value_index < num_values; ++value_index) {
388  Value *value = values.GetValueAtIndex(value_index);
389 
390  if (!value)
391  return false;
392 
393  // We currently only support extracting values with Clang QualTypes. Do we
394  // care about others?
395  CompilerType compiler_type = value->GetCompilerType();
396  llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
397  if (!bit_size)
398  return false;
399  bool is_signed;
400  if (compiler_type.IsIntegerOrEnumerationType(is_signed))
401  ReadIntegerArgument(value->GetScalar(), *bit_size, is_signed, thread,
402  argument_register_ids, current_argument_register,
403  current_stack_argument);
404  else if (compiler_type.IsPointerType())
405  ReadIntegerArgument(value->GetScalar(), *bit_size, false, thread,
406  argument_register_ids, current_argument_register,
407  current_stack_argument);
408  }
409 
410  return true;
411 }
412 
413 Status ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
414  lldb::ValueObjectSP &new_value_sp) {
415  Status error;
416  if (!new_value_sp) {
417  error.SetErrorString("Empty value object for return value.");
418  return error;
419  }
420 
421  CompilerType compiler_type = new_value_sp->GetCompilerType();
422  if (!compiler_type) {
423  error.SetErrorString("Null clang type for return value.");
424  return error;
425  }
426 
427  Thread *thread = frame_sp->GetThread().get();
428 
429  bool is_signed;
430  uint32_t count;
431  bool is_complex;
432 
433  RegisterContext *reg_ctx = thread->GetRegisterContext().get();
434 
435  bool set_it_simple = false;
436  if (compiler_type.IsIntegerOrEnumerationType(is_signed) ||
437  compiler_type.IsPointerType()) {
438  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName("r3", 0);
439 
440  DataExtractor data;
441  Status data_error;
442  size_t num_bytes = new_value_sp->GetData(data, data_error);
443  if (data_error.Fail()) {
444  error.SetErrorStringWithFormat(
445  "Couldn't convert return value to raw data: %s",
446  data_error.AsCString());
447  return error;
448  }
449  lldb::offset_t offset = 0;
450  if (num_bytes <= 8) {
451  uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
452 
453  if (reg_ctx->WriteRegisterFromUnsigned(reg_info, raw_value))
454  set_it_simple = true;
455  } else {
456  error.SetErrorString("We don't support returning longer than 64 bit "
457  "integer values at present.");
458  }
459  } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
460  if (is_complex)
461  error.SetErrorString(
462  "We don't support returning complex values at present");
463  else {
464  llvm::Optional<uint64_t> bit_width =
465  compiler_type.GetBitSize(frame_sp.get());
466  if (!bit_width) {
467  error.SetErrorString("can't get type size");
468  return error;
469  }
470  if (*bit_width <= 64) {
471  DataExtractor data;
472  Status data_error;
473  size_t num_bytes = new_value_sp->GetData(data, data_error);
474  if (data_error.Fail()) {
475  error.SetErrorStringWithFormat(
476  "Couldn't convert return value to raw data: %s",
477  data_error.AsCString());
478  return error;
479  }
480 
481  unsigned char buffer[16];
482  ByteOrder byte_order = data.GetByteOrder();
483 
484  data.CopyByteOrderedData(0, num_bytes, buffer, 16, byte_order);
485  set_it_simple = true;
486  } else {
487  // FIXME - don't know how to do 80 bit long doubles yet.
488  error.SetErrorString(
489  "We don't support returning float values > 64 bits at present");
490  }
491  }
492  }
493 
494  if (!set_it_simple) {
495  // Okay we've got a structure or something that doesn't fit in a simple
496  // register. We should figure out where it really goes, but we don't
497  // support this yet.
498  error.SetErrorString("We only support setting simple integer and float "
499  "return types at present.");
500  }
501 
502  return error;
503 }
504 
506  Thread &thread, CompilerType &return_compiler_type) const {
507  ValueObjectSP return_valobj_sp;
508  Value value;
509 
510  if (!return_compiler_type)
511  return return_valobj_sp;
512 
513  // value.SetContext (Value::eContextTypeClangType, return_value_type);
514  value.SetCompilerType(return_compiler_type);
515 
516  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
517  if (!reg_ctx)
518  return return_valobj_sp;
519 
520  const uint32_t type_flags = return_compiler_type.GetTypeInfo();
521  if (type_flags & eTypeIsScalar) {
522  value.SetValueType(Value::ValueType::Scalar);
523 
524  bool success = false;
525  if (type_flags & eTypeIsInteger) {
526  // Extract the register context so we can read arguments from registers
527 
528  llvm::Optional<uint64_t> byte_size =
529  return_compiler_type.GetByteSize(&thread);
530  if (!byte_size)
531  return return_valobj_sp;
532  uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
533  reg_ctx->GetRegisterInfoByName("r3", 0), 0);
534  const bool is_signed = (type_flags & eTypeIsSigned) != 0;
535  switch (*byte_size) {
536  default:
537  break;
538 
539  case sizeof(uint64_t):
540  if (is_signed)
541  value.GetScalar() = (int64_t)(raw_value);
542  else
543  value.GetScalar() = (uint64_t)(raw_value);
544  success = true;
545  break;
546 
547  case sizeof(uint32_t):
548  if (is_signed)
549  value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);
550  else
551  value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
552  success = true;
553  break;
554 
555  case sizeof(uint16_t):
556  if (is_signed)
557  value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);
558  else
559  value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
560  success = true;
561  break;
562 
563  case sizeof(uint8_t):
564  if (is_signed)
565  value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);
566  else
567  value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
568  success = true;
569  break;
570  }
571  } else if (type_flags & eTypeIsFloat) {
572  if (type_flags & eTypeIsComplex) {
573  // Don't handle complex yet.
574  } else {
575  llvm::Optional<uint64_t> byte_size =
576  return_compiler_type.GetByteSize(&thread);
577  if (byte_size && *byte_size <= sizeof(long double)) {
578  const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
579  RegisterValue f1_value;
580  if (reg_ctx->ReadRegister(f1_info, f1_value)) {
581  DataExtractor data;
582  if (f1_value.GetData(data)) {
583  lldb::offset_t offset = 0;
584  if (*byte_size == sizeof(float)) {
585  value.GetScalar() = (float)data.GetFloat(&offset);
586  success = true;
587  } else if (*byte_size == sizeof(double)) {
588  value.GetScalar() = (double)data.GetDouble(&offset);
589  success = true;
590  }
591  }
592  }
593  }
594  }
595  }
596 
597  if (success)
598  return_valobj_sp = ValueObjectConstResult::Create(
599  thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
600  } else if (type_flags & eTypeIsPointer) {
601  unsigned r3_id =
602  reg_ctx->GetRegisterInfoByName("r3", 0)->kinds[eRegisterKindLLDB];
603  value.GetScalar() =
604  (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r3_id, 0);
605  value.SetValueType(Value::ValueType::Scalar);
606  return_valobj_sp = ValueObjectConstResult::Create(
607  thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
608  } else if (type_flags & eTypeIsVector) {
609  llvm::Optional<uint64_t> byte_size =
610  return_compiler_type.GetByteSize(&thread);
611  if (byte_size && *byte_size > 0) {
612  const RegisterInfo *altivec_reg = reg_ctx->GetRegisterInfoByName("v2", 0);
613  if (altivec_reg) {
614  if (*byte_size <= altivec_reg->byte_size) {
615  ProcessSP process_sp(thread.GetProcess());
616  if (process_sp) {
617  std::unique_ptr<DataBufferHeap> heap_data_up(
618  new DataBufferHeap(*byte_size, 0));
619  const ByteOrder byte_order = process_sp->GetByteOrder();
620  RegisterValue reg_value;
621  if (reg_ctx->ReadRegister(altivec_reg, reg_value)) {
622  Status error;
623  if (reg_value.GetAsMemoryData(
624  altivec_reg, heap_data_up->GetBytes(),
625  heap_data_up->GetByteSize(), byte_order, error)) {
626  DataExtractor data(DataBufferSP(heap_data_up.release()),
627  byte_order,
628  process_sp->GetTarget()
629  .GetArchitecture()
630  .GetAddressByteSize());
631  return_valobj_sp = ValueObjectConstResult::Create(
632  &thread, return_compiler_type, ConstString(""), data);
633  }
634  }
635  }
636  }
637  }
638  }
639  }
640 
641  return return_valobj_sp;
642 }
643 
645  Thread &thread, CompilerType &return_compiler_type) const {
646  ValueObjectSP return_valobj_sp;
647 
648  if (!return_compiler_type)
649  return return_valobj_sp;
650 
651  ExecutionContext exe_ctx(thread.shared_from_this());
652  return_valobj_sp = GetReturnValueObjectSimple(thread, return_compiler_type);
653  if (return_valobj_sp)
654  return return_valobj_sp;
655 
656  RegisterContextSP reg_ctx_sp = thread.GetRegisterContext();
657  if (!reg_ctx_sp)
658  return return_valobj_sp;
659 
660  llvm::Optional<uint64_t> bit_width = return_compiler_type.GetBitSize(&thread);
661  if (!bit_width)
662  return return_valobj_sp;
663  if (return_compiler_type.IsAggregateType()) {
664  Target *target = exe_ctx.GetTargetPtr();
665  bool is_memory = true;
666  if (*bit_width <= 128) {
667  ByteOrder target_byte_order = target->GetArchitecture().GetByteOrder();
668  DataBufferSP data_sp(new DataBufferHeap(16, 0));
669  DataExtractor return_ext(data_sp, target_byte_order,
670  target->GetArchitecture().GetAddressByteSize());
671 
672  const RegisterInfo *r3_info = reg_ctx_sp->GetRegisterInfoByName("r3", 0);
673  const RegisterInfo *rdx_info =
674  reg_ctx_sp->GetRegisterInfoByName("rdx", 0);
675 
676  RegisterValue r3_value, rdx_value;
677  reg_ctx_sp->ReadRegister(r3_info, r3_value);
678  reg_ctx_sp->ReadRegister(rdx_info, rdx_value);
679 
680  DataExtractor r3_data, rdx_data;
681 
682  r3_value.GetData(r3_data);
683  rdx_value.GetData(rdx_data);
684 
685  uint32_t integer_bytes =
686  0; // Tracks how much of the r3/rds registers we've consumed so far
687 
688  const uint32_t num_children = return_compiler_type.GetNumFields();
689 
690  // Since we are in the small struct regime, assume we are not in memory.
691  is_memory = false;
692 
693  for (uint32_t idx = 0; idx < num_children; idx++) {
694  std::string name;
695  uint64_t field_bit_offset = 0;
696  bool is_signed;
697  bool is_complex;
698  uint32_t count;
699 
700  CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
701  idx, name, &field_bit_offset, nullptr, nullptr);
702  llvm::Optional<uint64_t> field_bit_width =
703  field_compiler_type.GetBitSize(&thread);
704  if (!field_bit_width)
705  return return_valobj_sp;
706 
707  // If there are any unaligned fields, this is stored in memory.
708  if (field_bit_offset % *field_bit_width != 0) {
709  is_memory = true;
710  break;
711  }
712 
713  uint32_t field_byte_width = *field_bit_width / 8;
714  uint32_t field_byte_offset = field_bit_offset / 8;
715 
716  DataExtractor *copy_from_extractor = nullptr;
717  uint32_t copy_from_offset = 0;
718 
719  if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
720  field_compiler_type.IsPointerType()) {
721  if (integer_bytes < 8) {
722  if (integer_bytes + field_byte_width <= 8) {
723  // This is in RAX, copy from register to our result structure:
724  copy_from_extractor = &r3_data;
725  copy_from_offset = integer_bytes;
726  integer_bytes += field_byte_width;
727  } else {
728  // The next field wouldn't fit in the remaining space, so we
729  // pushed it to rdx.
730  copy_from_extractor = &rdx_data;
731  copy_from_offset = 0;
732  integer_bytes = 8 + field_byte_width;
733  }
734  } else if (integer_bytes + field_byte_width <= 16) {
735  copy_from_extractor = &rdx_data;
736  copy_from_offset = integer_bytes - 8;
737  integer_bytes += field_byte_width;
738  } else {
739  // The last field didn't fit. I can't see how that would happen
740  // w/o the overall size being greater than 16 bytes. For now,
741  // return a nullptr return value object.
742  return return_valobj_sp;
743  }
744  } else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
745  // Structs with long doubles are always passed in memory.
746  if (*field_bit_width == 128) {
747  is_memory = true;
748  break;
749  } else if (*field_bit_width == 64) {
750  copy_from_offset = 0;
751  } else if (*field_bit_width == 32) {
752  // This one is kind of complicated. If we are in an "eightbyte"
753  // with another float, we'll be stuffed into an xmm register with
754  // it. If we are in an "eightbyte" with one or more ints, then we
755  // will be stuffed into the appropriate GPR with them.
756  bool in_gpr;
757  if (field_byte_offset % 8 == 0) {
758  // We are at the beginning of one of the eightbytes, so check the
759  // next element (if any)
760  if (idx == num_children - 1)
761  in_gpr = false;
762  else {
763  uint64_t next_field_bit_offset = 0;
764  CompilerType next_field_compiler_type =
765  return_compiler_type.GetFieldAtIndex(idx + 1, name,
766  &next_field_bit_offset,
767  nullptr, nullptr);
768  if (next_field_compiler_type.IsIntegerOrEnumerationType(
769  is_signed))
770  in_gpr = true;
771  else {
772  copy_from_offset = 0;
773  in_gpr = false;
774  }
775  }
776  } else if (field_byte_offset % 4 == 0) {
777  // We are inside of an eightbyte, so see if the field before us
778  // is floating point: This could happen if somebody put padding
779  // in the structure.
780  if (idx == 0)
781  in_gpr = false;
782  else {
783  uint64_t prev_field_bit_offset = 0;
784  CompilerType prev_field_compiler_type =
785  return_compiler_type.GetFieldAtIndex(idx - 1, name,
786  &prev_field_bit_offset,
787  nullptr, nullptr);
788  if (prev_field_compiler_type.IsIntegerOrEnumerationType(
789  is_signed))
790  in_gpr = true;
791  else {
792  copy_from_offset = 4;
793  in_gpr = false;
794  }
795  }
796  } else {
797  is_memory = true;
798  continue;
799  }
800 
801  // Okay, we've figured out whether we are in GPR or XMM, now figure
802  // out which one.
803  if (in_gpr) {
804  if (integer_bytes < 8) {
805  // This is in RAX, copy from register to our result structure:
806  copy_from_extractor = &r3_data;
807  copy_from_offset = integer_bytes;
808  integer_bytes += field_byte_width;
809  } else {
810  copy_from_extractor = &rdx_data;
811  copy_from_offset = integer_bytes - 8;
812  integer_bytes += field_byte_width;
813  }
814  }
815  }
816  }
817 
818  // These two tests are just sanity checks. If I somehow get the type
819  // calculation wrong above it is better to just return nothing than to
820  // assert or crash.
821  if (!copy_from_extractor)
822  return return_valobj_sp;
823  if (copy_from_offset + field_byte_width >
824  copy_from_extractor->GetByteSize())
825  return return_valobj_sp;
826 
827  copy_from_extractor->CopyByteOrderedData(
828  copy_from_offset, field_byte_width,
829  data_sp->GetBytes() + field_byte_offset, field_byte_width,
830  target_byte_order);
831  }
832 
833  if (!is_memory) {
834  // The result is in our data buffer. Let's make a variable object out
835  // of it:
836  return_valobj_sp = ValueObjectConstResult::Create(
837  &thread, return_compiler_type, ConstString(""), return_ext);
838  }
839  }
840 
841  // FIXME: This is just taking a guess, r3 may very well no longer hold the
842  // return storage location.
843  // If we are going to do this right, when we make a new frame we should
844  // check to see if it uses a memory return, and if we are at the first
845  // instruction and if so stash away the return location. Then we would
846  // only return the memory return value if we know it is valid.
847 
848  if (is_memory) {
849  unsigned r3_id =
850  reg_ctx_sp->GetRegisterInfoByName("r3", 0)->kinds[eRegisterKindLLDB];
851  lldb::addr_t storage_addr =
852  (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r3_id,
853  0);
854  return_valobj_sp = ValueObjectMemory::Create(
855  &thread, "", Address(storage_addr, nullptr), return_compiler_type);
856  }
857  }
858 
859  return return_valobj_sp;
860 }
861 
863  unwind_plan.Clear();
864  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
865 
866  uint32_t lr_reg_num = dwarf_lr;
867  uint32_t sp_reg_num = dwarf_r1;
868  uint32_t pc_reg_num = dwarf_pc;
869 
871 
872  // Our Call Frame Address is the stack pointer value
873  row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
874 
875  // The previous PC is in the LR
876  row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
877  unwind_plan.AppendRow(row);
878 
879  // All other registers are the same.
880 
881  unwind_plan.SetSourceName("ppc at-func-entry default");
882  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
883 
884  return true;
885 }
886 
888  unwind_plan.Clear();
889  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
890 
891  uint32_t sp_reg_num = dwarf_r1;
892  uint32_t pc_reg_num = dwarf_lr;
893 
895 
896  const int32_t ptr_size = 4;
897  row->SetUnspecifiedRegistersAreUndefined(true);
898  row->GetCFAValue().SetIsRegisterDereferenced(sp_reg_num);
899 
900  row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * 1, true);
901  row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
902 
903  unwind_plan.AppendRow(row);
904  unwind_plan.SetSourceName("ppc default unwind plan");
905  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
908  unwind_plan.SetReturnAddressRegister(dwarf_lr);
909  return true;
910 }
911 
912 bool ABISysV_ppc::RegisterIsVolatile(const RegisterInfo *reg_info) {
913  return !RegisterIsCalleeSaved(reg_info);
914 }
915 
916 // See "Register Usage" in the
917 // "System V Application Binary Interface"
918 // "64-bit PowerPC ELF Application Binary Interface Supplement" current version
919 // is 1.9 released 2004 at http://refspecs.linuxfoundation.org/ELF/ppc/PPC-
920 // elf64abi-1.9.pdf
921 
922 bool ABISysV_ppc::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
923  if (reg_info) {
924  // Preserved registers are :
925  // r1,r2,r13-r31
926  // f14-f31 (not yet)
927  // v20-v31 (not yet)
928  // vrsave (not yet)
929 
930  const char *name = reg_info->name;
931  if (name[0] == 'r') {
932  if ((name[1] == '1' || name[1] == '2') && name[2] == '\0')
933  return true;
934  if (name[1] == '1' && name[2] > '2')
935  return true;
936  if ((name[1] == '2' || name[1] == '3') && name[2] != '\0')
937  return true;
938  }
939 
940  if (name[0] == 'f' && name[1] >= '0' && name[1] <= '9') {
941  if (name[3] == '1' && name[4] >= '4')
942  return true;
943  if ((name[3] == '2' || name[3] == '3') && name[4] != '\0')
944  return true;
945  }
946 
947  if (name[0] == 's' && name[1] == 'p' && name[2] == '\0') // sp
948  return true;
949  if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0') // fp
950  return true;
951  if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0') // pc
952  return true;
953  }
954  return false;
955 }
956 
958  PluginManager::RegisterPlugin(GetPluginNameStatic(),
959  "System V ABI for ppc targets", CreateInstance);
960 }
961 
963  PluginManager::UnregisterPlugin(CreateInstance);
964 }
dwarf_xer
@ dwarf_xer
Definition: ABISysV_ppc.cpp:104
dwarf_r11
@ dwarf_r11
Definition: ABISysV_ppc.cpp:49
LLDB_REGNUM_GENERIC_ARG2
#define LLDB_REGNUM_GENERIC_ARG2
Definition: lldb-defines.h:70
LLDB_REGNUM_GENERIC_ARG3
#define LLDB_REGNUM_GENERIC_ARG3
Definition: lldb-defines.h:72
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ArchSpec::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
Definition: ArchSpec.cpp:730
dwarf_f17
@ dwarf_f17
Definition: ABISysV_ppc.cpp:87
r12
@ r12
Definition: CompactUnwindInfo.cpp:705
ABISysV_ppc::Terminate
static void Terminate()
Definition: ABISysV_ppc.cpp:962
dwarf_f28
@ dwarf_f28
Definition: ABISysV_ppc.cpp:98
lldb_private::UnwindPlan::AppendRow
void AppendRow(const RowSP &row_sp)
Definition: UnwindPlan.cpp:360
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::Log::PutString
void PutString(llvm::StringRef str)
Definition: Log.cpp:119
LLDB_REGNUM_GENERIC_ARG1
#define LLDB_REGNUM_GENERIC_ARG1
Definition: lldb-defines.h:68
dwarf_r18
@ dwarf_r18
Definition: ABISysV_ppc.cpp:56
dwarf_r21
@ dwarf_r21
Definition: ABISysV_ppc.cpp:59
dwarf_f4
@ dwarf_f4
Definition: ABISysV_ppc.cpp:74
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:91
lldb_private::Scalar::SignExtend
bool SignExtend(uint32_t bit_pos)
Definition: Scalar.cpp:745
arm64_dwarf::lr
@ lr
Definition: ARM64_DWARF_Registers.h:49
lldb_private::RegisterValue
Definition: RegisterValue.h:28
dwarf_f14
@ dwarf_f14
Definition: ABISysV_ppc.cpp:84
lldb_private::UnwindPlan::SetRegisterKind
void SetRegisterKind(lldb::RegisterKind kind)
Definition: UnwindPlan.h:439
lldb::eRegisterKindDWARF
@ eRegisterKindDWARF
the register numbers seen DWARF
Definition: lldb-enumerations.h:229
dwarf_r17
@ dwarf_r17
Definition: ABISysV_ppc.cpp:55
lldb_private::Value
Definition: Value.h:38
dwarf_f31
@ dwarf_f31
Definition: ABISysV_ppc.cpp:101
lldb_private::Value::SetValueType
void SetValueType(ValueType value_type)
Definition: Value.h:89
lldb::eRegisterKindGeneric
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
Definition: lldb-enumerations.h:230
LLDB_REGNUM_GENERIC_ARG5
#define LLDB_REGNUM_GENERIC_ARG5
Definition: lldb-defines.h:76
ABISysV_ppc::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_ppc.cpp:887
lldb_private::ValueList::GetValueAtIndex
Value * GetValueAtIndex(size_t idx)
Definition: Value.cpp:679
r10
@ r10
Definition: CompactUnwindInfo.cpp:703
lldb_private::UnwindPlan::SetUnwindPlanValidAtAllInstructions
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
Definition: UnwindPlan.h:492
lldb_private::RegisterContext::ReadRegister
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
lldb_private::Scalar
Definition: Scalar.h:34
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
Module.h
dwarf_cr
@ dwarf_cr
Definition: ABISysV_ppc.cpp:102
dwarf_f5
@ dwarf_f5
Definition: ABISysV_ppc.cpp:75
dwarf_r25
@ dwarf_r25
Definition: ABISysV_ppc.cpp:63
dwarf_r12
@ dwarf_r12
Definition: ABISysV_ppc.cpp:50
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:504
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
RegisterValue.h
dwarf_r20
@ dwarf_r20
Definition: ABISysV_ppc.cpp:58
lldb_private::ValueList
Definition: Value.h:157
dwarf_regnums
dwarf_regnums
Definition: ABISysV_mips.cpp:37
StackFrame.h
ValueObjectMemory.h
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:444
lldb_private::CompilerType::IsAggregateType
bool IsAggregateType() const
Definition: CompilerType.cpp:31
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
pc
@ pc
Definition: CompactUnwindInfo.cpp:1250
dwarf_r3
@ dwarf_r3
Definition: ABISysV_ppc.cpp:41
ABISysV_ppc::GetRegisterInfoArray
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
Definition: ABISysV_ppc.cpp:210
ReadIntegerArgument
static bool ReadIntegerArgument(Scalar &scalar, unsigned int bit_width, bool is_signed, Thread &thread, uint32_t *argument_register_ids, unsigned int &current_argument_register, addr_t &current_stack_argument)
Definition: ABISysV_ppc.cpp:310
dwarf_r4
@ dwarf_r4
Definition: ABISysV_ppc.cpp:42
ABISysV_ppc.h
lldb_private::Target
Definition: Target.h:451
lldb_private::UnwindPlan::SetSourceName
void SetSourceName(const char *)
Definition: UnwindPlan.cpp:562
lldb_private::ValueList::GetSize
size_t GetSize()
Definition: Value.cpp:677
dwarf_f22
@ dwarf_f22
Definition: ABISysV_ppc.cpp:92
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:78
Process.h
ABISysV_ppc::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_ppc.cpp:228
dwarf_f11
@ dwarf_f11
Definition: ABISysV_ppc.cpp:81
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:254
Target.h
lldb_private::Value::GetScalar
const Scalar & GetScalar() const
Definition: Value.h:112
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:152
LIBLLDB_LOG_EXPRESSIONS
#define LIBLLDB_LOG_EXPRESSIONS
Definition: Logging.h:22
LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:67
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
r8
@ r8
Definition: CompactUnwindInfo.cpp:701
dwarf_r2
@ dwarf_r2
Definition: ABISysV_ppc.cpp:40
dwarf_r23
@ dwarf_r23
Definition: ABISysV_ppc.cpp:61
lldb::eRegisterKindLLDB
@ eRegisterKindLLDB
lldb's internal register numbers
Definition: lldb-enumerations.h:234
lldb_private::DataExtractor
Definition: DataExtractor.h:48
Log.h
dwarf_r29
@ dwarf_r29
Definition: ABISysV_ppc.cpp:67
ABISysV_ppc::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABISysV_ppc.cpp:215
dwarf_r31
@ dwarf_r31
Definition: ABISysV_ppc.cpp:69
lldb_private::UnwindPlan::SetReturnAddressRegister
void SetReturnAddressRegister(uint32_t regnum)
Definition: UnwindPlan.h:441
dwarf_r16
@ dwarf_r16
Definition: ABISysV_ppc.cpp:54
lldb_private::Thread
Definition: Thread.h:60
dwarf_r14
@ dwarf_r14
Definition: ABISysV_ppc.cpp:52
lldb_private::Status::Fail
bool Fail() const
Test for error condition.
Definition: Status.cpp:182
ABISysV_ppc::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABISysV_ppc.cpp:220
k_num_register_infos
static const uint32_t k_num_register_infos
Definition: ABISysV_ppc.cpp:206
dwarf_r19
@ dwarf_r19
Definition: ABISysV_ppc.cpp:57
dwarf_cfa
@ dwarf_cfa
Definition: ABISysV_ppc.cpp:108
lldb_private::DataExtractor::GetDouble
double GetDouble(lldb::offset_t *offset_ptr) const
Definition: DataExtractor.cpp:628
ABISysV_ppc::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_ppc.cpp:862
lldb_private::RegisterValue::GetData
bool GetData(DataExtractor &data) const
Definition: RegisterValue.cpp:34
ABISysV_ppc::Initialize
static void Initialize()
Definition: ABISysV_ppc.cpp:957
r11
@ r11
Definition: CompactUnwindInfo.cpp:704
r14
@ r14
Definition: CompactUnwindInfo.cpp:707
lldb_private::RegisterContext::GetRegisterInfo
const RegisterInfo * GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num)
Definition: RegisterContext.cpp:80
g_register_infos
static const RegisterInfo g_register_infos[]
Definition: ABISysV_ppc.cpp:118
lldb_private::UnwindPlan::SetSourcedFromCompiler
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
Definition: UnwindPlan.h:480
lldb_private::DataExtractor::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
Definition: DataExtractor.h:594
ValueObjectRegister.h
lldb::eEncodingUint
@ eEncodingUint
unsigned integer
Definition: lldb-enumerations.h:148
lldb_private::ConstString
Definition: ConstString.h:40
dwarf_f12
@ dwarf_f12
Definition: ABISysV_ppc.cpp:82
lldb_private::StreamString
Definition: StreamString.h:23
dwarf_f8
@ dwarf_f8
Definition: ABISysV_ppc.cpp:78
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
dwarf_r22
@ dwarf_r22
Definition: ABISysV_ppc.cpp:60
dwarf_r1
@ dwarf_r1
Definition: ABISysV_ppc.cpp:39
dwarf_r0
@ dwarf_r0
Definition: ABISysV_ppc.cpp:38
dwarf_f27
@ dwarf_f27
Definition: ABISysV_ppc.cpp:97
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
dwarf_f30
@ dwarf_f30
Definition: ABISysV_ppc.cpp:100
dwarf_r27
@ dwarf_r27
Definition: ABISysV_ppc.cpp:65
lldb_private::CompilerType::GetNumFields
uint32_t GetNumFields() const
Definition: CompilerType.cpp:537
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
dwarf_r9
@ dwarf_r9
Definition: ABISysV_ppc.cpp:47
dwarf_lr
@ dwarf_lr
Definition: ABISysV_ppc.cpp:105
lldb_private::DataExtractor::GetFloat
float GetFloat(lldb::offset_t *offset_ptr) const
Extract a float from *offset_ptr.
Definition: DataExtractor.cpp:624
ABISysV_ppc::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABISysV_ppc.cpp:337
Thread.h
dwarf_r7
@ dwarf_r7
Definition: ABISysV_ppc.cpp:45
dwarf_r10
@ dwarf_r10
Definition: ABISysV_ppc.cpp:48
UnwindPlan.h
lldb_private::RegisterContext::GetSP
uint64_t GetSP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
Definition: RegisterContext.cpp:152
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb_private::ArchSpec::GetAddressByteSize
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:683
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
dwarf_r6
@ dwarf_r6
Definition: ABISysV_ppc.cpp:44
dwarf_pc
@ dwarf_pc
Definition: ABISysV_ppc.cpp:107
ValueObjectConstResult.h
lldb_private::UnwindPlan::RowSP
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:395
dwarf_r30
@ dwarf_r30
Definition: ABISysV_ppc.cpp:68
dwarf_r5
@ dwarf_r5
Definition: ABISysV_ppc.cpp:43
dwarf_f0
@ dwarf_f0
Definition: ABISysV_ppc.cpp:70
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:967
dwarf_f21
@ dwarf_f21
Definition: ABISysV_ppc.cpp:91
lldb_private::UnwindPlan::Clear
void Clear()
Definition: UnwindPlan.h:510
lldb_private::Status
Definition: Status.h:44
lldb_private::RegisterContext::WriteRegisterFromUnsigned
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
Definition: RegisterContext.cpp:205
dwarf_f2
@ dwarf_f2
Definition: ABISysV_ppc.cpp:72
lldb_private::UnwindPlan::Row
Definition: UnwindPlan.h:55
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
dwarf_f24
@ dwarf_f24
Definition: ABISysV_ppc.cpp:94
dwarf_f20
@ dwarf_f20
Definition: ABISysV_ppc.cpp:90
lldb_private::Address
Definition: Address.h:59
LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:64
dwarf_r28
@ dwarf_r28
Definition: ABISysV_ppc.cpp:66
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:526
lldb_private::CompilerType::IsPointerType
bool IsPointerType(CompilerType *pointee_type=nullptr) const
Definition: CompilerType.cpp:157
dwarf_f10
@ dwarf_f10
Definition: ABISysV_ppc.cpp:80
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_f25
@ dwarf_f25
Definition: ABISysV_ppc.cpp:95
dwarf_f13
@ dwarf_f13
Definition: ABISysV_ppc.cpp:83
dwarf_f15
@ dwarf_f15
Definition: ABISysV_ppc.cpp:85
dwarf_f23
@ dwarf_f23
Definition: ABISysV_ppc.cpp:93
lldb_private::CompilerType::GetBitSize
llvm::Optional< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
Definition: CompilerType.cpp:482
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:31
ABISysV_ppc::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABISysV_ppc.cpp:912
uint16_t
dwarf_f29
@ dwarf_f29
Definition: ABISysV_ppc.cpp:99
PluginManager.h
dwarf_r13
@ dwarf_r13
Definition: ABISysV_ppc.cpp:51
ABISysV_ppc::GetReturnValueObjectSimple
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
Definition: ABISysV_ppc.cpp:505
dwarf_f18
@ dwarf_f18
Definition: ABISysV_ppc.cpp:88
DataExtractor.h
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb_private::Value::GetCompilerType
const CompilerType & GetCompilerType()
Definition: Value.cpp:225
Status.h
LLDB_REGNUM_GENERIC_ARG4
#define LLDB_REGNUM_GENERIC_ARG4
Definition: lldb-defines.h:74
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_f19
@ dwarf_f19
Definition: ABISysV_ppc.cpp:89
dwarf_f16
@ dwarf_f16
Definition: ABISysV_ppc.cpp:86
dwarf_r8
@ dwarf_r8
Definition: ABISysV_ppc.cpp:46
r15
@ r15
Definition: CompactUnwindInfo.cpp:708
dwarf_f9
@ dwarf_f9
Definition: ABISysV_ppc.cpp:79
dwarf_f1
@ dwarf_f1
Definition: ABISysV_ppc.cpp:71
LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:63
DEFINE_GPR
#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4)
Definition: ABISysV_ppc.cpp:112
dwarf_ctr
@ dwarf_ctr
Definition: ABISysV_ppc.cpp:106
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:692
ABISysV_ppc::RegisterIsCalleeSaved
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
Definition: ABISysV_ppc.cpp:922
ABISysV_ppc
Definition: ABISysV_ppc.h:15
dwarf_f6
@ dwarf_f6
Definition: ABISysV_ppc.cpp:76
LLDB_PLUGIN_DEFINE
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
lldb_private::Log
Definition: Log.h:49
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:397
LLDB_REGNUM_GENERIC_ARG8
#define LLDB_REGNUM_GENERIC_ARG8
Definition: lldb-defines.h:82
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
LLDB_REGNUM_GENERIC_ARG7
#define LLDB_REGNUM_GENERIC_ARG7
Definition: lldb-defines.h:80
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
dwarf_f26
@ dwarf_f26
Definition: ABISysV_ppc.cpp:96
lldb_private::DataBufferHeap
Definition: DataBufferHeap.h:30
dwarf_r26
@ dwarf_r26
Definition: ABISysV_ppc.cpp:64
r9
@ r9
Definition: CompactUnwindInfo.cpp:702
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
ABISysV_ppc::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABISysV_ppc.cpp:413
lldb
Definition: SBAddress.h:15
RegisterContext.h
Value.h
dwarf_r15
@ dwarf_r15
Definition: ABISysV_ppc.cpp:53
dwarf_r24
@ dwarf_r24
Definition: ABISysV_ppc.cpp:62
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:200
dwarf_fpscr
@ dwarf_fpscr
Definition: ABISysV_ppc.cpp:103
dwarf_f3
@ dwarf_f3
Definition: ABISysV_ppc.cpp:73
lldb_private::RegisterContext::GetRegisterInfoByName
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
Definition: RegisterContext.cpp:52
ABISysV_ppc::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Definition: ABISysV_ppc.cpp:644
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
dwarf_f7
@ dwarf_f7
Definition: ABISysV_ppc.cpp:77
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:131
r13
@ r13
Definition: CompactUnwindInfo.cpp:706
LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_RA
Definition: lldb-defines.h:66