[llvm-branch-commits] [lldb] r260236 - Merging r260072:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 9 09:00:55 PST 2016


Author: hans
Date: Tue Feb  9 11:00:55 2016
New Revision: 260236

URL: http://llvm.org/viewvc/llvm-project?rev=260236&view=rev
Log:
Merging r260072:
------------------------------------------------------------------------
r260072 | bhushan.attarde | 2016-02-07 20:35:51 -0800 (Sun, 07 Feb 2016) | 9 lines

[LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS
    
    SUMMARY:
    This patch fixes TestExpressionInSyscall.py and solves bug 23659 for MIPS.
    Corrected indentation at couple of places.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16916
------------------------------------------------------------------------

Modified:
    lldb/branches/release_38/   (props changed)
    lldb/branches/release_38/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
    lldb/branches/release_38/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp

Propchange: lldb/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb  9 11:00:55 2016
@@ -1,3 +1,3 @@
 /lldb/branches/apple/python-GIL:156467-162159
 /lldb/branches/iohandler:198360-200250
-/lldb/trunk:257691-257692,257926,258485,258621,258684-258685,258758,258761,258919,258967,259188
+/lldb/trunk:257691-257692,257926,258485,258621,258684-258685,258758,258761,258919,258967,259188,260072

Modified: lldb/branches/release_38/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=260236&r1=260235&r2=260236&view=diff
==============================================================================
--- lldb/branches/release_38/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/branches/release_38/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Tue Feb  9 11:00:55 2016
@@ -242,16 +242,27 @@ ABISysV_mips::PrepareTrivialCall (Thread
     const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
     const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
     const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
+    const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
 
     if (log)
-    log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
+        log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0);
+
+    /* Write r0 with 0, in case we are stopped in syscall,
+     * such setting prevents automatic decrement of the PC.
+     * This clears the bug 23659 for MIPS.
+    */ 
+    if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0))
+        return false;
+
+    if (log)
+        log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
 
     // Set "sp" to the requested value
     if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp))
         return false;
 
     if (log)
-    log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
+        log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
 
     // Set "ra" to the return address
     if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr))

Modified: lldb/branches/release_38/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=260236&r1=260235&r2=260236&view=diff
==============================================================================
--- lldb/branches/release_38/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/branches/release_38/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Tue Feb  9 11:00:55 2016
@@ -207,16 +207,27 @@ ABISysV_mips64::PrepareTrivialCall (Thre
     const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
     const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
     const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
+    const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
 
     if (log)
-    log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
+        log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0);
+
+    /* Write r0 with 0, in case we are stopped in syscall,
+     * such setting prevents automatic decrement of the PC.
+     * This clears the bug 23659 for MIPS.
+    */ 
+    if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0))
+        return false;
+
+    if (log)
+        log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
 
     // Set "sp" to the requested value
     if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp))
         return false;
 
     if (log)
-    log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
+        log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
 
     // Set "ra" to the return address
     if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr))




More information about the llvm-branch-commits mailing list