[Lldb-commits] [lldb] r130314 - in /lldb/trunk/test: array_types/TestArrayTypes.py bitfields/TestBitfields.py class_static/TestStaticVariables.py class_types/TestClassTypes.py expression_command/test/TestExprs.py foundation/TestObjCMethods.py hello_world/TestHelloWorld.py inferior-crashing/TestInferiorCrashing.py lldbtest.py lldbutil.py objc-stepping/TestObjCStepping.py python_api/lldbutil/TestPrintStackTraces.py python_api/process/TestProcessAPI.py

Johnny Chen johnny.chen at apple.com
Wed Apr 27 10:43:07 PDT 2011


Author: johnny
Date: Wed Apr 27 12:43:07 2011
New Revision: 130314

URL: http://llvm.org/viewvc/llvm-project?rev=130314&view=rev
Log:
Change the rest of lldbutil.py's function names to all lower case formats to be consistent.
And modify the test cases accordingly.

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/bitfields/TestBitfields.py
    lldb/trunk/test/class_static/TestStaticVariables.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/foundation/TestObjCMethods.py
    lldb/trunk/test/hello_world/TestHelloWorld.py
    lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/lldbutil.py
    lldb/trunk/test/objc-stepping/TestObjCStepping.py
    lldb/trunk/test/python_api/lldbutil/TestPrintStackTraces.py
    lldb/trunk/test/python_api/process/TestProcessAPI.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Wed Apr 27 12:43:07 2011
@@ -124,9 +124,9 @@
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # Sanity check the print representation of thread.
         thr = repr(thread)
@@ -201,15 +201,15 @@
 
         # Last, check that "long_6" has a value type of eValueTypeVariableLocal
         # and "argc" has eValueTypeVariableArgument.
-        from lldbutil import ValueTypeString
+        from lldbutil import value_type_to_str
         self.assertTrue(variable.GetValueType() == lldb.eValueTypeVariableLocal,
                         "Variable 'long_6' should have '%s' value type." %
-                        ValueTypeString(lldb.eValueTypeVariableLocal))
+                        value_type_to_str(lldb.eValueTypeVariableLocal))
         argc = frame.FindVariable("argc")
         self.DebugSBValue(frame, argc)
         self.assertTrue(argc.GetValueType() == lldb.eValueTypeVariableArgument,
                         "Variable 'argc' should have '%s' value type." %
-                        ValueTypeString(lldb.eValueTypeVariableArgument))
+                        value_type_to_str(lldb.eValueTypeVariableArgument))
 
 
 if __name__ == '__main__':

Modified: lldb/trunk/test/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bitfields/TestBitfields.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/bitfields/TestBitfields.py Wed Apr 27 12:43:07 2011
@@ -100,9 +100,9 @@
         # The stop reason of the thread should be breakpoint.
         thread = target.GetProcess().GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # The breakpoint should have a hit count of 1.
         self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)

Modified: lldb/trunk/test/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_static/TestStaticVariables.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/class_static/TestStaticVariables.py Wed Apr 27 12:43:07 2011
@@ -88,9 +88,9 @@
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # Get the SBValue of 'A::g_points' and 'g_points'.
         frame = thread.GetFrameAtIndex(0)

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Wed Apr 27 12:43:07 2011
@@ -129,14 +129,14 @@
         if self.process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.StateTypeString(self.process.GetState()))
+                      lldbutil.state_type_to_str(self.process.GetState()))
 
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # The filename of frame #0 should be 'main.cpp' and the line number
         # should be 93.

Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Wed Apr 27 12:43:07 2011
@@ -109,14 +109,14 @@
         if self.process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.StateTypeString(self.process.GetState()))
+                      lldbutil.state_type_to_str(self.process.GetState()))
 
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # The filename of frame #0 should be 'main.cpp' and function is main.
         self.expect(lldbutil.get_filenames(thread)[0],

Modified: lldb/trunk/test/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/foundation/TestObjCMethods.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/foundation/TestObjCMethods.py Wed Apr 27 12:43:07 2011
@@ -220,9 +220,9 @@
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # Make sure we stopped at the first breakpoint.
 

Modified: lldb/trunk/test/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/hello_world/TestHelloWorld.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/hello_world/TestHelloWorld.py Wed Apr 27 12:43:07 2011
@@ -71,9 +71,9 @@
 
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # The breakpoint should have a hit count of 1.
         self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)

Modified: lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py Wed Apr 27 12:43:07 2011
@@ -64,7 +64,7 @@
         if self.process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.StateTypeString(self.process.GetState()))
+                      lldbutil.state_type_to_str(self.process.GetState()))
 
         thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonException)
         if not thread:

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Wed Apr 27 12:43:07 2011
@@ -863,7 +863,7 @@
             thread = process.GetThreadAtIndex(0)
             SR = thread.GetStopReason()
             with recording(self, trace) as sbuf:
