[Lldb-commits] [lldb] r237306 - Add AArch64 and MIPS breakpoint opcodes and sort cases

Ed Maste emaste at freebsd.org
Wed May 13 15:40:01 PDT 2015


Author: emaste
Date: Wed May 13 17:40:01 2015
New Revision: 237306

URL: http://llvm.org/viewvc/llvm-project?rev=237306&view=rev
Log:
Add AArch64 and MIPS breakpoint opcodes and sort cases

New opcodes from PlatformLinux.cpp

Modified:
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237306&r1=237305&r2=237306&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 17:40:01 2015
@@ -591,18 +591,23 @@ PlatformFreeBSD::GetSoftwareBreakpointTr
     default:
         assert(false && "Unhandled architecture in PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode()");
         break;
+    case llvm::Triple::aarch64:
+        {
+            static const uint8_t g_aarch64_opcode[] = { 0x00, 0x00, 0x20, 0xd4 };
+            trap_opcode = g_aarch64_opcode;
+            trap_opcode_size = sizeof(g_aarch64_opcode);
+        }
     case llvm::Triple::arm:
         {
             static const uint8_t g_arm_opcode[] = { 0xfe, 0xde, 0xff, 0xe7 };
             trap_opcode = g_arm_opcode;
             trap_opcode_size = sizeof(g_arm_opcode);
         }
-    case llvm::Triple::x86:
-    case llvm::Triple::x86_64:
+    case llvm::Triple::mips64:
         {
-            static const uint8_t g_i386_opcode[] = { 0xCC };
-            trap_opcode = g_i386_opcode;
-            trap_opcode_size = sizeof(g_i386_opcode);
+            static const uint8_t g_hex_opcode[] = { 0x00, 0x00, 0x00, 0x0d };
+            trap_opcode = g_hex_opcode;
+            trap_opcode_size = sizeof(g_hex_opcode);
         }
         break;
     case llvm::Triple::ppc:
@@ -612,11 +617,18 @@ PlatformFreeBSD::GetSoftwareBreakpointTr
             trap_opcode = g_ppc_opcode;
             trap_opcode_size = sizeof(g_ppc_opcode);
         }
+    case llvm::Triple::x86:
+    case llvm::Triple::x86_64:
+        {
+            static const uint8_t g_i386_opcode[] = { 0xCC };
+            trap_opcode = g_i386_opcode;
+            trap_opcode_size = sizeof(g_i386_opcode);
+        }
+        break;
     }
 
     if (bp_site->SetTrapOpcode(trap_opcode, trap_opcode_size))
         return trap_opcode_size;
-
     return 0;
 }
 





More information about the lldb-commits mailing list