summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-04-04 13:23:25 +0000
committerPavel Labath <pavel@labath.sk>2019-04-04 13:23:25 +0000
commitdfaafbcf4cefb6632768af23fef43babbba24a98 (patch)
treeed6150883d4d820b5cd01aeba47962c405d231a9 /lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
parentca58078dc67e9d0b75bbf3338936064d94d41ce3 (diff)
downloadbcm5719-llvm-dfaafbcf4cefb6632768af23fef43babbba24a98.tar.gz
bcm5719-llvm-dfaafbcf4cefb6632768af23fef43babbba24a98.zip
Breakpad: Refine record classification code
Previously we would classify all STACK records into a single bucket. This is not really helpful, because there are three distinct types of records beginning with the token "STACK" (STACK CFI INIT, STACK CFI, STACK WIN). To be consistent with how we're treating other records, we should classify these as three different record types. It also implements the logic to put "STACK CFI INIT" and "STACK CFI" records into the same "section" of the breakpad file, as they are meant to be read together (similar to how FUNC and LINE records are treated). The code which performs actual parsing of these records will come in a separate patch. llvm-svn: 357691
Diffstat (limited to 'lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp')
-rw-r--r--lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp b/lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
index fcd5aa71129..ad0b7d377ef 100644
--- a/lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
+++ b/lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
@@ -19,13 +19,18 @@ TEST(Record, classify) {
EXPECT_EQ(Record::File, Record::classify("FILE"));
EXPECT_EQ(Record::Func, Record::classify("FUNC"));
EXPECT_EQ(Record::Public, Record::classify("PUBLIC"));
- EXPECT_EQ(Record::Stack, Record::classify("STACK"));
+ EXPECT_EQ(Record::StackCFIInit, Record::classify("STACK CFI INIT"));
+ EXPECT_EQ(Record::StackCFI, Record::classify("STACK CFI"));
+
+ // Any obviously incorrect lines will be classified as such.
+ EXPECT_EQ(llvm::None, Record::classify("STACK"));
+ EXPECT_EQ(llvm::None, Record::classify("STACK CODE_ID"));
+ EXPECT_EQ(llvm::None, Record::classify("CODE_ID"));
// Any line which does not start with a known keyword will be classified as a
// line record, as those are the only ones that start without a keyword.
EXPECT_EQ(Record::Line, Record::classify("deadbeef"));
EXPECT_EQ(Record::Line, Record::classify("12"));
- EXPECT_EQ(Record::Line, Record::classify("CODE_ID"));
}
TEST(ModuleRecord, parse) {
OpenPOWER on IntegriCloud