[Lldb-commits] [lldb] r243468 - FreeBSDThread::GetRegisterContext is only for FreeBSD targets
Ed Maste
emaste at freebsd.org
Tue Jul 28 12:47:00 PDT 2015
Author: emaste
Date: Tue Jul 28 14:47:00 2015
New Revision: 243468
URL: http://llvm.org/viewvc/llvm-project?rev=243468&view=rev
Log:
FreeBSDThread::GetRegisterContext is only for FreeBSD targets
The removal of in-process Linux debug support left a switch statement
with llvm::Triple::FreeBSD as the only case. Simplify by replacing it
with a now-equivalent assertion.
Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
Modified: lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp?rev=243468&r1=243467&r2=243468&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Tue Jul 28 14:47:00 2015
@@ -157,42 +157,33 @@ FreeBSDThread::GetRegisterContext()
RegisterInfoInterface *reg_interface = NULL;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
- switch (target_arch.GetTriple().getOS())
+ assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
+ switch (target_arch.GetMachine())
{
- case llvm::Triple::FreeBSD:
- switch (target_arch.GetMachine())
- {
- case llvm::Triple::arm:
- reg_interface = new RegisterContextFreeBSD_arm(target_arch);
- break;
- case llvm::Triple::ppc:
+ case llvm::Triple::arm:
+ reg_interface = new RegisterContextFreeBSD_arm(target_arch);
+ break;
+ case llvm::Triple::ppc:
#ifndef __powerpc64__
- reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
- break;
+ reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
+ break;
#endif
- case llvm::Triple::ppc64:
- reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
- break;
- case llvm::Triple::mips64:
- reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
- break;
- case llvm::Triple::x86:
- reg_interface = new RegisterContextFreeBSD_i386(target_arch);
- break;
- case llvm::Triple::x86_64:
- reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
- break;
- default:
- break;
- }
+ case llvm::Triple::ppc64:
+ reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
break;
-
- default:
+ case llvm::Triple::mips64:
+ reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
break;
+ case llvm::Triple::x86:
+ reg_interface = new RegisterContextFreeBSD_i386(target_arch);
+ break;
+ case llvm::Triple::x86_64:
+ reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
+ break;
+ default:
+ llvm_unreachable("CPU not supported");
}
- assert(reg_interface && "OS or CPU not supported!");
-
switch (target_arch.GetMachine())
{
case llvm::Triple::aarch64:
More information about the lldb-commits
mailing list