-                print >> sbuf, "StopReason =", StopReasonString(SR)
+                print >> sbuf, "StopReason =", stop_reason_to_str(SR)
 
             if SR == StopReasonEnum("Breakpoint"):
                 frame = thread.GetFrameAtIndex(0)
@@ -932,7 +932,7 @@
 
     def DebugSBValue(self, frame, val):
         """Debug print a SBValue object, if traceAlways is True."""
-        from lldbutil import ValueTypeString
+        from lldbutil import value_type_to_str
 
         if not traceAlways:
             return
@@ -943,7 +943,7 @@
         err.write('\t' + "ByteSize      -> " + str(val.GetByteSize())       + '\n')
         err.write('\t' + "NumChildren   -> " + str(val.GetNumChildren())    + '\n')
         err.write('\t' + "Value         -> " + str(val.GetValue(frame))     + '\n')
-        err.write('\t' + "ValueType     -> " + ValueTypeString(val.GetValueType()) + '\n')
+        err.write('\t' + "ValueType     -> " + value_type_to_str(val.GetValueType()) + '\n')
         err.write('\t' + "Summary       -> " + str(val.GetSummary(frame))   + '\n')
         err.write('\t' + "IsPointerType -> " + str(val.TypeIsPointerType()) + '\n')
         err.write('\t' + "Location      -> " + val.GetLocation(frame)       + '\n')

Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Wed Apr 27 12:43:07 2011
@@ -166,7 +166,7 @@
 # Convert some enum value to its string counterpart
 # =================================================
 
-def StateTypeString(enum):
+def state_type_to_str(enum):
     """Returns the stateType string given an enum."""
     if enum == lldb.eStateInvalid:
         return "invalid"
@@ -195,7 +195,7 @@
     else:
         raise Exception("Unknown StateType enum")
 
-def StopReasonString(enum):
+def stop_reason_to_str(enum):
     """Returns the stopReason string given an enum."""
     if enum == lldb.eStopReasonInvalid:
         return "invalid"
@@ -216,7 +216,7 @@
     else:
         raise Exception("Unknown StopReason enum")
 
-def ValueTypeString(enum):
+def value_type_to_str(enum):
     """Returns the valueType string given an enum."""
     if enum == lldb.eValueTypeInvalid:
         return "invalid"
@@ -404,7 +404,7 @@
     addrs = get_pc_addresses(thread)
 
     if thread.GetStopReason() != lldb.eStopReasonInvalid:
-        desc =  "stop reason=" + StopReasonString(thread.GetStopReason())
+        desc =  "stop reason=" + stop_reason_to_str(thread.GetStopReason())
     else:
         desc = ""
     print >> output, "Stack trace for thread id={0:#x} name={1} queue={2} ".format(

Modified: lldb/trunk/test/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-stepping/TestObjCStepping.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/objc-stepping/TestObjCStepping.py (original)
+++ lldb/trunk/test/objc-stepping/TestObjCStepping.py Wed Apr 27 12:43:07 2011
@@ -71,9 +71,9 @@
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
-            from lldbutil import StopReasonString
+            from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
-                      StopReasonString(thread.GetStopReason()))
+                      stop_reason_to_str(thread.GetStopReason()))
 
         # Make sure we stopped at the first breakpoint.
 

Modified: lldb/trunk/test/python_api/lldbutil/TestPrintStackTraces.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/TestPrintStackTraces.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/TestPrintStackTraces.py (original)
+++ lldb/trunk/test/python_api/lldbutil/TestPrintStackTraces.py Wed Apr 27 12:43:07 2011
@@ -44,7 +44,7 @@
         if self.process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.StateTypeString(self.process.GetState()))
+                      lldbutil.state_type_to_str(self.process.GetState()))
 
         if self.TraceOn():
             lldbutil.print_stacktraces(self.process)

Modified: lldb/trunk/test/python_api/process/TestProcessAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/TestProcessAPI.py?rev=130314&r1=130313&r2=130314&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Wed Apr 27 12:43:07 2011
@@ -5,7 +5,7 @@
 import os, time
 import unittest2
 import lldb
-from lldbutil import get_stopped_thread, StateTypeString
+from lldbutil import get_stopped_thread, state_type_to_str
 from lldbtest import *
 
 class ProcessAPITestCase(TestBase):
@@ -258,7 +258,7 @@
         process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
         if self.TraceOn():
-            print "process state:", StateTypeString(process.GetState())
+            print "process state:", state_type_to_str(process.GetState())
         self.assertTrue(process.GetState() != lldb.eStateConnected)
 
         success = process.RemoteLaunch(None, None, None, None, None, None, 0, False, error)





More information about the lldb-commits mailing list