diff --git a/lldb/source/Host/freebsd/Host.cpp b/lldb/source/Host/freebsd/Host.cpp index fa7efad466bad..dfdbfea0c3c0a 100644 --- a/lldb/source/Host/freebsd/Host.cpp +++ b/lldb/source/Host/freebsd/Host.cpp @@ -18,8 +18,6 @@ #include #include -#include "llvm/Object/ELF.h" - #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" @@ -32,6 +30,7 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" +#include "llvm/Object/ELF.h" #include "llvm/TargetParser/Host.h" namespace lldb_private { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp index e0f3971c6e272..b55a5c595d3ca 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -76,8 +76,7 @@ static std::vector &GetSharedRegisterInfoVector() { static const RegisterInfo * GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { - static std::vector g_register_infos( - GetSharedRegisterInfoVector()); + static std::vector g_register_infos; // Allocate RegisterInfo only once if (g_register_infos.empty()) { @@ -93,6 +92,9 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS + std::vector &shared_regs = + GetSharedRegisterInfoVector(); + shared_regs = g_register_infos; } return &g_register_infos[0]; diff --git a/lldb/test/Shell/Breakpoint/debug_x86_over_amd64.test b/lldb/test/Shell/Breakpoint/debug_x86_over_amd64.test new file mode 100644 index 0000000000000..90d4748e5fa51 --- /dev/null +++ b/lldb/test/Shell/Breakpoint/debug_x86_over_amd64.test @@ -0,0 +1,26 @@ +# REQUIRES: target-x86_64 +# XFAIL: system-windows + +# RUN: mkdir -p %t +# RUN: cd %t +# RUN: %clang_host -m32 %p/Inputs/dummy-target.c -o dummy.out +# RUN: %lldb -b -s %s dummy.out | FileCheck %s + +breakpoint set -D -n main +# CHECK: Breakpoint {{[0-9]}}: no locations (pending). +# CHECK: Breakpoint set in dummy target + +breakpoint list +# CHECK: No breakpoints currently set + +breakpoint list -D +# CHECK: name = 'main', locations = 0 (pending) + +target delete +# CHECK: 1 targets deleted + +target create dummy.out +# CHECK: Current executable set to {{.*}}dummy.out + +breakpoint list +# CHECK: name = 'main', locations = {{[1-9]}}