LLDB mainline
ABISysV_s390x.cpp
Go to the documentation of this file.
1//===-- ABISysV_s390x.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_s390x.h"
10
11#include "llvm/ADT/STLExtras.h"
12#include "llvm/TargetParser/Triple.h"
13
14#include "lldb/Core/Module.h"
16#include "lldb/Core/Value.h"
18#include "lldb/Target/Process.h"
21#include "lldb/Target/Target.h"
22#include "lldb/Target/Thread.h"
26#include "lldb/Utility/Log.h"
28#include "lldb/Utility/Status.h"
32#include <optional>
33
34using namespace lldb;
35using namespace lldb_private;
36
38
40 // General Purpose Registers
57 // Floating Point Registers / Vector Registers 0-15
74 // Access Registers
91 // Program Status Word
94 // Vector Registers 16-31
111};
112
113// RegisterKind: EHFrame, DWARF, Generic, Process Plugin, LLDB
114
115#define DEFINE_REG(name, size, alt, generic) \
116 { \
117 #name, alt, size, 0, eEncodingUint, eFormatHex, \
118 {dwarf_##name##_s390x, dwarf_##name##_s390x, generic, \
119 LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, \
120 nullptr, nullptr, nullptr, \
121 }
122
124 DEFINE_REG(r0, 8, nullptr, LLDB_INVALID_REGNUM),
125 DEFINE_REG(r1, 8, nullptr, LLDB_INVALID_REGNUM),
126 DEFINE_REG(r2, 8, nullptr, LLDB_REGNUM_GENERIC_ARG1),
127 DEFINE_REG(r3, 8, nullptr, LLDB_REGNUM_GENERIC_ARG2),
128 DEFINE_REG(r4, 8, nullptr, LLDB_REGNUM_GENERIC_ARG3),
129 DEFINE_REG(r5, 8, nullptr, LLDB_REGNUM_GENERIC_ARG4),
130 DEFINE_REG(r6, 8, nullptr, LLDB_REGNUM_GENERIC_ARG5),
131 DEFINE_REG(r7, 8, nullptr, LLDB_INVALID_REGNUM),
132 DEFINE_REG(r8, 8, nullptr, LLDB_INVALID_REGNUM),
133 DEFINE_REG(r9, 8, nullptr, LLDB_INVALID_REGNUM),
134 DEFINE_REG(r10, 8, nullptr, LLDB_INVALID_REGNUM),
136 DEFINE_REG(r12, 8, nullptr, LLDB_INVALID_REGNUM),
137 DEFINE_REG(r13, 8, nullptr, LLDB_INVALID_REGNUM),
138 DEFINE_REG(r14, 8, nullptr, LLDB_INVALID_REGNUM),
140 DEFINE_REG(acr0, 4, nullptr, LLDB_INVALID_REGNUM),
141 DEFINE_REG(acr1, 4, nullptr, LLDB_INVALID_REGNUM),
142 DEFINE_REG(acr2, 4, nullptr, LLDB_INVALID_REGNUM),
143 DEFINE_REG(acr3, 4, nullptr, LLDB_INVALID_REGNUM),
144 DEFINE_REG(acr4, 4, nullptr, LLDB_INVALID_REGNUM),
145 DEFINE_REG(acr5, 4, nullptr, LLDB_INVALID_REGNUM),
146 DEFINE_REG(acr6, 4, nullptr, LLDB_INVALID_REGNUM),
147 DEFINE_REG(acr7, 4, nullptr, LLDB_INVALID_REGNUM),
148 DEFINE_REG(acr8, 4, nullptr, LLDB_INVALID_REGNUM),
149 DEFINE_REG(acr9, 4, nullptr, LLDB_INVALID_REGNUM),
150 DEFINE_REG(acr10, 4, nullptr, LLDB_INVALID_REGNUM),
151 DEFINE_REG(acr11, 4, nullptr, LLDB_INVALID_REGNUM),
152 DEFINE_REG(acr12, 4, nullptr, LLDB_INVALID_REGNUM),
153 DEFINE_REG(acr13, 4, nullptr, LLDB_INVALID_REGNUM),
154 DEFINE_REG(acr14, 4, nullptr, LLDB_INVALID_REGNUM),
155 DEFINE_REG(acr15, 4, nullptr, LLDB_INVALID_REGNUM),
156 DEFINE_REG(pswm, 8, nullptr, LLDB_REGNUM_GENERIC_FLAGS),
157 DEFINE_REG(pswa, 8, nullptr, LLDB_REGNUM_GENERIC_PC),
158 DEFINE_REG(f0, 8, nullptr, LLDB_INVALID_REGNUM),
159 DEFINE_REG(f1, 8, nullptr, LLDB_INVALID_REGNUM),
160 DEFINE_REG(f2, 8, nullptr, LLDB_INVALID_REGNUM),
161 DEFINE_REG(f3, 8, nullptr, LLDB_INVALID_REGNUM),
162 DEFINE_REG(f4, 8, nullptr, LLDB_INVALID_REGNUM),
163 DEFINE_REG(f5, 8, nullptr, LLDB_INVALID_REGNUM),
164 DEFINE_REG(f6, 8, nullptr, LLDB_INVALID_REGNUM),
165 DEFINE_REG(f7, 8, nullptr, LLDB_INVALID_REGNUM),
166 DEFINE_REG(f8, 8, nullptr, LLDB_INVALID_REGNUM),
167 DEFINE_REG(f9, 8, nullptr, LLDB_INVALID_REGNUM),
168 DEFINE_REG(f10, 8, nullptr, LLDB_INVALID_REGNUM),
169 DEFINE_REG(f11, 8, nullptr, LLDB_INVALID_REGNUM),
170 DEFINE_REG(f12, 8, nullptr, LLDB_INVALID_REGNUM),
171 DEFINE_REG(f13, 8, nullptr, LLDB_INVALID_REGNUM),
172 DEFINE_REG(f14, 8, nullptr, LLDB_INVALID_REGNUM),
173 DEFINE_REG(f15, 8, nullptr, LLDB_INVALID_REGNUM),
174};
175
176static const uint32_t k_num_register_infos = std::size(g_register_infos);
177
180 count = k_num_register_infos;
181 return g_register_infos;
182}
183
184size_t ABISysV_s390x::GetRedZoneSize() const { return 0; }
185
186// Static Functions
187
188ABISP
190 if (arch.GetTriple().getArch() == llvm::Triple::systemz) {
191 return ABISP(new ABISysV_s390x(std::move(process_sp), MakeMCRegisterInfo(arch)));
192 }
193 return ABISP();
194}
195
197 addr_t func_addr, addr_t return_addr,
198 llvm::ArrayRef<addr_t> args) const {
200
201 if (log) {
202 StreamString s;
203 s.Printf("ABISysV_s390x::PrepareTrivialCall (tid = 0x%" PRIx64
204 ", sp = 0x%" PRIx64 ", func_addr = 0x%" PRIx64
205 ", return_addr = 0x%" PRIx64,
206 thread.GetID(), (uint64_t)sp, (uint64_t)func_addr,
207 (uint64_t)return_addr);
208
209 for (size_t i = 0; i < args.size(); ++i)
210 s.Printf(", arg%" PRIu64 " = 0x%" PRIx64, static_cast<uint64_t>(i + 1),
211 args[i]);
212 s.PutCString(")");
213 log->PutString(s.GetString());
214 }
215
216 RegisterContext *reg_ctx = thread.GetRegisterContext().get();
217 if (!reg_ctx)
218 return false;
219
220 const RegisterInfo *pc_reg_info =
222 const RegisterInfo *sp_reg_info =
224 const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfoByName("r14", 0);
225 ProcessSP process_sp(thread.GetProcess());
226
227 // Allocate a new stack frame and space for stack arguments if necessary
228
229 addr_t arg_pos = 0;
230 if (args.size() > 5) {
231 sp -= 8 * (args.size() - 5);
232 arg_pos = sp;
233 }
234
235 sp -= 160;
236
237 // Process arguments
238
239 for (size_t i = 0; i < args.size(); ++i) {
240 if (i < 5) {
241 const RegisterInfo *reg_info = reg_ctx->GetRegisterInfo(
243 LLDB_LOGF(log, "About to write arg%" PRIu64 " (0x%" PRIx64 ") into %s",
244 static_cast<uint64_t>(i + 1), args[i], reg_info->name);
245 if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
246 return false;
247 } else {
249 LLDB_LOGF(log, "About to write arg%" PRIu64 " (0x%" PRIx64 ") onto stack",
250 static_cast<uint64_t>(i + 1), args[i]);
251 if (!process_sp->WritePointerToMemory(arg_pos, args[i], error))
252 return false;
253 arg_pos += 8;
254 }
255 }
256
257 // %r14 is set to the return address
258
259 LLDB_LOGF(log, "Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
260
261 if (!reg_ctx->WriteRegisterFromUnsigned(ra_reg_info, return_addr))
262 return false;
263
264 // %r15 is set to the actual stack value.
265
266 LLDB_LOGF(log, "Writing SP: 0x%" PRIx64, (uint64_t)sp);
267
268 if (!reg_ctx->WriteRegisterFromUnsigned(sp_reg_info, sp))
269 return false;
270
271 // %pc is set to the address of the called function.
272
273 LLDB_LOGF(log, "Writing PC: 0x%" PRIx64, (uint64_t)func_addr);
274
275 if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_info, func_addr))
276 return false;
277
278 return true;
279}
280
281static bool ReadIntegerArgument(Scalar &scalar, unsigned int bit_width,
282 bool is_signed, Thread &thread,
283 uint32_t *argument_register_ids,
284 unsigned int &current_argument_register,
285 addr_t &current_stack_argument) {
286 if (bit_width > 64)
287 return false; // Scalar can't hold large integer arguments
288
289 if (current_argument_register < 5) {
290 scalar = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
291 argument_register_ids[current_argument_register], 0);
292 current_argument_register++;
293 if (is_signed)
294 scalar.SignExtend(bit_width);
295 } else {
296 uint32_t byte_size = (bit_width + (8 - 1)) / 8;
298 if (thread.GetProcess()->ReadScalarIntegerFromMemory(
299 current_stack_argument + 8 - byte_size, byte_size, is_signed,
300 scalar, error)) {
301 current_stack_argument += 8;
302 return true;
303 }
304 return false;
305 }
306 return true;
307}
308
310 unsigned int num_values = values.GetSize();
311 unsigned int value_index;
312
313 // Extract the register context so we can read arguments from registers
314
315 RegisterContext *reg_ctx = thread.GetRegisterContext().get();
316
317 if (!reg_ctx)
318 return false;
319
320 // Get the pointer to the first stack argument so we have a place to start
321 // when reading data
322
323 addr_t sp = reg_ctx->GetSP(0);
324
325 if (!sp)
326 return false;
327
328 addr_t current_stack_argument = sp + 160;
329
330 uint32_t argument_register_ids[5];
331
332 argument_register_ids[0] =
335 argument_register_ids[1] =
338 argument_register_ids[2] =
341 argument_register_ids[3] =
344 argument_register_ids[4] =
347
348 unsigned int current_argument_register = 0;
349
350 for (value_index = 0; value_index < num_values; ++value_index) {
351 Value *value = values.GetValueAtIndex(value_index);
352
353 if (!value)
354 return false;
355
356 // We currently only support extracting values with Clang QualTypes. Do we
357 // care about others?
358 CompilerType compiler_type = value->GetCompilerType();
359 std::optional<uint64_t> bit_size =
360 llvm::expectedToOptional(compiler_type.GetBitSize(&thread));
361 if (!bit_size)
362 return false;
363 bool is_signed;
364
365 if (compiler_type.IsIntegerOrEnumerationType(is_signed)) {
366 ReadIntegerArgument(value->GetScalar(), *bit_size, is_signed, thread,
367 argument_register_ids, current_argument_register,
368 current_stack_argument);
369 } else if (compiler_type.IsPointerType()) {
370 ReadIntegerArgument(value->GetScalar(), *bit_size, false, thread,
371 argument_register_ids, current_argument_register,
372 current_stack_argument);
373 }
374 }
375
376 return true;
377}
378
380 lldb::ValueObjectSP &new_value_sp) {
382 if (!new_value_sp) {
383 error = Status::FromErrorString("Empty value object for return value.");
384 return error;
385 }
386
387 CompilerType compiler_type = new_value_sp->GetCompilerType();
388 if (!compiler_type) {
389 error = Status::FromErrorString("Null clang type for return value.");
390 return error;
391 }
392
393 Thread *thread = frame_sp->GetThread().get();
394
395 bool is_signed;
396
397 RegisterContext *reg_ctx = thread->GetRegisterContext().get();
398
399 bool set_it_simple = false;
400 if (compiler_type.IsIntegerOrEnumerationType(is_signed) ||
401 compiler_type.IsPointerType()) {
402 const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
403
404 DataExtractor data;
405 Status data_error;
406 size_t num_bytes = new_value_sp->GetData(data, data_error);
407 if (data_error.Fail()) {
409 "Couldn't convert return value to raw data: %s",
410 data_error.AsCString());
411 return error;
412 }
413 lldb::offset_t offset = 0;
414 if (num_bytes <= 8) {
415 uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
416
417 if (reg_ctx->WriteRegisterFromUnsigned(reg_info, raw_value))
418 set_it_simple = true;
419 } else {
421 "We don't support returning longer than 64 bit "
422 "integer values at present.");
423 }
424 } else if (compiler_type.IsRealFloatingPointType()) {
425 std::optional<uint64_t> bit_width =
426 llvm::expectedToOptional(compiler_type.GetBitSize(frame_sp.get()));
427 if (!bit_width) {
428 error = Status::FromErrorString("can't get type size");
429 return error;
430 }
431 if (*bit_width <= 64) {
432 const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
433 RegisterValue f0_value;
434 DataExtractor data;
435 Status data_error;
436 size_t num_bytes = new_value_sp->GetData(data, data_error);
437 if (data_error.Fail()) {
439 "Couldn't convert return value to raw data: %s",
440 data_error.AsCString());
441 return error;
442 }
443
444 unsigned char buffer[8];
445 ByteOrder byte_order = data.GetByteOrder();
446
447 data.CopyByteOrderedData(0, num_bytes, buffer, 8, byte_order);
448 f0_value.SetBytes(buffer, 8, byte_order);
449 reg_ctx->WriteRegister(f0_info, f0_value);
450 set_it_simple = true;
451 } else {
452 // FIXME - don't know how to do long doubles yet.
454 "We don't support returning float values > 64 bits at present");
455 }
456 }
457
458 if (!set_it_simple) {
459 // Okay we've got a structure or something that doesn't fit in a simple
460 // register. We should figure out where it really goes, but we don't
461 // support this yet.
463 "We only support setting simple integer and float "
464 "return types at present.");
465 }
466
467 return error;
468}
469
471 Thread &thread, CompilerType &return_compiler_type) const {
472 ValueObjectSP return_valobj_sp;
473 Value value;
474
475 if (!return_compiler_type)
476 return return_valobj_sp;
477
478 // value.SetContext (Value::eContextTypeClangType, return_value_type);
479 value.SetCompilerType(return_compiler_type);
480
481 RegisterContext *reg_ctx = thread.GetRegisterContext().get();
482 if (!reg_ctx)
483 return return_valobj_sp;
484
485 const uint32_t type_flags = return_compiler_type.GetTypeInfo();
486 if (type_flags & eTypeIsScalar) {
488
489 bool success = false;
490 if (type_flags & eTypeIsInteger) {
491 // Extract the register context so we can read arguments from registers.
492 std::optional<uint64_t> byte_size =
493 llvm::expectedToOptional(return_compiler_type.GetByteSize(&thread));
494 if (!byte_size)
495 return return_valobj_sp;
496 uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
497 reg_ctx->GetRegisterInfoByName("r2", 0), 0);
498 const bool is_signed = (type_flags & eTypeIsSigned) != 0;
499 switch (*byte_size) {
500 default:
501 break;
502
503 case sizeof(uint64_t):
504 if (is_signed)
505 value.GetScalar() = (int64_t)(raw_value);
506 else
507 value.GetScalar() = (uint64_t)(raw_value);
508 success = true;
509 break;
510
511 case sizeof(uint32_t):
512 if (is_signed)
513 value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);
514 else
515 value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
516 success = true;
517 break;
518
519 case sizeof(uint16_t):
520 if (is_signed)
521 value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);
522 else
523 value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
524 success = true;
525 break;
526
527 case sizeof(uint8_t):
528 if (is_signed)
529 value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);
530 else
531 value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
532 success = true;
533 break;
534 }
535 } else if (type_flags & eTypeIsFloat) {
536 if (type_flags & eTypeIsComplex) {
537 // Don't handle complex yet.
538 } else {
539 std::optional<uint64_t> byte_size =
540 llvm::expectedToOptional(return_compiler_type.GetByteSize(&thread));
541 if (byte_size && *byte_size <= sizeof(long double)) {
542 const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
543 RegisterValue f0_value;
544 if (reg_ctx->ReadRegister(f0_info, f0_value)) {
545 DataExtractor data;
546 if (f0_value.GetData(data)) {
547 lldb::offset_t offset = 0;
548 if (*byte_size == sizeof(float)) {
549 value.GetScalar() = (float)data.GetFloat(&offset);
550 success = true;
551 } else if (*byte_size == sizeof(double)) {
552 value.GetScalar() = (double)data.GetDouble(&offset);
553 success = true;
554 } else if (*byte_size == sizeof(long double)) {
555 // Don't handle long double yet.
556 }
557 }
558 }
559 }
560 }
561 }
562
563 if (success)
564 return_valobj_sp = ValueObjectConstResult::Create(
565 thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
566 } else if (type_flags & eTypeIsPointer) {
567 unsigned r2_id =
569 value.GetScalar() =
570 (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_id, 0);
572 return_valobj_sp = ValueObjectConstResult::Create(
573 thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
574 }
575
576 return return_valobj_sp;
577}
578
580 Thread &thread, CompilerType &return_compiler_type) const {
581 ValueObjectSP return_valobj_sp;
582
583 if (!return_compiler_type)
584 return return_valobj_sp;
585
586 ExecutionContext exe_ctx(thread.shared_from_this());
587 return_valobj_sp = GetReturnValueObjectSimple(thread, return_compiler_type);
588 if (return_valobj_sp)
589 return return_valobj_sp;
590
591 RegisterContextSP reg_ctx_sp = thread.GetRegisterContext();
592 if (!reg_ctx_sp)
593 return return_valobj_sp;
594
595 if (return_compiler_type.IsAggregateType()) {
596 // FIXME: This is just taking a guess, r2 may very well no longer hold the
597 // return storage location.
598 // If we are going to do this right, when we make a new frame we should
599 // check to see if it uses a memory return, and if we are at the first
600 // instruction and if so stash away the return location. Then we would
601 // only return the memory return value if we know it is valid.
602
603 unsigned r2_id =
604 reg_ctx_sp->GetRegisterInfoByName("r2", 0)->kinds[eRegisterKindLLDB];
605 lldb::addr_t storage_addr =
606 (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_id, 0);
607 return_valobj_sp = ValueObjectMemory::Create(
608 &thread, "", Address(storage_addr, nullptr), return_compiler_type);
609 }
610
611 return return_valobj_sp;
612}
613
615 UnwindPlan::Row row;
616
617 // Our Call Frame Address is the stack pointer value + 160
619
620 // The previous PC is in r14
622
623 // All other registers are the same.
624 auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
625 plan_sp->AppendRow(std::move(row));
626 plan_sp->SetSourceName("s390x at-func-entry default");
627 plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
628 return plan_sp;
629}
630
632 // There's really no default way to unwind on s390x. Trust the .eh_frame CFI,
633 // which should always be good.
634 return nullptr;
635}
636
638 const RegisterInfo *reg_info,
640 // If a volatile register is being requested, we don't want to forward the
641 // next frame's register contents up the stack -- the register is not
642 // retrievable at this frame.
643 if (RegisterIsVolatile(reg_info)) {
644 unwind_regloc.SetUndefined();
645 return true;
646 }
647
648 return false;
649}
650
652 return !RegisterIsCalleeSaved(reg_info);
653}
654
656 if (reg_info) {
657 // Preserved registers are :
658 // r6-r13, r15
659 // f8-f15
660
661 const char *name = reg_info->name;
662 if (name[0] == 'r') {
663 switch (name[1]) {
664 case '6': // r6
665 case '7': // r7
666 case '8': // r8
667 case '9': // r9
668 return name[2] == '\0';
669
670 case '1': // r10, r11, r12, r13, r15
671 if ((name[2] >= '0' && name[2] <= '3') || name[2] == '5')
672 return name[3] == '\0';
673 break;
674
675 default:
676 break;
677 }
678 }
679 if (name[0] == 'f') {
680 switch (name[1]) {
681 case '8': // r8
682 case '9': // r9
683 return name[2] == '\0';
684
685 case '1': // r10, r11, r12, r13, r14, r15
686 if (name[2] >= '0' && name[2] <= '5')
687 return name[3] == '\0';
688 break;
689
690 default:
691 break;
692 }
693 }
694
695 // Accept shorter-variant versions
696 if (name[0] == 's' && name[1] == 'p' && name[2] == '\0') // sp
697 return true;
698 if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0') // fp
699 return true;
700 if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0') // pc
701 return true;
702 }
703 return false;
704}
705
708 GetPluginNameStatic(), "System V ABI for s390x targets", CreateInstance);
709}
710
static const uint32_t k_num_register_infos
static const RegisterInfo g_register_infos[]
dwarf_regnums
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)
@ dwarf_r7_s390x
@ dwarf_v18_s390x
@ dwarf_f8_s390x
@ dwarf_acr2_s390x
@ dwarf_v21_s390x
@ dwarf_f1_s390x
@ dwarf_acr0_s390x
@ dwarf_acr7_s390x
@ dwarf_v29_s390x
@ dwarf_r4_s390x
@ dwarf_f4_s390x
@ dwarf_r11_s390x
@ dwarf_f15_s390x
@ dwarf_acr12_s390x
@ dwarf_v20_s390x
@ dwarf_f0_s390x
@ dwarf_r15_s390x
@ dwarf_f14_s390x
@ dwarf_v22_s390x
@ dwarf_f10_s390x
@ dwarf_r8_s390x
@ dwarf_v23_s390x
@ dwarf_acr15_s390x
@ dwarf_v27_s390x
@ dwarf_f12_s390x
@ dwarf_v17_s390x
@ dwarf_f6_s390x
@ dwarf_v25_s390x
@ dwarf_v30_s390x
@ dwarf_r3_s390x
@ dwarf_r9_s390x
@ dwarf_r1_s390x
@ dwarf_r0_s390x
@ dwarf_r12_s390x
@ dwarf_r6_s390x
@ dwarf_acr10_s390x
@ dwarf_r13_s390x
@ dwarf_acr4_s390x
@ dwarf_r14_s390x
@ dwarf_acr14_s390x
@ dwarf_f2_s390x
@ dwarf_pswm_s390x
@ dwarf_v24_s390x
@ dwarf_v28_s390x
@ dwarf_f11_s390x
@ dwarf_f7_s390x
@ dwarf_acr8_s390x
@ dwarf_v31_s390x
@ dwarf_acr1_s390x
@ dwarf_f5_s390x
@ dwarf_acr3_s390x
@ dwarf_r2_s390x
@ dwarf_acr5_s390x
@ dwarf_v19_s390x
@ dwarf_f9_s390x
@ dwarf_acr6_s390x
@ dwarf_r5_s390x
@ dwarf_acr11_s390x
@ dwarf_v16_s390x
@ dwarf_f13_s390x
@ dwarf_pswa_s390x
@ dwarf_acr13_s390x
@ dwarf_v26_s390x
@ dwarf_acr9_s390x
@ dwarf_f3_s390x
@ dwarf_r10_s390x
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)
#define DEFINE_REG(name, size, alt, generic)
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
Definition Log.h:376
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
lldb::UnwindPlanSP CreateDefaultUnwindPlan() override
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
bool GetFallbackRegisterLocation(const lldb_private::RegisterInfo *reg_info, lldb_private::UnwindPlan::Row::AbstractRegisterLocation &unwind_regloc) override
lldb::UnwindPlanSP CreateFunctionEntryUnwindPlan() override
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
static void Terminate()
static void Initialize()
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
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
static llvm::StringRef GetPluginNameStatic()
size_t GetRedZoneSize() const override
static std::unique_ptr< llvm::MCRegisterInfo > MakeMCRegisterInfo(const ArchSpec &arch)
Utility function to construct a MCRegisterInfo using the ArchSpec triple.
Definition ABI.cpp:225
A section + offset based address class.
Definition Address.h:62
An architecture specification class.
Definition ArchSpec.h:32
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:457
Generic representation of a type in a programming language.
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
bool IsIntegerOrEnumerationType(bool &is_signed) const
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
bool IsRealFloatingPointType() const
Returns true for non-complex float types.
llvm::Expected< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
bool IsPointerType(CompilerType *pointee_type=nullptr) const
A uniqued constant string class.
Definition ConstString.h:40
An data extractor class.
float GetFloat(lldb::offset_t *offset_ptr) const
Extract a float from *offset_ptr.
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
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...
double GetDouble(lldb::offset_t *offset_ptr) const
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void PutString(llvm::StringRef str)
Definition Log.cpp:147
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
uint64_t GetSP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
const RegisterInfo * GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num)
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
bool GetData(DataExtractor &data) const
void SetBytes(const void *bytes, size_t length, lldb::ByteOrder byte_order)
bool SignExtend(uint32_t bit_pos)
Definition Scalar.cpp:762
An error handling class.
Definition Status.h:118
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition Status.cpp:106
static Status FromErrorString(const char *str)
Definition Status.h:141
bool Fail() const
Test for error condition.
Definition Status.cpp:293
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition Status.cpp:194
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:65
void SetIsRegisterPlusOffset(uint32_t reg_num, int32_t offset)
Definition UnwindPlan.h:240
const FAValue & GetCFAValue() const
Definition UnwindPlan.h:365
bool SetRegisterLocationToRegister(uint32_t reg_num, uint32_t other_reg_num, bool can_replace)
Value * GetValueAtIndex(size_t idx)
Definition Value.cpp:698
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
const Scalar & GetScalar() const
See comment on m_scalar to understand what GetScalar returns.
Definition Value.h:113
@ Scalar
A raw scalar value.
Definition Value.h:45
void SetCompilerType(const CompilerType &compiler_type)
Definition Value.cpp:276
void SetValueType(ValueType value_type)
Definition Value.h:89
const CompilerType & GetCompilerType()
Definition Value.cpp:247
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_ARG4
#define LLDB_REGNUM_GENERIC_ARG3
#define LLDB_REGNUM_GENERIC_ARG1
#define LLDB_REGNUM_GENERIC_FLAGS
#define UINT32_MAX
#define LLDB_INVALID_REGNUM
#define LLDB_REGNUM_GENERIC_ARG2
#define LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_ARG5
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:332
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
uint64_t offset_t
Definition lldb-types.h:85
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindLLDB
lldb's internal register numbers
@ eRegisterKindDWARF
the register numbers seen DWARF
Every register is described in detail including its name, alternate name (optional),...
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
const char * name
Name of this register, can't be NULL.