PostfixExpression: Use signed integers in IntegerNode
Summary: This is necessary to support parsing expressions like ".cfa -16 + ^", as that format is used in breakpad STACK CFI expressions. Since the PDB expressions use the same parser, this change will affect them too, but I don't believe that should be a problem in practice. If PDBs do contain the negative values, it's very likely that they are intended to be parsed the same way, and if they don't, then it doesn't matter. In case that we do ever need to handle this differently, we can always make the parser behavior customizable, or just use a different parser. To make sure that the integer size is big enough for everyone, I switch from using a (unsigned) 32-bit integer to a 64-bit (signed) one. Reviewers: amccarth, clayborg, aleksandr.urakov Subscribers: markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D61311 llvm-svn: 360166
This commit is contained in:
@@ -58,20 +58,20 @@ TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentRegisterRef) {
|
||||
}
|
||||
|
||||
TEST(PDBFPOProgramToDWARFExpressionTests, MultipleIndependentAssignments) {
|
||||
CheckValidProgramTranslation("$T1 1 = $T0 0 =", "$T0", "DW_OP_constu 0x0");
|
||||
CheckValidProgramTranslation("$T1 1 = $T0 0 =", "$T0", "DW_OP_consts +0");
|
||||
}
|
||||
|
||||
TEST(PDBFPOProgramToDWARFExpressionTests, MultipleDependentAssignments) {
|
||||
CheckValidProgramTranslation(
|
||||
"$T1 $ebp 4 + = $T0 $T1 8 - 128 @ = ", "$T0",
|
||||
"DW_OP_breg6 +0, DW_OP_constu 0x4, DW_OP_plus , DW_OP_constu 0x8, "
|
||||
"DW_OP_minus , DW_OP_constu 0x80, DW_OP_lit1 , DW_OP_minus , DW_OP_not , "
|
||||
"DW_OP_breg6 +0, DW_OP_consts +4, DW_OP_plus , DW_OP_consts +8, "
|
||||
"DW_OP_minus , DW_OP_consts +128, DW_OP_lit1 , DW_OP_minus , DW_OP_not , "
|
||||
"DW_OP_and ");
|
||||
}
|
||||
|
||||
TEST(PDBFPOProgramToDWARFExpressionTests, DependencyChain) {
|
||||
CheckValidProgramTranslation("$T1 0 = $T0 $T1 = $ebp $T0 =", "$ebp",
|
||||
"DW_OP_constu 0x0");
|
||||
"DW_OP_consts +0");
|
||||
}
|
||||
|
||||
/// Invalid programs tests
|
||||
|
||||
Reference in New Issue
Block a user