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