LLDB  mainline
ABIWindows_x86_64.cpp
Go to the documentation of this file.
1 //===-- ABIWindows_x86_64.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 "ABIWindows_x86_64.h"
10 
11 #include "llvm/ADT/STLExtras.h"
12 #include "llvm/ADT/StringSwitch.h"
13 #include "llvm/ADT/Triple.h"
14 
15 #include "lldb/Core/Module.h"
17 #include "lldb/Core/Value.h"
21 #include "lldb/Symbol/UnwindPlan.h"
22 #include "lldb/Target/Process.h"
24 #include "lldb/Target/StackFrame.h"
25 #include "lldb/Target/Target.h"
26 #include "lldb/Target/Thread.h"
29 #include "lldb/Utility/LLDBLog.h"
30 #include "lldb/Utility/Log.h"
32 #include "lldb/Utility/Status.h"
33 
34 using namespace lldb;
35 using namespace lldb_private;
36 
38 
40  dwarf_rax = 0,
97  dwarf_bnd0 = 126,
101 };
102 
104  name = "rax";
105  return true;
106 }
107 
108 size_t ABIWindows_x86_64::GetRedZoneSize() const { return 0; }
109 
110 //------------------------------------------------------------------
111 // Static Functions
112 //------------------------------------------------------------------
113 
114 ABISP
115 ABIWindows_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
116  if (arch.GetTriple().getArch() == llvm::Triple::x86_64 &&
117  arch.GetTriple().isOSWindows()) {
118  return ABISP(
119  new ABIWindows_x86_64(std::move(process_sp), MakeMCRegisterInfo(arch)));
120  }
121  return ABISP();
122 }
123 
125  addr_t func_addr, addr_t return_addr,
126  llvm::ArrayRef<addr_t> args) const {
127  Log *log = GetLog(LLDBLog::Expressions);
128 
129  if (log) {
130  StreamString s;
131  s.Printf("ABIWindows_x86_64::PrepareTrivialCall (tid = 0x%" PRIx64
132  ", sp = 0x%" PRIx64 ", func_addr = 0x%" PRIx64
133  ", return_addr = 0x%" PRIx64,
134  thread.GetID(), (uint64_t)sp, (uint64_t)func_addr,
135  (uint64_t)return_addr);
136 
137  for (size_t i = 0; i < args.size(); ++i)
138  s.Printf(", arg%" PRIu64 " = 0x%" PRIx64, static_cast<uint64_t>(i + 1),
139  args[i]);
140  s.PutCString(")");
141  log->PutString(s.GetString());
142  }
143 
144  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
145  if (!reg_ctx)
146  return false;
147 
148  const RegisterInfo *reg_info = nullptr;
149 
150  if (args.size() > 4) // Windows x64 only put first 4 arguments into registers
151  return false;
152 
153  for (size_t i = 0; i < args.size(); ++i) {
154  reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
156  LLDB_LOGF(log, "About to write arg%" PRIu64 " (0x%" PRIx64 ") into %s",
157  static_cast<uint64_t>(i + 1), args[i], reg_info->name);
158  if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
159  return false;
160  }
161 
162  // First, align the SP
163 
164  LLDB_LOGF(log, "16-byte aligning SP: 0x%" PRIx64 " to 0x%" PRIx64,
165  (uint64_t)sp, (uint64_t)(sp & ~0xfull));
166 
167  sp &= ~(0xfull); // 16-byte alignment
168 
169  sp -= 8; // return address
170 
171  Status error;
172  const RegisterInfo *pc_reg_info =
174  const RegisterInfo *sp_reg_info =
176  ProcessSP process_sp(thread.GetProcess());
177 
178  RegisterValue reg_value;
179  LLDB_LOGF(log,
180  "Pushing the return address onto the stack: 0x%" PRIx64
181  ": 0x%" PRIx64,
182  (uint64_t)sp, (uint64_t)return_addr);
183 
184  // Save return address onto the stack
185  if (!process_sp->WritePointerToMemory(sp, return_addr, error))
186  return false;
187 
188  // %rsp is set to the actual stack value.
189 
190  LLDB_LOGF(log, "Writing SP: 0x%" PRIx64, (uint64_t)sp);
191 
192  if (!reg_ctx->WriteRegisterFromUnsigned(sp_reg_info, sp))
193  return false;
194 
195  // %rip is set to the address of the called function.
196 
197  LLDB_LOGF(log, "Writing IP: 0x%" PRIx64, (uint64_t)func_addr);
198 
199  if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_info, func_addr))
200  return false;
201 
202  return true;
203 }
204 
205 static bool ReadIntegerArgument(Scalar &scalar, unsigned int bit_width,
206  bool is_signed, Thread &thread,
207  uint32_t *argument_register_ids,
208  unsigned int &current_argument_register,
209  addr_t &current_stack_argument) {
210  if (bit_width > 64)
211  return false; // Scalar can't hold large integer arguments
212 
213  if (current_argument_register < 4) { // Windows pass first 4 arguments to register
214  scalar = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
215  argument_register_ids[current_argument_register], 0);
216  current_argument_register++;
217  if (is_signed)
218  scalar.SignExtend(bit_width);
219  return true;
220  }
221  uint32_t byte_size = (bit_width + (CHAR_BIT - 1)) / CHAR_BIT;
222  Status error;
223  if (thread.GetProcess()->ReadScalarIntegerFromMemory(
224  current_stack_argument, byte_size, is_signed, scalar, error)) {
225  current_stack_argument += byte_size;
226  return true;
227  }
228  return false;
229 }
230 
232  ValueList &values) const {
233  unsigned int num_values = values.GetSize();
234  unsigned int value_index;
235 
236  // Extract the register context so we can read arguments from registers
237 
238  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
239 
240  if (!reg_ctx)
241  return false;
242 
243  // Get the pointer to the first stack argument so we have a place to start
244  // when reading data
245 
246  addr_t sp = reg_ctx->GetSP(0);
247 
248  if (!sp)
249  return false;
250 
251  addr_t current_stack_argument = sp + 8; // jump over return address
252 
253  uint32_t argument_register_ids[4];
254 
255  argument_register_ids[0] =
257  ->kinds[eRegisterKindLLDB];
258  argument_register_ids[1] =
260  ->kinds[eRegisterKindLLDB];
261  argument_register_ids[2] =
263  ->kinds[eRegisterKindLLDB];
264  argument_register_ids[3] =
266  ->kinds[eRegisterKindLLDB];
267 
268  unsigned int current_argument_register = 0;
269 
270  for (value_index = 0; value_index < num_values; ++value_index) {
271  Value *value = values.GetValueAtIndex(value_index);
272 
273  if (!value)
274  return false;
275 
276  CompilerType compiler_type = value->GetCompilerType();
277  llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
278  if (!bit_size)
279  return false;
280  bool is_signed;
281 
282  if (compiler_type.IsIntegerOrEnumerationType(is_signed)) {
283  ReadIntegerArgument(value->GetScalar(), *bit_size, is_signed, thread,
284  argument_register_ids, current_argument_register,
285  current_stack_argument);
286  } else if (compiler_type.IsPointerType()) {
287  ReadIntegerArgument(value->GetScalar(), *bit_size, false, thread,
288  argument_register_ids, current_argument_register,
289  current_stack_argument);
290  }
291  }
292 
293  return true;
294 }
295 
296 Status ABIWindows_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
297  lldb::ValueObjectSP &new_value_sp) {
298  Status error;
299  if (!new_value_sp) {
300  error.SetErrorString("Empty value object for return value.");
301  return error;
302  }
303 
304  CompilerType compiler_type = new_value_sp->GetCompilerType();
305  if (!compiler_type) {
306  error.SetErrorString("Null clang type for return value.");
307  return error;
308  }
309 
310  Thread *thread = frame_sp->GetThread().get();
311 
312  bool is_signed;
313  uint32_t count;
314  bool is_complex;
315 
316  RegisterContext *reg_ctx = thread->GetRegisterContext().get();
317 
318  bool set_it_simple = false;
319  if (compiler_type.IsIntegerOrEnumerationType(is_signed) ||
320  compiler_type.IsPointerType()) {
321  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName("rax", 0);
322 
323  DataExtractor data;
324  Status data_error;
325  size_t num_bytes = new_value_sp->GetData(data, data_error);
326  if (data_error.Fail()) {
327  error.SetErrorStringWithFormat(
328  "Couldn't convert return value to raw data: %s",
329  data_error.AsCString());
330  return error;
331  }
332  lldb::offset_t offset = 0;
333  if (num_bytes <= 8) {
334  uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
335 
336  if (reg_ctx->WriteRegisterFromUnsigned(reg_info, raw_value))
337  set_it_simple = true;
338  } else {
339  error.SetErrorString("We don't support returning longer than 64 bit "
340  "integer values at present.");
341  }
342  } else if (compiler_type.IsFloatingPointType(count, is_complex)) {
343  if (is_complex)
344  error.SetErrorString(
345  "We don't support returning complex values at present");
346  else {
347  llvm::Optional<uint64_t> bit_width =
348  compiler_type.GetBitSize(frame_sp.get());
349  if (!bit_width) {
350  error.SetErrorString("can't get type size");
351  return error;
352  }
353  if (*bit_width <= 64) {
354  const RegisterInfo *xmm0_info =
355  reg_ctx->GetRegisterInfoByName("xmm0", 0);
356  RegisterValue xmm0_value;
357  DataExtractor data;
358  Status data_error;
359  size_t num_bytes = new_value_sp->GetData(data, data_error);
360  if (data_error.Fail()) {
361  error.SetErrorStringWithFormat(
362  "Couldn't convert return value to raw data: %s",
363  data_error.AsCString());
364  return error;
365  }
366 
367  unsigned char buffer[16];
368  ByteOrder byte_order = data.GetByteOrder();
369 
370  data.CopyByteOrderedData(0, num_bytes, buffer, 16, byte_order);
371  xmm0_value.SetBytes(buffer, 16, byte_order);
372  reg_ctx->WriteRegister(xmm0_info, xmm0_value);
373  set_it_simple = true;
374  } else {
375  // Windows doesn't support 80 bit FP
376  error.SetErrorString(
377  "Windows-x86_64 doesn't allow FP larger than 64 bits.");
378  }
379  }
380  }
381 
382  if (!set_it_simple) {
383  // Okay we've got a structure or something that doesn't fit in a simple
384  // register.
385  // TODO(wanyi): On Windows, if the return type is a struct:
386  // 1) smaller that 64 bits and return by value -> RAX
387  // 2) bigger than 64 bits, the caller will allocate memory for that struct
388  // and pass the struct pointer in RCX then return the pointer in RAX
389  error.SetErrorString("We only support setting simple integer and float "
390  "return types at present.");
391  }
392 
393  return error;
394 }
395 
397  Thread &thread, CompilerType &return_compiler_type) const {
398  ValueObjectSP return_valobj_sp;
399  Value value;
400 
401  if (!return_compiler_type)
402  return return_valobj_sp;
403 
404  value.SetCompilerType(return_compiler_type);
405 
406  RegisterContext *reg_ctx = thread.GetRegisterContext().get();
407  if (!reg_ctx)
408  return return_valobj_sp;
409 
410  const uint32_t type_flags = return_compiler_type.GetTypeInfo();
411  if (type_flags & eTypeIsScalar) {
412  value.SetValueType(Value::ValueType::Scalar);
413 
414  bool success = false;
415  if (type_flags & eTypeIsInteger) {
416  // Extract the register context so we can read arguments from registers
417  llvm::Optional<uint64_t> byte_size =
418  return_compiler_type.GetByteSize(&thread);
419  if (!byte_size)
420  return return_valobj_sp;
421  uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
422  reg_ctx->GetRegisterInfoByName("rax", 0), 0);
423  const bool is_signed = (type_flags & eTypeIsSigned) != 0;
424  switch (*byte_size) {
425  default:
426  break;
427 
428  case sizeof(uint64_t):
429  if (is_signed)
430  value.GetScalar() = (int64_t)(raw_value);
431  else
432  value.GetScalar() = (uint64_t)(raw_value);
433  success = true;
434  break;
435 
436  case sizeof(uint32_t):
437  if (is_signed)
438  value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);
439  else
440  value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
441  success = true;
442  break;
443 
444  case sizeof(uint16_t):
445  if (is_signed)
446  value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);
447  else
448  value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
449  success = true;
450  break;
451 
452  case sizeof(uint8_t):
453  if (is_signed)
454  value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);
455  else
456  value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
457  success = true;
458  break;
459  }
460  } else if (type_flags & eTypeIsFloat) {
461  if (type_flags & eTypeIsComplex) {
462  // Don't handle complex yet.
463  } else {
464  llvm::Optional<uint64_t> byte_size =
465  return_compiler_type.GetByteSize(&thread);
466  if (byte_size && *byte_size <= sizeof(long double)) {
467  const RegisterInfo *xmm0_info =
468  reg_ctx->GetRegisterInfoByName("xmm0", 0);
469  RegisterValue xmm0_value;
470  if (reg_ctx->ReadRegister(xmm0_info, xmm0_value)) {
471  DataExtractor data;
472  if (xmm0_value.GetData(data)) {
473  lldb::offset_t offset = 0;
474  if (*byte_size == sizeof(float)) {
475  value.GetScalar() = (float)data.GetFloat(&offset);
476  success = true;
477  } else if (*byte_size == sizeof(double)) {
478  // double and long double are the same on windows
479  value.GetScalar() = (double)data.GetDouble(&offset);
480  success = true;
481  }
482  }
483  }
484  }
485  }
486  }
487 
488  if (success)
489  return_valobj_sp = ValueObjectConstResult::Create(
490  thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
491  } else if ((type_flags & eTypeIsPointer) ||
492  (type_flags & eTypeInstanceIsPointer)) {
493  unsigned rax_id =
494  reg_ctx->GetRegisterInfoByName("rax", 0)->kinds[eRegisterKindLLDB];
495  value.GetScalar() =
496  (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(rax_id,
497  0);
498  value.SetValueType(Value::ValueType::Scalar);
499  return_valobj_sp = ValueObjectConstResult::Create(
500  thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
501  } else if (type_flags & eTypeIsVector) {
502  llvm::Optional<uint64_t> byte_size =
503  return_compiler_type.GetByteSize(&thread);
504  if (byte_size && *byte_size > 0) {
505  const RegisterInfo *xmm_reg =
506  reg_ctx->GetRegisterInfoByName("xmm0", 0);
507  if (xmm_reg == nullptr)
508  xmm_reg = reg_ctx->GetRegisterInfoByName("mm0", 0);
509 
510  if (xmm_reg) {
511  if (*byte_size <= xmm_reg->byte_size) {
512  ProcessSP process_sp(thread.GetProcess());
513  if (process_sp) {
514  std::unique_ptr<DataBufferHeap> heap_data_up(
515  new DataBufferHeap(*byte_size, 0));
516  const ByteOrder byte_order = process_sp->GetByteOrder();
517  RegisterValue reg_value;
518  if (reg_ctx->ReadRegister(xmm_reg, reg_value)) {
519  Status error;
520  if (reg_value.GetAsMemoryData(
521  xmm_reg, heap_data_up->GetBytes(),
522  heap_data_up->GetByteSize(), byte_order, error)) {
523  DataExtractor data(DataBufferSP(heap_data_up.release()),
524  byte_order,
525  process_sp->GetTarget()
526  .GetArchitecture()
527  .GetAddressByteSize());
528  return_valobj_sp = ValueObjectConstResult::Create(
529  &thread, return_compiler_type, ConstString(""), data);
530  }
531  }
532  }
533  }
534  }
535  }
536  }
537 
538  return return_valobj_sp;
539 }
540 
541 // The compiler will flatten the nested aggregate type into single
542 // layer and push the value to stack
543 // This helper function will flatten an aggregate type
544 // and return true if it can be returned in register(s) by value
545 // return false if the aggregate is in memory
547  Thread &thread, ExecutionContext &exe_ctx,
548  CompilerType &return_compiler_type,
549  uint32_t data_byte_offset,
550  std::vector<uint32_t> &aggregate_field_offsets,
551  std::vector<CompilerType> &aggregate_compiler_types) {
552 
553  const uint32_t num_children = return_compiler_type.GetNumFields();
554  for (uint32_t idx = 0; idx < num_children; ++idx) {
555  std::string name;
556  bool is_signed;
557  uint32_t count;
558  bool is_complex;
559 
560  uint64_t field_bit_offset = 0;
561  CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
562  idx, name, &field_bit_offset, nullptr, nullptr);
563  llvm::Optional<uint64_t> field_bit_width =
564  field_compiler_type.GetBitSize(&thread);
565 
566  // if we don't know the size of the field (e.g. invalid type), exit
567  if (!field_bit_width || *field_bit_width == 0) {
568  return false;
569  }
570  // If there are any unaligned fields, this is stored in memory.
571  if (field_bit_offset % *field_bit_width != 0) {
572  return false;
573  }
574 
575  // add overall offset
576  uint32_t field_byte_offset = field_bit_offset / 8 + data_byte_offset;
577 
578  const uint32_t field_type_flags = field_compiler_type.GetTypeInfo();
579  if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
580  field_compiler_type.IsPointerType() ||
581  field_compiler_type.IsFloatingPointType(count, is_complex)) {
582  aggregate_field_offsets.push_back(field_byte_offset);
583  aggregate_compiler_types.push_back(field_compiler_type);
584  } else if (field_type_flags & eTypeHasChildren) {
585  if (!FlattenAggregateType(thread, exe_ctx, field_compiler_type,
586  field_byte_offset, aggregate_field_offsets,
587  aggregate_compiler_types)) {
588  return false;
589  }
590  }
591  }
592  return true;
593 }
594 
596  Thread &thread, CompilerType &return_compiler_type) const {
597  ValueObjectSP return_valobj_sp;
598 
599  if (!return_compiler_type) {
600  return return_valobj_sp;
601  }
602 
603  // try extract value as if it's a simple type
604  return_valobj_sp = GetReturnValueObjectSimple(thread, return_compiler_type);
605  if (return_valobj_sp) {
606  return return_valobj_sp;
607  }
608 
609  RegisterContextSP reg_ctx_sp = thread.GetRegisterContext();
610  if (!reg_ctx_sp) {
611  return return_valobj_sp;
612  }
613 
614  llvm::Optional<uint64_t> bit_width = return_compiler_type.GetBitSize(&thread);
615  if (!bit_width) {
616  return return_valobj_sp;
617  }
618 
619  // if it's not simple or aggregate type, then we don't know how to handle it
620  if (!return_compiler_type.IsAggregateType()) {
621  return return_valobj_sp;
622  }
623 
624  ExecutionContext exe_ctx(thread.shared_from_this());
625  Target *target = exe_ctx.GetTargetPtr();
626  uint32_t max_register_value_bit_width = 64;
627 
628  // The scenario here is to have a struct/class which is POD
629  // if the return struct/class size is larger than 64 bits,
630  // the caller will allocate memory for it and pass the return addr in RCX
631  // then return the address in RAX
632 
633  // if the struct is returned by value in register (RAX)
634  // its size has to be: 1, 2, 4, 8, 16, 32, or 64 bits (aligned)
635  // for floating point, the return value will be copied over to RAX
636  bool is_memory = *bit_width > max_register_value_bit_width ||
637  *bit_width & (*bit_width - 1);
638  std::vector<uint32_t> aggregate_field_offsets;
639  std::vector<CompilerType> aggregate_compiler_types;
640  if (!is_memory &&
641  FlattenAggregateType(thread, exe_ctx, return_compiler_type,
642  0, aggregate_field_offsets,
643  aggregate_compiler_types)) {
644  ByteOrder byte_order = target->GetArchitecture().GetByteOrder();
645  WritableDataBufferSP data_sp(
646  new DataBufferHeap(max_register_value_bit_width / 8, 0));
647  DataExtractor return_ext(data_sp, byte_order,
648  target->GetArchitecture().GetAddressByteSize());
649 
650  // The only register used to return struct/class by value
651  const RegisterInfo *rax_info =
652  reg_ctx_sp->GetRegisterInfoByName("rax", 0);
653  RegisterValue rax_value;
654  reg_ctx_sp->ReadRegister(rax_info, rax_value);
655  DataExtractor rax_data;
656  rax_value.GetData(rax_data);
657 
658  uint32_t used_bytes =
659  0; // Tracks how much of the rax registers we've consumed so far
660 
661  // in case of the returned type is a subclass of non-abstract-base class
662  // it will have a padding to skip the base content
663  if (aggregate_field_offsets.size())
664  used_bytes = aggregate_field_offsets[0];
665 
666  const uint32_t num_children = aggregate_compiler_types.size();
667  for (uint32_t idx = 0; idx < num_children; idx++) {
668  bool is_signed;
669  bool is_complex;
670  uint32_t count;
671 
672  CompilerType field_compiler_type = aggregate_compiler_types[idx];
673  uint32_t field_byte_width = (uint32_t) (*field_compiler_type.GetByteSize(&thread));
674  uint32_t field_byte_offset = aggregate_field_offsets[idx];
675 
676  // this is unlikely w/o the overall size being greater than 8 bytes
677  // For now, return a nullptr return value object.
678  if (used_bytes >= 8 || used_bytes + field_byte_width > 8) {
679  return return_valobj_sp;
680  }
681 
682  DataExtractor *copy_from_extractor = nullptr;
683  uint32_t copy_from_offset = 0;
684  if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
685  field_compiler_type.IsPointerType() ||
686  field_compiler_type.IsFloatingPointType(count, is_complex)) {
687  copy_from_extractor = &rax_data;
688  copy_from_offset = used_bytes;
689  used_bytes += field_byte_width;
690  }
691  // These two tests are just sanity checks. If I somehow get the type
692  // calculation wrong above it is better to just return nothing than to
693  // assert or crash.
694  if (!copy_from_extractor) {
695  return return_valobj_sp;
696  }
697  if (copy_from_offset + field_byte_width >
698  copy_from_extractor->GetByteSize()) {
699  return return_valobj_sp;
700  }
701  copy_from_extractor->CopyByteOrderedData(copy_from_offset,
702  field_byte_width, data_sp->GetBytes() + field_byte_offset,
703  field_byte_width, byte_order);
704  }
705  if (!is_memory) {
706  // The result is in our data buffer. Let's make a variable object out
707  // of it:
708  return_valobj_sp = ValueObjectConstResult::Create(
709  &thread, return_compiler_type, ConstString(""), return_ext);
710  }
711  }
712 
713  // The Windows x86_64 ABI specifies that the return address for MEMORY
714  // objects be placed in rax on exit from the function.
715 
716  // FIXME: This is just taking a guess, rax may very well no longer hold the
717  // return storage location.
718  // If we are going to do this right, when we make a new frame we should
719  // check to see if it uses a memory return, and if we are at the first
720  // instruction and if so stash away the return location. Then we would
721  // only return the memory return value if we know it is valid.
722  if (is_memory) {
723  unsigned rax_id =
724  reg_ctx_sp->GetRegisterInfoByName("rax", 0)->kinds[eRegisterKindLLDB];
725  lldb::addr_t storage_addr =
726  (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(rax_id,
727  0);
728  return_valobj_sp = ValueObjectMemory::Create(
729  &thread, "", Address(storage_addr, nullptr), return_compiler_type);
730  }
731  return return_valobj_sp;
732 }
733 
734 // This defines the CFA as rsp+8
735 // the saved pc is at CFA-8 (i.e. rsp+0)
736 // The saved rsp is CFA+0
737 
739  unwind_plan.Clear();
740  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
741 
742  uint32_t sp_reg_num = dwarf_rsp;
743  uint32_t pc_reg_num = dwarf_rip;
744 
746  row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 8);
747  row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
748  row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
749  unwind_plan.AppendRow(row);
750  unwind_plan.SetSourceName("x86_64 at-func-entry default");
751  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
752  return true;
753 }
754 
755 // Windows-x86_64 doesn't use %rbp
756 // No available Unwind information for Windows-x86_64 (section .pdata)
757 // Let's use SysV-x86_64 one for now
759  unwind_plan.Clear();
760  unwind_plan.SetRegisterKind(eRegisterKindDWARF);
761 
762  uint32_t fp_reg_num = dwarf_rbp;
763  uint32_t sp_reg_num = dwarf_rsp;
764  uint32_t pc_reg_num = dwarf_rip;
765 
767 
768  const int32_t ptr_size = 8;
769  row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_rbp, 2 * ptr_size);
770  row->SetOffset(0);
771  row->SetUnspecifiedRegistersAreUndefined(true);
772 
773  row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
774  row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
775  row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
776 
777  unwind_plan.AppendRow(row);
778  unwind_plan.SetSourceName("x86_64 default unwind plan");
779  unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
781 
782  return true;
783 }
784 
785 bool ABIWindows_x86_64::RegisterIsVolatile(const RegisterInfo *reg_info) {
786  return !RegisterIsCalleeSaved(reg_info);
787 }
788 
789 bool ABIWindows_x86_64::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
790  if (!reg_info)
791  return false;
792  assert(reg_info->name != nullptr && "unnamed register?");
793  std::string Name = std::string(reg_info->name);
794  bool IsCalleeSaved =
795  llvm::StringSwitch<bool>(Name)
796  .Cases("rbx", "ebx", "rbp", "ebp", "rdi", "edi", "rsi", "esi", true)
797  .Cases("rsp", "esp", "r12", "r13", "r14", "r15", "sp", "fp", true)
798  .Cases("xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12",
799  "xmm13", "xmm14", "xmm15", true)
800  .Default(false);
801  return IsCalleeSaved;
802 }
803 
805  return llvm::StringSwitch<uint32_t>(reg)
806  .Case("rip", LLDB_REGNUM_GENERIC_PC)
807  .Case("rsp", LLDB_REGNUM_GENERIC_SP)
808  .Case("rbp", LLDB_REGNUM_GENERIC_FP)
809  .Case("rflags", LLDB_REGNUM_GENERIC_FLAGS)
810  // gdbserver uses eflags
811  .Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
812  .Case("rcx", LLDB_REGNUM_GENERIC_ARG1)
813  .Case("rdx", LLDB_REGNUM_GENERIC_ARG2)
814  .Case("r8", LLDB_REGNUM_GENERIC_ARG3)
815  .Case("r9", LLDB_REGNUM_GENERIC_ARG4)
816  .Default(LLDB_INVALID_REGNUM);
817 }
818 
820  PluginManager::RegisterPlugin(
821  GetPluginNameStatic(), "Windows ABI for x86_64 targets", CreateInstance);
822 }
823 
825  PluginManager::UnregisterPlugin(CreateInstance);
826 }
ABIWindows_x86_64::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABIWindows_x86_64.cpp:231
ABIWindows_x86_64::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABIWindows_x86_64.cpp:108
dwarf_r11
@ dwarf_r11
Definition: ABIWindows_x86_64.cpp:51
lldb_private::RegisterContext::WriteRegister
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
dwarf_ymm10
@ dwarf_ymm10
Definition: ABIWindows_x86_64.cpp:91
dwarf_ymm1
@ dwarf_ymm1
Definition: ABIWindows_x86_64.cpp:82
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
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_stmm1
@ dwarf_stmm1
Definition: ABIWindows_x86_64.cpp:74
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:79
ABIWindows_x86_64::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABIWindows_x86_64.cpp:785
dwarf_stmm6
@ dwarf_stmm6
Definition: ABIWindows_x86_64.cpp:79
lldb_private::Scalar::SignExtend
bool SignExtend(uint32_t bit_pos)
Definition: Scalar.cpp:745
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
dwarf_r12
@ dwarf_r12
Definition: ABIWindows_x86_64.cpp:52
ABIWindows_x86_64::GetReturnValueObjectSimple
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
Definition: ABIWindows_x86_64.cpp:396
lldb::eRegisterKindGeneric
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
Definition: lldb-enumerations.h:230
lldb_private::ValueList::GetValueAtIndex
Value * GetValueAtIndex(size_t idx)
Definition: Value.cpp:669
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
ABIWindows_x86_64::GetPointerReturnRegister
bool GetPointerReturnRegister(const char *&name) override
Definition: ABIWindows_x86_64.cpp:103
dwarf_ymm3
@ dwarf_ymm3
Definition: ABIWindows_x86_64.cpp:84
dwarf_xmm0
@ dwarf_xmm0
Definition: ABIWindows_x86_64.cpp:57
dwarf_xmm11
@ dwarf_xmm11
Definition: ABIWindows_x86_64.cpp:68
Module.h
ABIWindows_x86_64::GetGenericNum
uint32_t GetGenericNum(llvm::StringRef reg) override
Return the generic number of the given register.
Definition: ABIWindows_x86_64.cpp:804
ABIWindows_x86_64
Definition: ABIWindows_x86_64.h:14
dwarf_stmm2
@ dwarf_stmm2
Definition: ABIWindows_x86_64.cpp:75
dwarf_rsi
@ dwarf_rsi
Definition: ABIWindows_x86_64.cpp:44
dwarf_rcx
@ dwarf_rcx
Definition: ABIWindows_x86_64.cpp:42
dwarf_xmm6
@ dwarf_xmm6
Definition: ABIWindows_x86_64.cpp:63
dwarf_xmm1
@ dwarf_xmm1
Definition: ABIWindows_x86_64.cpp:58
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::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
RegisterValue.h
dwarf_xmm9
@ dwarf_xmm9
Definition: ABIWindows_x86_64.cpp:66
lldb_private::ValueList
Definition: Value.h:157
dwarf_regnums
dwarf_regnums
Definition: ABISysV_mips.cpp:38
StackFrame.h
dwarf_stmm7
@ dwarf_stmm7
Definition: ABIWindows_x86_64.cpp:80
ValueObjectMemory.h
dwarf_ymm7
@ dwarf_ymm7
Definition: ABIWindows_x86_64.cpp:88
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
dwarf_r10
@ dwarf_r10
Definition: ABIWindows_x86_64.cpp:50
dwarf_xmm15
@ dwarf_xmm15
Definition: ABIWindows_x86_64.cpp:72
dwarf_xmm8
@ dwarf_xmm8
Definition: ABIWindows_x86_64.cpp:65
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
lldb_private::RegisterValue::SetBytes
void SetBytes(const void *bytes, size_t length, lldb::ByteOrder byte_order)
Definition: RegisterValue.cpp:752
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
dwarf_ymm15
@ dwarf_ymm15
Definition: ABIWindows_x86_64.cpp:96
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
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
ABIWindows_x86_64.h
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
dwarf_rbp
@ dwarf_rbp
Definition: ABIWindows_x86_64.cpp:46
dwarf_r14
@ dwarf_r14
Definition: ABIWindows_x86_64.cpp:54
FlattenAggregateType
static bool FlattenAggregateType(Thread &thread, ExecutionContext &exe_ctx, CompilerType &return_compiler_type, uint32_t data_byte_offset, std::vector< uint32_t > &aggregate_field_offsets, std::vector< CompilerType > &aggregate_compiler_types)
Definition: ABIWindows_x86_64.cpp:546
dwarf_ymm2
@ dwarf_ymm2
Definition: ABIWindows_x86_64.cpp:83
lldb::eRegisterKindLLDB
@ eRegisterKindLLDB
lldb's internal register numbers
Definition: lldb-enumerations.h:234
ABIWindows_x86_64::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIWindows_x86_64.cpp:758
lldb_private::DataExtractor
Definition: DataExtractor.h:48
dwarf_ymm4
@ dwarf_ymm4
Definition: ABIWindows_x86_64.cpp:85
Log.h
dwarf_ymm6
@ dwarf_ymm6
Definition: ABIWindows_x86_64.cpp:87
dwarf_bnd1
@ dwarf_bnd1
Definition: ABIWindows_x86_64.cpp:98
lldb_private::Thread
Definition: Thread.h:61
dwarf_xmm14
@ dwarf_xmm14
Definition: ABIWindows_x86_64.cpp:71
dwarf_ymm13
@ dwarf_ymm13
Definition: ABIWindows_x86_64.cpp:94
lldb_private::Status::Fail
bool Fail() const
Test for error condition.
Definition: Status.cpp:181
lldb_private::DataExtractor::GetDouble
double GetDouble(lldb::offset_t *offset_ptr) const
Definition: DataExtractor.cpp:626
dwarf_ymm14
@ dwarf_ymm14
Definition: ABIWindows_x86_64.cpp:95
lldb_private::RegisterValue::GetData
bool GetData(DataExtractor &data) const
Definition: RegisterValue.cpp:34
ABIWindows_x86_64::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: ABIWindows_x86_64.cpp:124
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
lldb_private::DataExtractor::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
Definition: DataExtractor.h:594
ValueObjectRegister.h
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::StreamString
Definition: StreamString.h:23
dwarf_r13
@ dwarf_r13
Definition: ABIWindows_x86_64.cpp:53
dwarf_stmm5
@ dwarf_stmm5
Definition: ABIWindows_x86_64.cpp:78
dwarf_ymm9
@ dwarf_ymm9
Definition: ABIWindows_x86_64.cpp:90
ABIWindows_x86_64::Terminate
static void Terminate()
Definition: ABIWindows_x86_64.cpp:824
dwarf_bnd0
@ dwarf_bnd0
Definition: ABIWindows_x86_64.cpp:97
dwarf_rbx
@ dwarf_rbx
Definition: ABIWindows_x86_64.cpp:43
sp
@ sp
Definition: CompactUnwindInfo.cpp:1250
lldb_private::CompilerType::GetNumFields
uint32_t GetNumFields() const
Definition: CompilerType.cpp:537
dwarf_ymm0
@ dwarf_ymm0
Definition: ABIWindows_x86_64.cpp:81
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::DataExtractor::GetFloat
float GetFloat(lldb::offset_t *offset_ptr) const
Extract a float from *offset_ptr.
Definition: DataExtractor.cpp:622
Thread.h
dwarf_r8
@ dwarf_r8
Definition: ABIWindows_x86_64.cpp:48
UnwindPlan.h
ABIWindows_x86_64::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABIWindows_x86_64.cpp:115
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_xmm13
@ dwarf_xmm13
Definition: ABIWindows_x86_64.cpp:70
ValueObjectConstResult.h
lldb_private::UnwindPlan::RowSP
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:395
dwarf_rip
@ dwarf_rip
Definition: ABIWindows_x86_64.cpp:56
dwarf_r9
@ dwarf_r9
Definition: ABIWindows_x86_64.cpp:49
dwarf_ymm12
@ dwarf_ymm12
Definition: ABIWindows_x86_64.cpp:93
dwarf_rdi
@ dwarf_rdi
Definition: ABIWindows_x86_64.cpp:45
dwarf_rsp
@ dwarf_rsp
Definition: ABIWindows_x86_64.cpp:47
ABIWindows_x86_64::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABIWindows_x86_64.cpp:296
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
dwarf_stmm3
@ dwarf_stmm3
Definition: ABIWindows_x86_64.cpp:76
lldb_private::RegisterContext::WriteRegisterFromUnsigned
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
Definition: RegisterContext.cpp:205
dwarf_bnd3
@ dwarf_bnd3
Definition: ABIWindows_x86_64.cpp:100
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
LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:52
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
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_xmm12
@ dwarf_xmm12
Definition: ABIWindows_x86_64.cpp:69
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
dwarf_ymm11
@ dwarf_ymm11
Definition: ABIWindows_x86_64.cpp:92
dwarf_bnd2
@ dwarf_bnd2
Definition: ABIWindows_x86_64.cpp:99
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
uint16_t
dwarf_xmm2
@ dwarf_xmm2
Definition: ABIWindows_x86_64.cpp:59
PluginManager.h
ABIWindows_x86_64::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIWindows_x86_64.cpp:738
dwarf_rax
@ dwarf_rax
Definition: ABIWindows_x86_64.cpp:40
dwarf_stmm0
@ dwarf_stmm0
Definition: ABIWindows_x86_64.cpp:73
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
dwarf_ymm5
@ dwarf_ymm5
Definition: ABIWindows_x86_64.cpp:86
Status.h
LLDB_REGNUM_GENERIC_ARG4
#define LLDB_REGNUM_GENERIC_ARG4
Definition: lldb-defines.h:62
ABIWindows_x86_64::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Definition: ABIWindows_x86_64.cpp:595
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:53
dwarf_xmm7
@ dwarf_xmm7
Definition: ABIWindows_x86_64.cpp:64
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_rdx
@ dwarf_rdx
Definition: ABIWindows_x86_64.cpp:41
ABIWindows_x86_64::Initialize
static void Initialize()
Definition: ABIWindows_x86_64.cpp:819
dwarf_r15
@ dwarf_r15
Definition: ABIWindows_x86_64.cpp:55
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
dwarf_xmm3
@ dwarf_xmm3
Definition: ABIWindows_x86_64.cpp:60
lldb_private::Thread::GetStackFrameAtIndex
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:398
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
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_xmm10
@ dwarf_xmm10
Definition: ABIWindows_x86_64.cpp:67
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
lldb_private::DataBufferHeap
Definition: DataBufferHeap.h:30
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
dwarf_xmm5
@ dwarf_xmm5
Definition: ABIWindows_x86_64.cpp:62
dwarf_stmm4
@ dwarf_stmm4
Definition: ABIWindows_x86_64.cpp:77
lldb_private::RegisterContext::GetRegisterInfoByName
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
Definition: RegisterContext.cpp:52
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: ABIWindows_x86_64.cpp:205
dwarf_ymm8
@ dwarf_ymm8
Definition: ABIWindows_x86_64.cpp:89
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
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
dwarf_xmm4
@ dwarf_xmm4
Definition: ABIWindows_x86_64.cpp:61
ABIWindows_x86_64::RegisterIsCalleeSaved
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
Definition: ABIWindows_x86_64.cpp:789