diff options
| author | Pavel Labath <pavel@labath.sk> | 2018-09-09 06:01:12 +0000 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2018-09-09 06:01:12 +0000 |
| commit | f8b825f689d6c84ae2d0f5e40697115053c734f2 (patch) | |
| tree | 2fb0c982ab3f22fb7b88596c3301109ea8cd192b /lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | |
| parent | 9bd24527082ff753f43ef4e211013e3c5a0a459e (diff) | |
| download | bcm5719-llvm-f8b825f689d6c84ae2d0f5e40697115053c734f2.tar.gz bcm5719-llvm-f8b825f689d6c84ae2d0f5e40697115053c734f2.zip | |
Re-commit "Modernize NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode"
This recommits r341487, which was reverted due to failing tests with
clang. It turned out I had incorrectly expected that the literal arrays
passed to ArrayRef constructor will have static (permanent) storage.
This was only the case with gcc, while clang was constructing them on
stack, leading to dangling pointers when the function returns.
The fix is to explicitly assign static storage duration to the opcode
arrays.
llvm-svn: 341758
Diffstat (limited to 'lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index 54d2e8b552f..8c0ba8079c0 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -682,23 +682,6 @@ Status NativeProcessNetBSD::SetBreakpoint(lldb::addr_t addr, uint32_t size, return SetSoftwareBreakpoint(addr, size); } -Status NativeProcessNetBSD::GetSoftwareBreakpointTrapOpcode( - size_t trap_opcode_size_hint, size_t &actual_opcode_size, - const uint8_t *&trap_opcode_bytes) { - static const uint8_t g_i386_opcode[] = {0xCC}; - - switch (m_arch.GetMachine()) { - case llvm::Triple::x86: - case llvm::Triple::x86_64: - trap_opcode_bytes = g_i386_opcode; - actual_opcode_size = sizeof(g_i386_opcode); - return Status(); - default: - assert(false && "CPU type not supported!"); - return Status("CPU type not supported"); - } -} - Status NativeProcessNetBSD::GetLoadedModuleFileSpec(const char *module_path, FileSpec &file_spec) { return Status("Unimplemented"); |

