[llvm-branch-commits] [lldb] r259523 - Merging r258919:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 2 08:48:41 PST 2016


Author: hans
Date: Tue Feb  2 10:48:40 2016
New Revision: 259523

URL: http://llvm.org/viewvc/llvm-project?rev=259523&view=rev
Log:
Merging r258919:
------------------------------------------------------------------------
r258919 | bhushan.attarde | 2016-01-27 02:16:30 -0800 (Wed, 27 Jan 2016) | 10 lines

[LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
    
    SUMMARY:
    Get the load address for the address given by symbol and function.
    Earlier, this was done for function only, this patch does it for symbol too.
    This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change.
    
    Reviewers: clayborg
    Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16049
------------------------------------------------------------------------

Added:
    lldb/branches/release_38/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/
      - copied from r258919, lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/
Modified:
    lldb/branches/release_38/   (props changed)
    lldb/branches/release_38/include/lldb/API/SBInstruction.h
    lldb/branches/release_38/packages/Python/lldbsuite/test/lldbtest.py
    lldb/branches/release_38/scripts/interface/SBInstruction.i
    lldb/branches/release_38/source/API/SBInstruction.cpp
    lldb/branches/release_38/source/Target/Target.cpp

Propchange: lldb/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb  2 10:48:40 2016
@@ -1,3 +1,3 @@
 /lldb/branches/apple/python-GIL:156467-162159
 /lldb/branches/iohandler:198360-200250
-/lldb/trunk:257691-257692,257926,258621,258684-258685,258758,258761,259188
+/lldb/trunk:257691-257692,257926,258621,258684-258685,258758,258761,258919,259188

Modified: lldb/branches/release_38/include/lldb/API/SBInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/include/lldb/API/SBInstruction.h?rev=259523&r1=259522&r2=259523&view=diff
==============================================================================
--- lldb/branches/release_38/include/lldb/API/SBInstruction.h (original)
+++ lldb/branches/release_38/include/lldb/API/SBInstruction.h Tue Feb  2 10:48:40 2016
@@ -60,6 +60,9 @@ public:
     bool
     DoesBranch ();
 
+    bool
+    HasDelaySlot ();
+
     void
     Print (FILE *out);
 

Modified: lldb/branches/release_38/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/packages/Python/lldbsuite/test/lldbtest.py?rev=259523&r1=259522&r2=259523&view=diff
==============================================================================
--- lldb/branches/release_38/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/branches/release_38/packages/Python/lldbsuite/test/lldbtest.py Tue Feb  2 10:48:40 2016
@@ -633,6 +633,14 @@ def check_list_or_lambda(list_or_lambda,
     else:
         return list_or_lambda is None or value is None or list_or_lambda == value
 
+def matchArchitectures(archs, actual_arch):
+    retype = type(re.compile('hello, world'))
+    list_passes = isinstance(archs, list) and actual_arch in archs
+    basestring_passes = isinstance(archs, basestring) and actual_arch == archs
+    regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch)
+
+    return (list_passes or basestring_passes or regex_passes)
+
 # provide a function to xfail on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and thus means for all
 # for example,
@@ -1026,7 +1034,7 @@ def skipUnlessHostPlatform(oslist):
     return unittest2.skipUnless(getHostPlatform() in oslist,
                                 "requires on of %s" % (", ".join(oslist)))
 
-def skipUnlessArch(archlist):
+def skipUnlessArch(archs):
     """Decorate the item to skip tests unless running on one of the listed architectures."""
     def myImpl(func):
         if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -1035,9 +1043,8 @@ def skipUnlessArch(archlist):
         @wraps(func)
         def wrapper(*args, **kwargs):
             self = args[0]
-            if self.getArchitecture() not in archlist:
-                self.skipTest("skipping for architecture %s (requires one of %s)" % 
-                    (self.getArchitecture(), ", ".join(archlist)))
+            if not matchArchitectures(archs, self.getArchitecture()):
+                self.skipTest("skipping for architecture %s" % (self.getArchitecture())) 
             else:
                 func(*args, **kwargs)
         return wrapper

Modified: lldb/branches/release_38/scripts/interface/SBInstruction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/scripts/interface/SBInstruction.i?rev=259523&r1=259522&r2=259523&view=diff
==============================================================================
--- lldb/branches/release_38/scripts/interface/SBInstruction.i (original)
+++ lldb/branches/release_38/scripts/interface/SBInstruction.i Tue Feb  2 10:48:40 2016
@@ -51,6 +51,9 @@ public:
     bool
     DoesBranch ();
 
+    bool
+    HasDelaySlot ();
+
     void
     Print (FILE *out);
 

Modified: lldb/branches/release_38/source/API/SBInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/API/SBInstruction.cpp?rev=259523&r1=259522&r2=259523&view=diff
==============================================================================
--- lldb/branches/release_38/source/API/SBInstruction.cpp (original)
+++ lldb/branches/release_38/source/API/SBInstruction.cpp Tue Feb  2 10:48:40 2016
@@ -160,6 +160,14 @@ SBInstruction::DoesBranch ()
     return false;
 }
 
+bool
+SBInstruction::HasDelaySlot ()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->HasDelaySlot ();
+    return false;
+}
+
 void
 SBInstruction::SetOpaque (const lldb::InstructionSP &inst_sp)
 {

Modified: lldb/branches/release_38/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Target/Target.cpp?rev=259523&r1=259522&r2=259523&view=diff
==============================================================================
--- lldb/branches/release_38/source/Target/Target.cpp (original)
+++ lldb/branches/release_38/source/Target/Target.cpp Tue Feb  2 10:48:40 2016
@@ -2442,18 +2442,18 @@ Target::GetBreakableLoadAddress (lldb::a
             SymbolContext sc;
             uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
             temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc);
+            Address sym_addr;
             if (sc.function)
-            {
-                function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
-                if (function_start == LLDB_INVALID_ADDRESS)
-                    function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
-            }
+                sym_addr = sc.function->GetAddressRange().GetBaseAddress();
             else if (sc.symbol)
-            {
-                Address sym_addr = sc.symbol->GetAddress();
+                sym_addr = sc.symbol->GetAddress();
+
+            function_start = sym_addr.GetLoadAddress(this);
+            if (function_start == LLDB_INVALID_ADDRESS)
                 function_start = sym_addr.GetFileAddress();
-            }
-            current_offset = addr - function_start;
+
+            if (function_start)
+                current_offset = addr - function_start;
         }
 
         // If breakpoint address is start of function then we dont have to do anything.




More information about the llvm-branch-commits mailing list