[Lldb-commits] [lldb] r140591 - in /lldb/trunk: examples/python/symbolicate-crash.py include/lldb/API/SBInstruction.h include/lldb/Core/Disassembler.h scripts/Python/interface/SBInstruction.i source/API/SBInstruction.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.h

Greg Clayton gclayton at apple.com
Mon Sep 26 17:58:45 PDT 2011


Author: gclayton
Date: Mon Sep 26 19:58:45 2011
New Revision: 140591

URL: http://llvm.org/viewvc/llvm-project?rev=140591&view=rev
Log:
Fixed the public and internal disassembler API to be named correctly:

const char *
SBInstruction::GetMnemonic()

const char *
SBInstruction::GetOperands()

const char *
SBInstruction::GetComment()

Fixed the symbolicate example script and the internals.


Modified:
    lldb/trunk/examples/python/symbolicate-crash.py
    lldb/trunk/include/lldb/API/SBInstruction.h
    lldb/trunk/include/lldb/Core/Disassembler.h
    lldb/trunk/scripts/Python/interface/SBInstruction.i
    lldb/trunk/source/API/SBInstruction.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h

Modified: lldb/trunk/examples/python/symbolicate-crash.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolicate-crash.py?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/examples/python/symbolicate-crash.py (original)
+++ lldb/trunk/examples/python/symbolicate-crash.py Mon Sep 26 19:58:45 2011
@@ -236,11 +236,11 @@
         inst_pc = inst.GetAddress().GetLoadAddress(target);
         if pc == inst_pc:
             pc_index = inst_idx
-        opcode_name = inst.GetOpcodeName(target)
-        mnemonics =  inst.GetMnemonics(target)
-        comment =  inst.GetComment(target)
-        #data = inst.GetData(target)
-        lines.append ("%#16.16x: %8s %s" % (inst_pc, opcode_name, mnemonics))
+        mnemonic = inst.GetMnemonic (target)
+        operands =  inst.GetOperands (target)
+        comment =  inst.GetComment (target)
+        #data = inst.GetData (target)
+        lines.append ("%#16.16x: %8s %s" % (inst_pc, mnemonic, operands))
         if comment:
             line_len = len(lines[-1])
             if line_len < comment_column:

Modified: lldb/trunk/include/lldb/API/SBInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBInstruction.h (original)
+++ lldb/trunk/include/lldb/API/SBInstruction.h Mon Sep 26 19:58:45 2011
@@ -42,10 +42,10 @@
     GetAddress();
     
     const char *
-    GetOpcodeName (lldb::SBTarget target);
+    GetMnemonic (lldb::SBTarget target);
 
     const char *
-    GetMnemonics (lldb::SBTarget target);
+    GetOperands (lldb::SBTarget target);
     
     const char *
     GetComment (lldb::SBTarget target);

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Mon Sep 26 19:58:45 2011
@@ -42,17 +42,17 @@
     }
     
     const char *
-    GetOpcodeName (ExecutionContextScope *exe_scope)
+    GetMnemonic (ExecutionContextScope *exe_scope)
     {
         if (m_opcode_name.empty())
-            CalculateOpcodeName(exe_scope);
+            CalculateMnemonic(exe_scope);
         return m_opcode_name.c_str();
     }
     const char *
-    GetMnemonics (ExecutionContextScope *exe_scope)
+    GetOperands (ExecutionContextScope *exe_scope)
     {
         if (m_mnemocics.empty())
-            CalculateMnemonics(exe_scope);
+            CalculateOperands(exe_scope);
         return m_mnemocics.c_str();
     }
     
@@ -65,10 +65,10 @@
     }
 
     virtual void
-    CalculateOpcodeName (ExecutionContextScope *exe_scope) = 0;
+    CalculateMnemonic (ExecutionContextScope *exe_scope) = 0;
     
     virtual void
-    CalculateMnemonics (ExecutionContextScope *exe_scope) = 0;
+    CalculateOperands (ExecutionContextScope *exe_scope) = 0;
     
     virtual void
     CalculateComment (ExecutionContextScope *exe_scope) = 0;
@@ -199,13 +199,13 @@
     DoesBranch () const;
 
     virtual void
-    CalculateOpcodeName(ExecutionContextScope *exe_scope)
+    CalculateMnemonic(ExecutionContextScope *exe_scope)
     {
         // TODO: fill this in and put opcode name into Instruction::m_opcode_name
     }
     
     virtual void
