JDevlieghere updated this revision to Diff 259728.
JDevlieghere retitled this revision from "[lldb/Core] Check that ArchSpec is
valid." to "[lldb/Core] Don't crash in GetSoftwareBreakpointTrapOpcode for
unknown triples".
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78588/new/
https://reviews.llvm.org/D78588
Files:
lldb/source/Target/Platform.cpp
Index: lldb/source/Target/Platform.cpp
===================================================================
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -1822,6 +1822,7 @@
size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
BreakpointSite *bp_site) {
ArchSpec arch = target.GetArchitecture();
+ assert(arch.IsValid());
const uint8_t *trap_opcode = nullptr;
size_t trap_opcode_size = 0;
@@ -1918,8 +1919,7 @@
} break;
default:
- llvm_unreachable(
- "Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
+ return 0;
}
assert(bp_site);
Index: lldb/source/Target/Platform.cpp
===================================================================
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -1822,6 +1822,7 @@
size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
BreakpointSite *bp_site) {
ArchSpec arch = target.GetArchitecture();
+ assert(arch.IsValid());
const uint8_t *trap_opcode = nullptr;
size_t trap_opcode_size = 0;
@@ -1918,8 +1919,7 @@
} break;
default:
- llvm_unreachable(
- "Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
+ return 0;
}
assert(bp_site);
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits