Skip to content

Commit 5764982

Browse files
author
Greg Clayton
committed
Make sure to fill in the compiler register number so when we try to backtrace using EH frame, it works.
Prior to this, backtraces could fail due to not being able to convert a EH frame register number to LLDB register number. llvm-svn: 351564
1 parent 1c48f03 commit 5764982

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,35 @@ using namespace minidump;
3030
#define DEF_R(i) \
3131
{ \
3232
"r" #i, nullptr, 4, OFFSET(r) + i * 4, eEncodingUint, eFormatHex, \
33-
{INV, dwarf_r##i, INV, INV, reg_r##i}, nullptr, nullptr, nullptr, 0 \
33+
{dwarf_r##i, dwarf_r##i, INV, INV, reg_r##i}, \
34+
nullptr, nullptr, nullptr, 0 \
3435
}
3536

3637
#define DEF_R_ARG(i, n) \
3738
{ \
3839
"r" #i, "arg" #n, 4, OFFSET(r) + i * 4, eEncodingUint, eFormatHex, \
39-
{INV, dwarf_r##i, LLDB_REGNUM_GENERIC_ARG1 + i, INV, reg_r##i}, \
40+
{dwarf_r##i, dwarf_r##i, LLDB_REGNUM_GENERIC_ARG1 + i, INV, reg_r##i}, \
4041
nullptr, nullptr, nullptr, 0 \
4142
}
4243

4344
#define DEF_D(i) \
4445
{ \
4546
"d" #i, nullptr, 8, OFFSET(d) + i * 8, eEncodingVector, \
46-
eFormatVectorOfUInt8, {INV, dwarf_d##i, INV, INV, reg_d##i}, \
47+
eFormatVectorOfUInt8, {dwarf_d##i, dwarf_d##i, INV, INV, reg_d##i}, \
4748
nullptr, nullptr, nullptr, 0 \
4849
}
4950

5051
#define DEF_S(i) \
5152
{ \
5253
"s" #i, nullptr, 4, OFFSET(s) + i * 4, eEncodingIEEE754, eFormatFloat, \
53-
{INV, dwarf_s##i, INV, INV, reg_s##i}, nullptr, nullptr, nullptr, 0 \
54+
{dwarf_s##i, dwarf_s##i, INV, INV, reg_s##i}, \
55+
nullptr, nullptr, nullptr, 0 \
5456
}
5557

5658
#define DEF_Q(i) \
5759
{ \
5860
"q" #i, nullptr, 16, OFFSET(q) + i * 16, eEncodingVector, \
59-
eFormatVectorOfUInt8, {INV, dwarf_q##i, INV, INV, reg_q##i}, \
61+
eFormatVectorOfUInt8, {dwarf_q##i, dwarf_q##i, INV, INV, reg_q##i}, \
6062
nullptr, nullptr, nullptr, 0 \
6163
}
6264

lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ using namespace minidump;
2929
#define DEF_X(i) \
3030
{ \
3131
"x" #i, nullptr, 8, OFFSET(x) + i * 8, eEncodingUint, eFormatHex, \
32-
{INV, arm64_dwarf::x##i, INV, INV, reg_x##i}, nullptr, nullptr, \
33-
nullptr, 0 \
32+
{arm64_dwarf::x##i, arm64_dwarf::x##i, INV, INV, reg_x##i}, \
33+
nullptr, nullptr, nullptr, 0 \
3434
}
3535

3636
#define DEF_W(i) \
@@ -42,15 +42,15 @@ using namespace minidump;
4242
#define DEF_X_ARG(i, n) \
4343
{ \
4444
"x" #i, "arg" #n, 8, OFFSET(x) + i * 8, eEncodingUint, eFormatHex, \
45-
{INV, arm64_dwarf::x##i, LLDB_REGNUM_GENERIC_ARG1 + i, INV, reg_x##i}, \
46-
nullptr, nullptr, nullptr, 0 \
45+
{arm64_dwarf::x##i, arm64_dwarf::x##i, LLDB_REGNUM_GENERIC_ARG1 + i, \
46+
INV, reg_x##i}, nullptr, nullptr, nullptr, 0 \
4747
}
4848

4949
#define DEF_V(i) \
5050
{ \
5151
"v" #i, nullptr, 16, OFFSET(v) + i * 16, eEncodingVector, \
52-
eFormatVectorOfUInt8, {INV, arm64_dwarf::v##i, INV, INV, reg_v##i}, \
53-
nullptr, nullptr, nullptr, 0 \
52+
eFormatVectorOfUInt8, {arm64_dwarf::v##i, arm64_dwarf::v##i, INV, INV, \
53+
reg_v##i}, nullptr, nullptr, nullptr, 0 \
5454
}
5555

5656
#define DEF_D(i) \
@@ -314,7 +314,7 @@ static RegisterInfo g_reg_infos[] = {
314314
OFFSET(x) + 29 * 8,
315315
eEncodingUint,
316316
eFormatHex,
317-
{INV, arm64_dwarf::x29, LLDB_REGNUM_GENERIC_FP, INV, reg_fp},
317+
{arm64_dwarf::x29, arm64_dwarf::x29, LLDB_REGNUM_GENERIC_FP, INV, reg_fp},
318318
nullptr,
319319
nullptr,
320320
nullptr,
@@ -325,7 +325,7 @@ static RegisterInfo g_reg_infos[] = {
325325
OFFSET(x) + 30 * 8,
326326
eEncodingUint,
327327
eFormatHex,
328-
{INV, arm64_dwarf::x30, LLDB_REGNUM_GENERIC_RA, INV, reg_lr},
328+
{arm64_dwarf::x30, arm64_dwarf::x30, LLDB_REGNUM_GENERIC_RA, INV, reg_lr},
329329
nullptr,
330330
nullptr,
331331
nullptr,
@@ -336,7 +336,7 @@ static RegisterInfo g_reg_infos[] = {
336336
OFFSET(x) + 31 * 8,
337337
eEncodingUint,
338338
eFormatHex,
339-
{INV, arm64_dwarf::x31, LLDB_REGNUM_GENERIC_SP, INV, reg_sp},
339+
{arm64_dwarf::x31, arm64_dwarf::x31, LLDB_REGNUM_GENERIC_SP, INV, reg_sp},
340340
nullptr,
341341
nullptr,
342342
nullptr,
@@ -347,7 +347,7 @@ static RegisterInfo g_reg_infos[] = {
347347
OFFSET(pc),
348348
eEncodingUint,
349349
eFormatHex,
350-
{INV, arm64_dwarf::pc, LLDB_REGNUM_GENERIC_PC, INV, reg_pc},
350+
{arm64_dwarf::pc, arm64_dwarf::pc, LLDB_REGNUM_GENERIC_PC, INV, reg_pc},
351351
nullptr,
352352
nullptr,
353353
nullptr,

0 commit comments

Comments
 (0)