[lldb/Core] Don't crash in GetSoftwareBreakpointTrapOpcode for unknown triples
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 24 Apr 2020 16:03:51 +0000 (09:03 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 24 Apr 2020 16:10:41 +0000 (09:10 -0700)
commit1fcd234ac54a0bb9dcb14338db5a336d80321662
tree57faac82a2d371da74759621a218d9717346b951
parentd4e7b000b2ebe7db2e2e1f3d0f5d37793e6d1c59
[lldb/Core] Don't crash in GetSoftwareBreakpointTrapOpcode for unknown triples

This patch ensures we don't crash in GetSoftwareBreakpointTrapOpcode for
not-yet-supported architectures but rather continue with degraded
behavior.

I found the issue in the context of an invalid ArchSpec, which should be
handled further up the chain. In this patch I've also added an assert to
cover that, so we can still catch those issues.

Differential revision: https://reviews.llvm.org/D78588
lldb/source/Target/Platform.cpp