-    CalculateMnemonics(ExecutionContextScope *exe_scope)
+    CalculateOperands(ExecutionContextScope *exe_scope)
     {
         // TODO: fill this in and put opcode name into Instruction::m_mnemonics
     }

Modified: lldb/trunk/scripts/Python/interface/SBInstruction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBInstruction.i?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBInstruction.i (original)
+++ lldb/trunk/scripts/Python/interface/SBInstruction.i Mon Sep 26 19:58:45 2011
@@ -31,10 +31,10 @@
     GetAddress();
 
     const char *
-    GetOpcodeName (lldb::SBTarget target);
+    GetMnemonic (lldb::SBTarget target);
     
     const char *
-    GetMnemonics (lldb::SBTarget target);
+    GetOperands (lldb::SBTarget target);
     
     const char *
     GetComment (lldb::SBTarget target);

Modified: lldb/trunk/source/API/SBInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/source/API/SBInstruction.cpp (original)
+++ lldb/trunk/source/API/SBInstruction.cpp Mon Sep 26 19:58:45 2011
@@ -69,7 +69,7 @@
 }
 
 const char *
-SBInstruction::GetOpcodeName(SBTarget target)
+SBInstruction::GetMnemonic(SBTarget target)
 {
     if (m_opaque_sp)
     {        
@@ -81,13 +81,13 @@
             target->CalculateExecutionContext (exe_ctx);
             exe_ctx.SetProcessSP(target->GetProcessSP());
         }
-        return m_opaque_sp->GetOpcodeName(exe_ctx.GetBestExecutionContextScope());
+        return m_opaque_sp->GetMnemonic(exe_ctx.GetBestExecutionContextScope());
     }
     return NULL;
 }
 
 const char *
-SBInstruction::GetMnemonics(SBTarget target)
+SBInstruction::GetOperands(SBTarget target)
 {
     if (m_opaque_sp)
     {
@@ -99,7 +99,7 @@
             target->CalculateExecutionContext (exe_ctx);
             exe_ctx.SetProcessSP(target->GetProcessSP());
         }
-        return m_opaque_sp->GetMnemonics(exe_ctx.GetBestExecutionContextScope());
+        return m_opaque_sp->GetOperands(exe_ctx.GetBestExecutionContextScope());
     }
     return NULL;
 }

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Mon Sep 26 19:58:45 2011
@@ -430,7 +430,7 @@
 }
 
 void
-InstructionLLVM::CalculateOpcodeName (ExecutionContextScope *exe_scope)
+InstructionLLVM::CalculateMnemonic (ExecutionContextScope *exe_scope)
 {
     const int num_tokens = EDNumTokens(m_inst);
     if (num_tokens > 0)
@@ -554,17 +554,17 @@
 }
 
 void
-InstructionLLVM::CalculateMnemonics(ExecutionContextScope *exe_scope)
+InstructionLLVM::CalculateOperands(ExecutionContextScope *exe_scope)
 {
-    // Do all of the work in CalculateOpcodeName()
-    CalculateOpcodeName (exe_scope);
+    // Do all of the work in CalculateMnemonic()
+    CalculateMnemonic (exe_scope);
 }
 
 void
 InstructionLLVM::CalculateComment(ExecutionContextScope *exe_scope)
 {
-    // Do all of the work in CalculateOpcodeName()
-    CalculateOpcodeName (exe_scope);    
+    // Do all of the work in CalculateMnemonic()
+    CalculateMnemonic (exe_scope);    
 }
 
 bool

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h?rev=140591&r1=140590&r2=140591&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h Mon Sep 26 19:58:45 2011
@@ -44,10 +44,10 @@
             uint32_t data_offset);
     
     virtual void
-    CalculateOpcodeName (lldb_private::ExecutionContextScope *exe_scope);
+    CalculateMnemonic (lldb_private::ExecutionContextScope *exe_scope);
     
     virtual void
-    CalculateMnemonics (lldb_private::ExecutionContextScope *exe_scope);
+    CalculateOperands (lldb_private::ExecutionContextScope *exe_scope);
     
     virtual void
     CalculateComment (lldb_private::ExecutionContextScope *exe_scope);





More information about the lldb-commits mailing list