[Lldb-commits] [lldb] r244875 - Set orig_eax to -1 for Linux x86 platforms

2015-08-13 Thread Ravitheja Addepally via lldb-commits
Author: ravitheja
Date: Thu Aug 13 04:05:11 2015
New Revision: 244875

URL: http://llvm.org/viewvc/llvm-project?rev=244875&view=rev
Log:
Set orig_eax to -1 for Linux x86 platforms

Summary:
For Linux x86 based environments the orig_eax/orig_rax
register should be set to -1 to prevent the instruction pointer
to be decremented, which was the cause for the SIGILL exception.

Fix for Bug 23659

Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg

Subscribers: clayborg, labath

Differential Revision: http://reviews.llvm.org/D11411

Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h

lldb/trunk/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=244875&r1=244874&r2=244875&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Thu Aug 13 04:05:11 2015
@@ -706,6 +706,34 @@ NativeRegisterContextLinux_x86_64::ReadA
 assert (false && "how do we save the floating point registers?");
 error.SetErrorString ("unsure how to save the floating point 
registers");
 }
+/** The following code is specific to Linux x86 based architectures,
+ *  where the register orig_eax (32 bit)/orig_rax (64 bit) is set to
+ *  -1 to solve the bug 23659, such a setting prevents the automatic
+ *  decrement of the instruction pointer which was causing the SIGILL
+ *  exception.
+ * **/
+llvm::Triple t_triple = 
GetRegisterInfoInterface().GetTargetArchitecture().GetTriple();
+
+if (t_triple.getOS() == llvm::Triple::Linux &&
+   (t_triple.getArch() == llvm::Triple::x86 ||
+t_triple.getArch() == llvm::Triple::x86_64))
+{
+RegisterValue value((uint64_t) -1);
+const RegisterInfo *reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_eax");
+if (reg_info == nullptr)
+reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_rax");
+
+if (reg_info != nullptr) {
+NativeProcessProtocolSP process_sp(m_thread.GetProcess());
+if (!process_sp)
+return Error("NativeProcessProtocol is NULL");
+
+NativeProcessLinux* process_p = 
static_cast(process_sp.get());
+return process_p->DoOperation([&] {
+return 
DoWriteRegisterValue(reg_info->byte_offset,reg_info->name,value);
+});
+}
+}
 
 return error;
 }

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp?rev=244875&r1=244874&r2=244875&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp Thu 
Aug 13 04:05:11 2015
@@ -26,7 +26,7 @@ struct GPR
 uint32_t es;
 uint32_t fs;
 uint32_t gs;
-uint32_t orig_ax;
+uint32_t orig_eax;
 uint32_t eip;
 uint32_t cs;
 uint32_t eflags;
@@ -98,6 +98,9 @@ struct UserArea
 RegisterContextLinux_i386::RegisterContextLinux_i386(const ArchSpec 
&target_arch) :
 RegisterInfoInterface(target_arch)
 {
+RegisterInfo orig_ax = { "orig_eax", NULL, sizeof(((GPR*)NULL)->orig_eax), 
(LLVM_EXTENSION offsetof(GPR, orig_eax)), eEncodingUint, \
+  eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, 
LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL };
+d_register_infos.push_back(orig_ax);
 }
 
 size_t
@@ -131,3 +134,9 @@ RegisterContextLinux_i386::GetUserRegist
 {
 return static_cast (k_num_user_registers_i386);
 }
+
+const std::vector *
+RegisterContextLinux_i386::GetDynamicRegisterInfoP() const
+{
+return &d_register_infos;
+}

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h?rev=244875&r1=244874&r2=244875&view=diff

Re: [Lldb-commits] [PATCH] D11930: [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-13 Thread Bhushan Attarde via lldb-commits
bhushan updated this revision to Diff 32038.
bhushan added a comment.

Addresses review comments. (Initialized variables with default values).


Repository:
  rL LLVM

http://reviews.llvm.org/D11930

Files:
  source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

Index: source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
===
--- source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -424,14 +424,15 @@
 return return_valobj_sp;
 
 bool is_signed;
+bool is_complex = false;
+uint32_t count = 0;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@
 uint32_t ptr = 
thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & 
UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that 
memory is passed in r2. 
+uint64_t mem_address = 
reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, 
NULL),
+  return_clang_type);
+return return_valobj_sp;
+}
+else if (return_clang_type.IsFloatingPointType (count, is_complex))
+{
+const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
+const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+
+if (count == 1 && !is_complex)
+{
+switch (bit_width)
+{
+default:
+return return_valobj_sp;
+case 64:
+{
+static_assert(sizeof(double) == sizeof(uint64_t), "");
+uint64_t raw_value;
+raw_value = reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & 
UINT32_MAX;
+raw_value |= 
((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(f1_info, 0) & UINT32_MAX)) << 32;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+case 32:
+{
+static_assert(sizeof(float) == sizeof(uint32_t), "");
+uint32_t raw_value = 
reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & UINT32_MAX;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+}
+}
+else
+{
+// not handled yet
+return return_valobj_sp;
+}
+}
 else
 {
 // not handled yet


Index: source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
===
--- source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -424,14 +424,15 @@
 return return_valobj_sp;
 
 bool is_signed;
+bool is_complex = false;
+uint32_t count = 0;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@
 uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that memory is passed in r2. 
+uint64_t mem_address = reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, NULL),
+  return_clang_type);
+return return_valobj_sp;
+}
+else if (return_clang_type.IsFloatingPointType (count, is_complex))
+{
+   

[Lldb-commits] [lldb] r244877 - Fix Linux build after r244875

2015-08-13 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Aug 13 04:19:27 2015
New Revision: 244877

URL: http://llvm.org/viewvc/llvm-project?rev=244877&view=rev
Log:
Fix Linux build after r244875

Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=244877&r1=244876&r2=244877&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Thu Aug 13 04:19:27 2015
@@ -723,16 +723,8 @@ NativeRegisterContextLinux_x86_64::ReadA
 if (reg_info == nullptr)
 reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_rax");
 
-if (reg_info != nullptr) {
-NativeProcessProtocolSP process_sp(m_thread.GetProcess());
-if (!process_sp)
-return Error("NativeProcessProtocol is NULL");
-
-NativeProcessLinux* process_p = 
static_cast(process_sp.get());
-return process_p->DoOperation([&] {
-return 
DoWriteRegisterValue(reg_info->byte_offset,reg_info->name,value);
-});
-}
+if (reg_info != nullptr)
+return 
DoWriteRegisterValue(reg_info->byte_offset,reg_info->name,value);
 }
 
 return error;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244881 - Add missing include to RegisterInfoInterface.h

2015-08-13 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Aug 13 05:41:55 2015
New Revision: 244881

URL: http://llvm.org/viewvc/llvm-project?rev=244881&view=rev
Log:
Add missing include to RegisterInfoInterface.h

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h?rev=244881&r1=244880&r2=244881&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h Thu Aug 
13 05:41:55 2015
@@ -10,6 +10,8 @@
 #ifndef lldb_RegisterInfoInterface_h
 #define lldb_RegisterInfoInterface_h
 
+#include 
+
 #include "lldb/Core/ArchSpec.h"
 
 namespace lldb_private


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244886 - Removing redundant check from r244875

2015-08-13 Thread Ravitheja Addepally via lldb-commits
Author: ravitheja
Date: Thu Aug 13 06:53:23 2015
New Revision: 244886

URL: http://llvm.org/viewvc/llvm-project?rev=244886&view=rev
Log:
Removing redundant check from r244875

Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=244886&r1=244885&r2=244886&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Thu Aug 13 06:53:23 2015
@@ -712,20 +712,14 @@ NativeRegisterContextLinux_x86_64::ReadA
  *  decrement of the instruction pointer which was causing the SIGILL
  *  exception.
  * **/
-llvm::Triple t_triple = 
GetRegisterInfoInterface().GetTargetArchitecture().GetTriple();
 
-if (t_triple.getOS() == llvm::Triple::Linux &&
-   (t_triple.getArch() == llvm::Triple::x86 ||
-t_triple.getArch() == llvm::Triple::x86_64))
-{
-RegisterValue value((uint64_t) -1);
-const RegisterInfo *reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_eax");
-if (reg_info == nullptr)
-reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_rax");
+RegisterValue value((uint64_t) -1);
+const RegisterInfo *reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_eax");
+if (reg_info == nullptr)
+reg_info = 
GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_rax");
 
-if (reg_info != nullptr)
-return 
DoWriteRegisterValue(reg_info->byte_offset,reg_info->name,value);
-}
+if (reg_info != nullptr)
+return 
DoWriteRegisterValue(reg_info->byte_offset,reg_info->name,value);
 
 return error;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11930: [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-13 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good. Feel free to also initialized "is_signed" if you can, no need for 
review on that change.


Repository:
  rL LLVM

http://reviews.llvm.org/D11930



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] FW: [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-13 Thread Hans Wennborg via lldb-commits
Greg: you're the owner here. OK for merging to 3.7?

On Wed, Aug 12, 2015 at 10:22 PM, Jaydeep Patil
 wrote:
> Hi Hans,
>
> Could you please merge it to release branch?
>
> Thanks,
> Jaydeep
>
> -Original Message-
> From: Jaydeep Patil
> Sent: 13 August 2015 AM 09:17
> To: Jaydeep Patil
> Subject: Re: [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet 
> is not supported by target
>
> jaydeep committed rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not 
> supported by target.
>
> [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
>
>   SUMMARY:
>   The patch uses qfThreadID to get the thread IDs if qC packet is not 
> supported by target.
>
>   Reviewers: jingham, clayborg
>   Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>   Differential Revision: http://reviews.llvm.org/D11519
>
>
> Files:
>   
> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>
> Users:
>   jaydeep (Author)
>
> http://reviews.llvm.org/rL244866
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint

2015-08-13 Thread Hans Wennborg via lldb-commits
Greg: you're the owner here. Approved for 3.7?

On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
 wrote:
> Hi Hans,
>
> Could you please merge it to release branch?
>
> Thanks,
> Jaydeep
>
> -Original Message-
> From: Jaydeep Patil
> Sent: 13 August 2015 AM 09:17
> To: Jaydeep Patil
> Subject: Re: [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote 
> stop reply packet for watchpoint
>
> jaydeep committed rL244865: [LLDB][MIPS] Support standard GDB remote stop 
> reply packet for watchpoint.
>
> [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
>
>   SUMMARY:
>   The patch supports TAAwatch:addr packet. The patch also sets 
> m_watchpoints_trigger_after_instruction
>   to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported by 
> the target.
>
>   Reviewers: jingham, clayborg
>   Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>   Differential Revision: http://reviews.llvm.org/D11747
>
>
> Files:
>   
> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>   /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
>   /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>
> Users:
>   jaydeep (Author)
>
> http://reviews.llvm.org/rL244865
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] FW: [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints

2015-08-13 Thread Hans Wennborg via lldb-commits
Greg: you're the owner. Approved for 3.7?

On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
 wrote:
> Hi Hans,
>
> Could you please merge it to release branch?
>
> Thanks,
> Jaydeep
>
> -Original Message-
> From: Jaydeep Patil
> Sent: 13 August 2015 AM 09:15
> To: Jaydeep Patil
> Subject: Re: [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for 
> MIPS hardware watchpoints
>
> jaydeep committed rL244864: [LLDB][MIPS] Handle false positives for MIPS 
> hardware watchpoints.
>
> [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
>
>   SUMMARY:
>   Last 3bits of the watchpoint address are masked by the kernel. For example, 
> n is
>   at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then 
> watch
>   exception is generated even when n is read/written. To handle this case, 
> instruction
>   at PC is emulated to find the base address of the load/store instruction. 
> This address
>   is then appended to the description of the stop-info packet. Client then 
> reads this
>   information to check whether the user has set a watchpoint on this address.
>
>   Reviewers: jingham, clayborg
>   Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>   Differential Revision: http://reviews.llvm.org/D11672
>
>
> Files:
>   /lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h
>   /lldb/trunk/include/lldb/Target/StopInfo.h
>   /lldb/trunk/source/Host/common/NativeRegisterContext.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
>   
> /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
>   /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
>   /lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>   /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>   /lldb/trunk/source/Target/StopInfo.cpp
>
> Users:
>   jaydeep (Author)
>
> http://reviews.llvm.org/rL244864
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints

2015-08-13 Thread Greg Clayton via lldb-commits
Fine to merge.

> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
> 
> Greg: you're the owner. Approved for 3.7?
> 
> On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
>  wrote:
>> Hi Hans,
>> 
>> Could you please merge it to release branch?
>> 
>> Thanks,
>> Jaydeep
>> 
>> -Original Message-
>> From: Jaydeep Patil
>> Sent: 13 August 2015 AM 09:15
>> To: Jaydeep Patil
>> Subject: Re: [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for 
>> MIPS hardware watchpoints
>> 
>> jaydeep committed rL244864: [LLDB][MIPS] Handle false positives for MIPS 
>> hardware watchpoints.
>> 
>> [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
>> 
>>  SUMMARY:
>>  Last 3bits of the watchpoint address are masked by the kernel. For example, 
>> n is
>>  at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then 
>> watch
>>  exception is generated even when n is read/written. To handle this case, 
>> instruction
>>  at PC is emulated to find the base address of the load/store instruction. 
>> This address
>>  is then appended to the description of the stop-info packet. Client then 
>> reads this
>>  information to check whether the user has set a watchpoint on this address.
>> 
>>  Reviewers: jingham, clayborg
>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>  Differential Revision: http://reviews.llvm.org/D11672
>> 
>> 
>> Files:
>>  /lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h
>>  /lldb/trunk/include/lldb/Target/StopInfo.h
>>  /lldb/trunk/source/Host/common/NativeRegisterContext.cpp
>>  /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
>>  /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
>>  
>> /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
>>  /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
>>  /lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>>  /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>>  /lldb/trunk/source/Target/StopInfo.cpp
>> 
>> Users:
>>  jaydeep (Author)
>> 
>> http://reviews.llvm.org/rL244864
>> 
>> 
>> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-13 Thread Greg Clayton via lldb-commits
Fine to merge.

> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
> 
> Greg: you're the owner here. OK for merging to 3.7?
> 
> On Wed, Aug 12, 2015 at 10:22 PM, Jaydeep Patil
>  wrote:
>> Hi Hans,
>> 
>> Could you please merge it to release branch?
>> 
>> Thanks,
>> Jaydeep
>> 
>> -Original Message-
>> From: Jaydeep Patil
>> Sent: 13 August 2015 AM 09:17
>> To: Jaydeep Patil
>> Subject: Re: [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet 
>> is not supported by target
>> 
>> jaydeep committed rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not 
>> supported by target.
>> 
>> [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
>> 
>>  SUMMARY:
>>  The patch uses qfThreadID to get the thread IDs if qC packet is not 
>> supported by target.
>> 
>>  Reviewers: jingham, clayborg
>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>  Differential Revision: http://reviews.llvm.org/D11519
>> 
>> 
>> Files:
>>  
>> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>> 
>> Users:
>>  jaydeep (Author)
>> 
>> http://reviews.llvm.org/rL244866
>> 
>> 
>> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint

2015-08-13 Thread Greg Clayton via lldb-commits
Yes, merging this is fine.

> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
> 
> 
> Greg: you're the owner here. Approved for 3.7?
> 
> On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
>  wrote:
>> Hi Hans,
>> 
>> Could you please merge it to release branch?
>> 
>> Thanks,
>> Jaydeep
>> 
>> -Original Message-
>> From: Jaydeep Patil
>> Sent: 13 August 2015 AM 09:17
>> To: Jaydeep Patil
>> Subject: Re: [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote 
>> stop reply packet for watchpoint
>> 
>> jaydeep committed rL244865: [LLDB][MIPS] Support standard GDB remote stop 
>> reply packet for watchpoint.
>> 
>> [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
>> 
>>  SUMMARY:
>>  The patch supports TAAwatch:addr packet. The patch also sets 
>> m_watchpoints_trigger_after_instruction
>>  to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported by 
>> the target.
>> 
>>  Reviewers: jingham, clayborg
>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>  Differential Revision: http://reviews.llvm.org/D11747
>> 
>> 
>> Files:
>>  
>> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>>  /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
>>  /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>> 
>> Users:
>>  jaydeep (Author)
>> 
>> http://reviews.llvm.org/rL244865
>> 
>> 
>> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244950 - XFAIL Watchpoint tests on Windows.

2015-08-13 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 13 15:49:43 2015
New Revision: 244950

URL: http://llvm.org/viewvc/llvm-project?rev=244950&view=rev
Log:
XFAIL Watchpoint tests on Windows.

https://llvm.org/pr24446 tracks getting these tests re-enabled.

Modified:

lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py

lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
lldb/trunk/test/python_api/watchpoint/TestSetWatchpoint.py
lldb/trunk/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/trunk/test/python_api/watchpoint/TestWatchpointIter.py

lldb/trunk/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/trunk/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py

Modified: 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=244950&r1=244949&r2=244950&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 Thu Aug 13 15:49:43 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test lldb watchpoint that uses '-s size' to watch a pointed location with size.
 """
 
@@ -24,6 +24,7 @@ class HelloWatchLocationTestCase(TestBas
 @expectedFailureFreeBSD("llvm.org/pr18832")
 @dwarf_test
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_hello_watchlocation_with_dwarf(self):
 """Test watching a location with '-s size' option."""
 self.buildDwarf(dictionary=self.d)

Modified: 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=244950&r1=244949&r2=244950&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 Thu Aug 13 15:49:43 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test that lldb watchpoint works for multiple threads.
 """
 
@@ -23,6 +23,7 @@ class WatchpointForMultipleThreadsTestCa
 
 @dwarf_test
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_watchpoint_multiple_threads_with_dwarf(self):
 """Test that lldb watchpoint works for multiple threads."""
 self.buildDwarf()
@@ -39,6 +40,7 @@ class WatchpointForMultipleThreadsTestCa
 
 @dwarf_test
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def 
test_watchpoint_multiple_threads_wp_set_and_then_delete_with_dwarf(self):
 """Test that lldb watchpoint works for multiple threads, and after the 
watchpoint is deleted, the watchpoint event should no longer fires."""
 self.buildDwarf()

Modified: 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py?rev=244950&r1=244949&r2=244950&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
 Thu Aug 13 15:49:43 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test watchpoint list, enable, disable, and delete commands.
 """
 
@@ -36,6 +36,7 @@ class WatchpointCommandsTestCase(TestBas
 
 @dwarf_test
 @expectedFailureAndroid(archs=['

[Lldb-commits] [lldb] r244951 - Disable lldb-mi tests on Windows.

2015-08-13 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 13 15:50:17 2015
New Revision: 244951

URL: http://llvm.org/viewvc/llvm-project?rev=244951&view=rev
Log:
Disable lldb-mi tests on Windows.

Most were already XFAIL'ed, but the reason for the XFAIL is that
we don't have a suitable pexpect implementation on Windows.  This
isn't going to change unintentionally, so there is no reason to
XFAIL them as opposed to just skip them.

llvm.org/pr22274 tracks finding a suitable pexpect module for
Windows, which should fix many of these issues.  llvm.org/pr24452
tracks the larger issue of making the entire lldb-mi test suite
work on Windows, of which finding a pexpect module is just one
component.

Modified:
lldb/trunk/test/tools/lldb-mi/TestMiFile.py
lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py
lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py
lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
lldb/trunk/test/tools/lldb-mi/signal/TestMiSignal.py
lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py
lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py
lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py
lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py

Modified: lldb/trunk/test/tools/lldb-mi/TestMiFile.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiFile.py?rev=244951&r1=244950&r2=244951&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/TestMiFile.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiFile.py Thu Aug 13 15:50:17 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test lldb-mi -file-xxx commands.
 """
 
@@ -11,7 +11,7 @@ class MiFileTestCase(lldbmi_testcase.MiT
 mydir = TestBase.compute_mydir(__file__)
 
 @lldbmi_test
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
 def test_lldbmi_file_exec_and_symbols_file(self):
 """Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols 
exe."""
@@ -28,7 +28,7 @@ class MiFileTestCase(lldbmi_testcase.MiT
 self.expect("\*stopped,reason=\"exited-normally\"")
 
 @lldbmi_test
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
 def test_lldbmi_file_exec_and_symbols_absolute_path(self):
 """Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols 
fullpath/exe."""
@@ -47,7 +47,7 @@ class MiFileTestCase(lldbmi_testcase.MiT
 self.expect("\*stopped,reason=\"exited-normally\"")
 
 @lldbmi_test
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
 def test_lldbmi_file_exec_and_symbols_relative_path(self):
 """Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols 
relpath/exe."""
@@ -65,7 +65,7 @@ class MiFileTestCase(lldbmi_testcase.MiT
 self.expect("\*stopped,reason=\"exited-normally\"")
 
 @lldbmi_test
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
 def test_lldbmi_file_exec_and_symbols_unknown_path(self):
 """Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols 
badpath/exe."""

Modified: lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py?rev=244951&r1=244950&r2=244951&view=diff
==
--- lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py Thu Aug 13 15:50:17 
2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test lldb-mi =library-loaded notifications.
 """
 
@@ -11,7 +11,7 @@ class MiLibraryLoadedTestCase(lldbmi_tes
 mydir = TestBase.compute_mydir(__file__)
 
 @lldbmi_test
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+@sk

[Lldb-commits] [lldb] r244963 - Remove Unicode byte-order mark from python files.

2015-08-13 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 13 17:05:54 2015
New Revision: 244963

URL: http://llvm.org/viewvc/llvm-project?rev=244963&view=rev
Log:
Remove Unicode byte-order mark from python files.

This was caused by a bug in the PTVS source file editor, which has
since been fixed and awaiting a new release.  For now people using
this editor need to remember to manually remove this before
committing a file.

Modified:

lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py

lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py

lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
lldb/trunk/test/python_api/watchpoint/TestSetWatchpoint.py
lldb/trunk/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/trunk/test/python_api/watchpoint/TestWatchpointIter.py

lldb/trunk/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/trunk/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
lldb/trunk/test/tools/lldb-mi/TestMiFile.py
lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py
lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py
lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py
lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
lldb/trunk/test/tools/lldb-mi/signal/TestMiSignal.py
lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py
lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py
lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py
lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py
lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py

Modified: 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=244963&r1=244962&r2=244963&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 Thu Aug 13 17:05:54 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test lldb watchpoint that uses '-s size' to watch a pointed location with size.
 """
 

Modified: 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=244963&r1=244962&r2=244963&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 Thu Aug 13 17:05:54 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test that lldb watchpoint works for multiple threads.
 """
 

Modified: 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py?rev=244963&r1=244962&r2=244963&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
 Thu Aug 13 17:05:54 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test watchpoint list, enable, disable, and delete commands.
 """
 

Modified: 
lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py?rev=244963&r1=244962&r2=244963&view=diff
==
--- 
lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
 (original)
+++ 
lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
 Thu Aug 13 17:05:54 2015
@@ -1,4 +1,4 @@
-"""Test that adding, deleting and modifying watchpoints sends the 
appropriate events."""
+"""Test that adding, deleting and modifying watchpoints sends the appropriate 
events."""
 
 import os,

Re: [Lldb-commits] [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints

2015-08-13 Thread Hans Wennborg via lldb-commits
I've merged this in r244964:
http://llvm.org/viewvc/llvm-project?rev=244964&view=rev

There was a merge conflict in ProcessGDBRemote.cpp, so I'd appreciate
if someone could double check that I got it right. I did verify that
it compiles, but I haven't been able to get the tests running on my
machine.

Thanks,
Hans

On Thu, Aug 13, 2015 at 9:54 AM, Greg Clayton  wrote:
> Fine to merge.
>
>> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
>>
>> Greg: you're the owner. Approved for 3.7?
>>
>> On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
>>  wrote:
>>> Hi Hans,
>>>
>>> Could you please merge it to release branch?
>>>
>>> Thanks,
>>> Jaydeep
>>>
>>> -Original Message-
>>> From: Jaydeep Patil
>>> Sent: 13 August 2015 AM 09:15
>>> To: Jaydeep Patil
>>> Subject: Re: [Diffusion] rL244864: [LLDB][MIPS] Handle false positives for 
>>> MIPS hardware watchpoints
>>>
>>> jaydeep committed rL244864: [LLDB][MIPS] Handle false positives for MIPS 
>>> hardware watchpoints.
>>>
>>> [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
>>>
>>>  SUMMARY:
>>>  Last 3bits of the watchpoint address are masked by the kernel. For 
>>> example, n is
>>>  at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then 
>>> watch
>>>  exception is generated even when n is read/written. To handle this case, 
>>> instruction
>>>  at PC is emulated to find the base address of the load/store instruction. 
>>> This address
>>>  is then appended to the description of the stop-info packet. Client then 
>>> reads this
>>>  information to check whether the user has set a watchpoint on this address.
>>>
>>>  Reviewers: jingham, clayborg
>>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>>  Differential Revision: http://reviews.llvm.org/D11672
>>>
>>>
>>> Files:
>>>  /lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h
>>>  /lldb/trunk/include/lldb/Target/StopInfo.h
>>>  /lldb/trunk/source/Host/common/NativeRegisterContext.cpp
>>>  /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
>>>  /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
>>>  
>>> /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
>>>  
>>> /lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
>>>  /lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>>>  /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>>>  /lldb/trunk/source/Target/StopInfo.cpp
>>>
>>> Users:
>>>  jaydeep (Author)
>>>
>>> http://reviews.llvm.org/rL244864
>>>
>>>
>>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint

2015-08-13 Thread Hans Wennborg via lldb-commits
Merged in r244965.

Thanks,
Hans

On Thu, Aug 13, 2015 at 10:48 AM, Greg Clayton  wrote:
> Yes, merging this is fine.
>
>> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
>>
>>
>> Greg: you're the owner here. Approved for 3.7?
>>
>> On Wed, Aug 12, 2015 at 10:21 PM, Jaydeep Patil
>>  wrote:
>>> Hi Hans,
>>>
>>> Could you please merge it to release branch?
>>>
>>> Thanks,
>>> Jaydeep
>>>
>>> -Original Message-
>>> From: Jaydeep Patil
>>> Sent: 13 August 2015 AM 09:17
>>> To: Jaydeep Patil
>>> Subject: Re: [Diffusion] rL244865: [LLDB][MIPS] Support standard GDB remote 
>>> stop reply packet for watchpoint
>>>
>>> jaydeep committed rL244865: [LLDB][MIPS] Support standard GDB remote stop 
>>> reply packet for watchpoint.
>>>
>>> [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
>>>
>>>  SUMMARY:
>>>  The patch supports TAAwatch:addr packet. The patch also sets 
>>> m_watchpoints_trigger_after_instruction
>>>  to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported 
>>> by the target.
>>>
>>>  Reviewers: jingham, clayborg
>>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>>  Differential Revision: http://reviews.llvm.org/D11747
>>>
>>>
>>> Files:
>>>  
>>> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>>>  
>>> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
>>>  /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>>>
>>> Users:
>>>  jaydeep (Author)
>>>
>>> http://reviews.llvm.org/rL244865
>>>
>>>
>>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-13 Thread Hans Wennborg via lldb-commits
Merged in r244967.

Thanks,
Hans

On Thu, Aug 13, 2015 at 9:54 AM, Greg Clayton  wrote:
> Fine to merge.
>
>> On Aug 13, 2015, at 9:33 AM, Hans Wennborg  wrote:
>>
>> Greg: you're the owner here. OK for merging to 3.7?
>>
>> On Wed, Aug 12, 2015 at 10:22 PM, Jaydeep Patil
>>  wrote:
>>> Hi Hans,
>>>
>>> Could you please merge it to release branch?
>>>
>>> Thanks,
>>> Jaydeep
>>>
>>> -Original Message-
>>> From: Jaydeep Patil
>>> Sent: 13 August 2015 AM 09:17
>>> To: Jaydeep Patil
>>> Subject: Re: [Diffusion] rL244866: [LLDB][MIPS] Use qfThreadID if qC packet 
>>> is not supported by target
>>>
>>> jaydeep committed rL244866: [LLDB][MIPS] Use qfThreadID if qC packet is not 
>>> supported by target.
>>>
>>> [LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
>>>
>>>  SUMMARY:
>>>  The patch uses qfThreadID to get the thread IDs if qC packet is not 
>>> supported by target.
>>>
>>>  Reviewers: jingham, clayborg
>>>  Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
>>>  Differential Revision: http://reviews.llvm.org/D11519
>>>
>>>
>>> Files:
>>>  
>>> /lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>>>
>>> Users:
>>>  jaydeep (Author)
>>>
>>> http://reviews.llvm.org/rL244866
>>>
>>>
>>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: chaoren.
zturner added a subscriber: lldb-commits.

New output looks like this:

FAIL: LLDB (suite) :: TestThreadStepOut.py (Windows zturner-win81 8 6.2.9200 
AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)
FAIL: LLDB (suite) :: TestValueAPI.py (Windows zturner-win81 8 6.2.9200 AMD64 
Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)
FAIL: LLDB (suite) :: TestValueMD5Crash.py (Windows zturner-win81 8 6.2.9200 
AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)
FAIL: LLDB (suite) :: TestVectorTypesFormatting.py (Windows zturner-win81 8 
6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)
Unexpected Successes (1)
UNEXPECTED SUCCESS: LLDB (suite) :: TestSettings.py (Windows zturner-win81 8 
6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)
[50856 refs]
ninja: build stopped: subcommand failed.


It is not smart enough to dig into the individual file (TestSettings.py in this 
example) and find out which test passed that was not expected.  That can be 
done as future work if anyone is interested.  The important thing though is 
that unexpected successes currently have zero visibility, so it is hard to tell 
when a change fixes existing broken stuff.

The hope is that surfacing this will lead to more tests being re-enabled.

http://reviews.llvm.org/D12020

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -121,6 +121,7 @@
 def parse_test_results(output):
 passes = 0
 failures = 0
+unexpected_successes = 0
 for result in output:
 pass_count = re.search("^RESULT:.*([0-9]+) passes",
result, re.MULTILINE)
@@ -128,16 +129,20 @@
result, re.MULTILINE)
 error_count = re.search("^RESULT:.*([0-9]+) errors",
 result, re.MULTILINE)
+unexpected_success_count = re.search("^RESULT:.*([0-9]+) unexpected successes",
+ result, re.MULTILINE)
 this_fail_count = 0
 this_error_count = 0
 if pass_count is not None:
 passes = passes + int(pass_count.group(1))
 if fail_count is not None:
 failures = failures + int(fail_count.group(1))
+if unexpected_success_count is not None:
+unexpected_successes = unexpected_successes + int(unexpected_success_count.group(1))
 if error_count is not None:
 failures = failures + int(error_count.group(1))
 pass
-return passes, failures
+return passes, failures, unexpected_successes
 
 
 def call_with_timeout(command, timeout, name):
@@ -161,14 +166,14 @@
stderr=subprocess.PIPE)
 output = process.communicate()
 exit_status = process.returncode
-passes, failures = parse_test_results(output)
+passes, failures, unexpected_successes = parse_test_results(output)
 if exit_status == 0:
 # stdout does not have any useful information from 'dotest.py',
 # only stderr does.
 report_test_pass(name, output[1])
 else:
 report_test_failure(name, command, output[1])
-return name, exit_status, passes, failures
+return name, exit_status, passes, failures, unexpected_successes
 
 
 def process_dir(root, files, test_root, dotest_argv):
@@ -187,17 +192,19 @@
 
 results.append(call_with_timeout(command, timeout, name))
 
-# result = (name, status, passes, failures)
-timed_out = [name for name, status, _, _ in results
+# result = (name, status, passes, failures, unexpected_successes)
+timed_out = [name for name, status, _, _, _ in results
  if status == eTimedOut]
-passed = [name for name, status, _, _ in results
+passed = [name for name, status, _, _, _ in results
   if status == ePassed]
-failed = [name for name, status, _, _ in results
+failed = [name for name, status, _, _, _ in results
   if status != ePassed]
+xpasses = [name for name, status, _, _, unexpected_successes in results if unexpected_successes > 0]
+
 pass_count = sum([result[2] for result in results])
 fail_count = sum([result[3] for result in results])
 
-return (timed_out, passed, failed, pass_count, fail_count)
+return (timed_out, passed, failed, xpasses, pass_count, fail_count)
 
 in_q = None
 out_q = None
@@ -259,10 +266,11 @@
 timed_out = sum([result[0] for result in test_results], [])
 passed = sum([result[1] for result in test_results], [])
 failed = sum([result[2] for result in test_results], [])
-pass_count = sum([result[3] for result in test_results])
-fail_count = sum([result[4] for result in test_results])
+unexpected_successes = sum([result[3] for result in test_results], [])
+pass_count = sum([result[4] for result in test_resul

[Lldb-commits] [lldb] r244984 - Don't crash when we have a .a file that contains an object with a 16 character name. Any calls to std::string::erase must be bounds checked.

2015-08-13 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Thu Aug 13 18:16:15 2015
New Revision: 244984

URL: http://llvm.org/viewvc/llvm-project?rev=244984&view=rev
Log:
Don't crash when we have a .a file that contains an object with a 16 character 
name. Any calls to std::string::erase must be bounds checked.



Modified:

lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp

Modified: 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=244984&r1=244983&r2=244984&view=diff
==
--- 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
 Thu Aug 13 18:16:15 2015
@@ -105,7 +105,9 @@ ObjectContainerBSDArchive::Object::Extra
 {
 // Strip off any spaces (if the object file name contains spaces it
 // will use the extended format above).
-str.erase (str.find(' '));
+const size_t space_pos = str.find(' ');
+if (space_pos != std::string::npos)
+str.erase (space_pos);
 ar_name.SetCString(str.c_str());
 }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Chaoren Lin via lldb-commits
chaoren added inline comments.


Comment at: test/dosep.py:202
@@ -196,1 +201,3 @@
   if status != ePassed]
+xpasses = [name for name, status, _, _, unexpected_successes in results if 
unexpected_successes > 0]
+

Don't need status here.

Nit: could you please wrap the `if` like the above?
Nit: `xpasses` reads like "expected passes" to me.


Comment at: test/dosep.py:266
@@ -259,2 +266,2 @@
 timed_out = sum([result[0] for result in test_results], [])
 passed = sum([result[1] for result in test_results], [])

There's a line above this:
```
# result = (timed_out, failed, passed, fail_count, pass_count)
```
that needs to be updated.

(could you please include all context in the future? I recommend using [[ 
https://secure.phabricator.com/book/phabricator/article/arcanist/ | arcanist ]])


Comment at: test/dosep.py:500
@@ +499,3 @@
+for u in unexpected_successes:
+print "UNEXPECTED SUCCESS: LLDB (suite) :: %s (%s)" % (u, 
system_info)
+

I wonder if it'll be worthwhile to include the count (i.e., x  unexpected 
successes out of y expected failures)


http://reviews.llvm.org/D12020



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: test/dosep.py:266
@@ -259,2 +266,2 @@
 timed_out = sum([result[0] for result in test_results], [])
 passed = sum([result[1] for result in test_results], [])

chaoren wrote:
> There's a line above this:
> ```
> # result = (timed_out, failed, passed, fail_count, pass_count)
> ```
> that needs to be updated.
> 
> (could you please include all context in the future? I recommend using [[ 
> https://secure.phabricator.com/book/phabricator/article/arcanist/ | arcanist 
> ]])
Arcanist didn't work well on windows last time I tried.  


http://reviews.llvm.org/D12020



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 32110.

http://reviews.llvm.org/D12020

Files:
  test/dosep.py

Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -121,23 +121,28 @@
 def parse_test_results(output):
 passes = 0
 failures = 0
+unexpected_successes = 0
 for result in output:
 pass_count = re.search("^RESULT:.*([0-9]+) passes",
result, re.MULTILINE)
 fail_count = re.search("^RESULT:.*([0-9]+) failures",
result, re.MULTILINE)
 error_count = re.search("^RESULT:.*([0-9]+) errors",
 result, re.MULTILINE)
+unexpected_success_count = re.search("^RESULT:.*([0-9]+) unexpected successes",
+ result, re.MULTILINE)
 this_fail_count = 0
 this_error_count = 0
 if pass_count is not None:
 passes = passes + int(pass_count.group(1))
 if fail_count is not None:
 failures = failures + int(fail_count.group(1))
+if unexpected_success_count is not None:
+unexpected_successes = unexpected_successes + int(unexpected_success_count.group(1))
 if error_count is not None:
 failures = failures + int(error_count.group(1))
 pass
-return passes, failures
+return passes, failures, unexpected_successes
 
 
 def call_with_timeout(command, timeout, name):
@@ -161,14 +166,14 @@
stderr=subprocess.PIPE)
 output = process.communicate()
 exit_status = process.returncode
-passes, failures = parse_test_results(output)
+passes, failures, unexpected_successes = parse_test_results(output)
 if exit_status == 0:
 # stdout does not have any useful information from 'dotest.py',
 # only stderr does.
 report_test_pass(name, output[1])
 else:
 report_test_failure(name, command, output[1])
-return name, exit_status, passes, failures
+return name, exit_status, passes, failures, unexpected_successes
 
 
 def process_dir(root, files, test_root, dotest_argv):
@@ -187,17 +192,20 @@
 
 results.append(call_with_timeout(command, timeout, name))
 
-# result = (name, status, passes, failures)
-timed_out = [name for name, status, _, _ in results
+# result = (name, status, passes, failures, unexpected_successes)
+timed_out = [name for name, status, _, _, _ in results
  if status == eTimedOut]
-passed = [name for name, status, _, _ in results
+passed = [name for name, status, _, _, _ in results
   if status == ePassed]
-failed = [name for name, status, _, _ in results
+failed = [name for name, status, _, _, _ in results
   if status != ePassed]
+unexpected_passes = [name for name, _, _, _, unexpected_successes in results
+ if unexpected_successes > 0]
+
 pass_count = sum([result[2] for result in results])
 fail_count = sum([result[3] for result in results])
 
-return (timed_out, passed, failed, pass_count, fail_count)
+return (timed_out, passed, failed, unexpected_passes, pass_count, fail_count)
 
 in_q = None
 out_q = None
@@ -255,14 +263,15 @@
 else:
 test_results = map(process_dir_worker, test_work_items)
 
-# result = (timed_out, failed, passed, fail_count, pass_count)
+# result = (timed_out, failed, passed, unexpected_successes, fail_count, pass_count)
 timed_out = sum([result[0] for result in test_results], [])
 passed = sum([result[1] for result in test_results], [])
 failed = sum([result[2] for result in test_results], [])
-pass_count = sum([result[3] for result in test_results])
-fail_count = sum([result[4] for result in test_results])
+unexpected_successes = sum([result[3] for result in test_results], [])
+pass_count = sum([result[4] for result in test_results])
+fail_count = sum([result[5] for result in test_results])
 
-return (timed_out, passed, failed, pass_count, fail_count)
+return (timed_out, passed, failed, unexpected_successes, pass_count, fail_count)
 
 
 def getExpectedTimeouts(platform_name):
@@ -433,7 +442,7 @@
 num_threads = 1
 
 system_info = " ".join(platform.uname())
-(timed_out, passed, failed, pass_count, fail_count) = walk_and_invoke(
+(timed_out, passed, failed, unexpected_successes, pass_count, fail_count) = walk_and_invoke(
 test_directory, test_subdir, dotest_argv, num_threads)
 
 timed_out = set(timed_out)
@@ -474,15 +483,24 @@
 sys.stdout.write(" (%d failed) (%f%%)" % (
 fail_count, 100.0 * fail_count / num_test_cases))
 print
+exit_code = 0
+
 if len(failed) > 0:
 failed.sort()
 print "Failing Tests (%d)" % len(failed)
 for f in failed:
 print "%s: LLDB (suite) :: %s (%s)" % (
 

Re: [Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: test/dosep.py:500
@@ +499,3 @@
+print "\nUnexpected Successes (%d)" % len(unexpected_successes)
+for u in unexpected_successes:
+print "UNEXPECTED SUCCESS: LLDB (suite) :: %s (%s)" % (u, 
system_info)

I thought about that.  But if we're going to do that, might as well go all the 
way and print each one inside the test.  Seems like a worthwhile thing to do, 
just didn't want to take that on quite yet.


http://reviews.llvm.org/D12020



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12020: Print unexpected successes at the end of dosep.

2015-08-13 Thread Chaoren Lin via lldb-commits
chaoren accepted this revision.
chaoren added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D12020



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244992 - Add a better fix for searching for spaces in BSD archive object names where we only trim trailing spaces.

2015-08-13 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Thu Aug 13 19:18:52 2015
New Revision: 244992

URL: http://llvm.org/viewvc/llvm-project?rev=244992&view=rev
Log:
Add a better fix for searching for spaces in BSD archive object names where we 
only trim trailing spaces.

I made an example where I had a file named "testtesttestt .o" (16 chars) that I 
was able to put into a .a file and we would previously truncate the object name 
to "testtesttestt" since we searched for any space in the name. I believe the 
BSD archive docs say that filenames with spaces will use the extended format, 
but our current libtool doesn't so I wanted to fix it by only removing trailing 
spaces.


Modified:

lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp

Modified: 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=244992&r1=244991&r2=244992&view=diff
==
--- 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
 Thu Aug 13 19:18:52 2015
@@ -103,11 +103,13 @@ ObjectContainerBSDArchive::Object::Extra
 }
 else
 {
-// Strip off any spaces (if the object file name contains spaces it
-// will use the extended format above).
-const size_t space_pos = str.find(' ');
-if (space_pos != std::string::npos)
-str.erase (space_pos);
+// Strip off any trailing spaces.
+const size_t last_pos = str.find_last_not_of(' ');
+if (last_pos != std::string::npos)
+{
+if (last_pos + 1 < 16)
+str.erase (last_pos + 1);
+}
 ar_name.SetCString(str.c_str());
 }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r244999 - I was assuming that when a bit of inlined code was followed by code from the inlining site, it was going to execute to the inlining site code, but apparently that's not

2015-08-13 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Aug 13 20:38:21 2015
New Revision: 244999

URL: http://llvm.org/viewvc/llvm-project?rev=244999&view=rev
Log:
I was assuming that when a bit of inlined code was followed by code from the 
inlining site, it was going to execute to the inlining site code, but 
apparently that's not always true.  So we need to be a bit more careful getting 
past the inlining, and use a StepOverRange plan not a RunToAddress plan.



Modified:
lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=244999&r1=244998&r2=244999&view=diff
==
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Thu Aug 13 20:38:21 
2015
@@ -303,10 +303,14 @@ ThreadPlanStepOverRange::ShouldStop (Eve
 if (next_line_entry.file == 
m_addr_context.line_entry.file)
 {
 const bool abort_other_plans = 
false;
-const bool stop_other_threads = 
false;
-new_plan_sp = 
m_thread.QueueThreadPlanForRunToAddress(abort_other_plans,
-   
next_line_address,
-   
stop_other_threads);
+const RunMode stop_other_threads = 
RunMode::eAllThreads;
+lldb::addr_t cur_pc = 
m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
+AddressRange step_range(cur_pc, 
next_line_address.GetLoadAddress(&GetTarget()) - cur_pc);
+
+new_plan_sp = 
m_thread.QueueThreadPlanForStepOverRange (abort_other_plans,
+   
 step_range,
+   
 sc,
+   
 stop_other_threads);
 break;
 }
 look_ahead_step++;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-13 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Thu Aug 13 22:40:31 2015
New Revision: 245020

URL: http://llvm.org/viewvc/llvm-project?rev=245020&view=rev
Log:
[MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

SUMMARY:
This patch adds support of floating point and aggregate return types in 
GetReturnValueObjectImpl() for mips32

Reviewers: clayborg
Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
Differential Revision: http://reviews.llvm.org/D11930

Modified:
lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245020&r1=245019&r2=245020&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Thu Aug 13 
22:40:31 2015
@@ -423,15 +423,16 @@ ABISysV_mips::GetReturnValueObjectImpl (
 if (!reg_ctx)
 return return_valobj_sp;
 
-bool is_signed;
+bool is_signed = false;
+bool is_complex = false;
+uint32_t count = 0;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@ ABISysV_mips::GetReturnValueObjectImpl (
 uint32_t ptr = 
thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & 
UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that 
memory is passed in r2. 
+uint64_t mem_address = 
reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, 
NULL),
+  return_clang_type);
+return return_valobj_sp;
+}
+else if (return_clang_type.IsFloatingPointType (count, is_complex))
+{
+const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
+const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+
+if (count == 1 && !is_complex)
+{
+switch (bit_width)
+{
+default:
+return return_valobj_sp;
+case 64:
+{
+static_assert(sizeof(double) == sizeof(uint64_t), "");
+uint64_t raw_value;
+raw_value = reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & 
UINT32_MAX;
+raw_value |= 
((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(f1_info, 0) & UINT32_MAX)) << 32;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+case 32:
+{
+static_assert(sizeof(float) == sizeof(uint32_t), "");
+uint32_t raw_value = 
reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & UINT32_MAX;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+}
+}
+else
+{
+// not handled yet
+return return_valobj_sp;
+}
+}
 else
 {
 // not handled yet


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11930: [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-13 Thread Bhushan Attarde via lldb-commits
bhushan closed this revision.
bhushan added a comment.

Committed in revision 245020


Repository:
  rL LLVM

http://reviews.llvm.org/D11930



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12025: Make LLDB URLs to support hex encoding for special symbols

2015-08-13 Thread Oleksiy Vyalov via lldb-commits
ovyalov created this revision.
ovyalov added reviewers: clayborg, tberghammer, chaoren.
ovyalov added a subscriber: lldb-commits.

UriParser:Parse expects that host name doesn't contain special URL symbols  - 
":", ";", "$",...
However, in case of adb protocol (adb://$device_serial_no:$port) it poses a 
problem -  device serial number may contain a colon ("192.168.0.1:").
In order to handle this situation we can pass URL encoded serial number 
(adb://192.168.100.132%3A:5432) and decode URL components within 
UriParser::Parse.
As an alternative, there is an option to have a adb-specific regexp in 
UriParser::Parse but I would like to keep UriParser protocol-independent.   

http://reviews.llvm.org/D12025

Files:
  lldb.xcodeproj/project.pbxproj
  source/Host/posix/ConnectionFileDescriptorPosix.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Utility/CMakeLists.txt
  source/Utility/UriParser.cpp
  source/Utility/UrlEncoder.cpp
  source/Utility/UrlEncoder.h
  unittests/Utility/CMakeLists.txt
  unittests/Utility/UriParserTest.cpp
  unittests/Utility/UrlEncoderTest.cpp

Index: unittests/Utility/UrlEncoderTest.cpp
===
--- /dev/null
+++ unittests/Utility/UrlEncoderTest.cpp
@@ -0,0 +1,31 @@
+#include "gtest/gtest.h"
+#include "Utility/UrlEncoder.h"
+
+namespace
+{
+class UrlEncoderTest: public ::testing::Test
+{
+};
+}
+
+TEST_F (UrlEncoderTest, EncodeHostPort)
+{
+EXPECT_EQ("192.168.100.132%3A", UrlEncoder::Encode("192.168.100.132:"));
+}
+
+TEST_F (UrlEncoderTest, DecodeHostPort)
+{
+EXPECT_EQ("192.168.100.132:", UrlEncoder::Decode("192.168.100.132%3A"));
+}
+
+TEST_F (UrlEncoderTest, DecodeBrokenInput)
+{
+EXPECT_EQ("192.168.100.132%3", UrlEncoder::Decode("192.168.100.132%3"));
+}
+
+TEST_F (UrlEncoderTest, EncodeDecodeAscii)
+{
+const char* url = "192.168.100.132";
+EXPECT_EQ(url, UrlEncoder::Encode(url));
+EXPECT_EQ(url, UrlEncoder::Decode(url));
+}
Index: unittests/Utility/UriParserTest.cpp
===
--- unittests/Utility/UriParserTest.cpp
+++ unittests/Utility/UriParserTest.cpp
@@ -85,6 +85,12 @@
 VALIDATE
 }
 
+TEST_F (UriParserTest, AdbHostPortSerial)
+{
+const UriTestCase testCase("adb://192.168.100.132%3A:5432/", "adb", "192.168.100.132:", 5432, "/");
+VALIDATE
+}
+
 TEST_F (UriParserTest, SchemeHostSeparator)
 {
 const UriTestCase testCase("x:/y");
@@ -132,4 +138,3 @@
 const UriTestCase testCase("x://y:0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/");
 VALIDATE
 }
-
Index: unittests/Utility/CMakeLists.txt
===
--- unittests/Utility/CMakeLists.txt
+++ unittests/Utility/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_unittest(UtilityTests
   StringExtractorTest.cpp
   UriParserTest.cpp
+  UrlEncoderTest.cpp
   )
Index: source/Utility/UrlEncoder.h
===
--- /dev/null
+++ source/Utility/UrlEncoder.h
@@ -0,0 +1,27 @@
+//===-- UrlEncoder.h *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef utility_UrlEncoder_h_
+#define utility_UrlEncoder_h_
+
+// C Includes
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+// Project includes
+
+class UrlEncoder
+{
+public:
+static std::string Encode(const std::string& url);
+static std::string Decode(const std::string& url);
+};
+
+#endif  // utility_UrlEncoder_h_
Index: source/Utility/UrlEncoder.cpp
===
--- /dev/null
+++ source/Utility/UrlEncoder.cpp
@@ -0,0 +1,72 @@
+//===-- UrlEncoder.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "Utility/UrlEncoder.h"
+
+// C++ Includes
+#include 
+
+namespace {
+
+const char kUrlSpecialSyms[] = {'!', '*', '\'', '(', ')', ';', ':', '@', '&', '=', '+', '$', ',', '/', '?', '%', '#', '[', ']'};
+
+bool
+IsSpecialUrlSymbol(const char ch)
+{
+for (const char sym: kUrlSpecialSyms)
+{
+if (sym == ch)
+return true;
+}
+return false;
+}
+
+}
+
+std::string
+UrlEncoder::Encode(const std::string& url)
+{
+std::ostringstream result;
+char sym_fmt[3];
+
+for (const char sym: url)
+{
+if (IsSpecialUrlSymbol(sym))
+   

[Lldb-commits] [lldb] r245026 - Handle floating point and aggregate return types in SysV-mips64 ABI

2015-08-13 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Thu Aug 13 23:44:47 2015
New Revision: 245026

URL: http://llvm.org/viewvc/llvm-project?rev=245026&view=rev
Log:
Handle floating point and aggregate return types in SysV-mips64 ABI

SUMMARY:
This patch adds support of floating point and aggregate return types in 
GetReturnValueObjectImpl() for mips64.

Reviewers: clayborg, jingham
Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
Differential Revision: http://reviews.llvm.org/D11641

Modified:
lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=245026&r1=245025&r2=245026&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Thu Aug 13 
23:44:47 2015
@@ -379,7 +379,8 @@ ABISysV_mips64::GetReturnValueObjectImpl
 {
 ValueObjectSP return_valobj_sp;
 Value value;
-
+Error error;
+
 ExecutionContext exe_ctx (thread.shared_from_this());
 if (exe_ctx.GetTargetPtr() == NULL || exe_ctx.GetProcessPtr() == NULL)
 return return_valobj_sp;
@@ -390,20 +391,27 @@ ABISysV_mips64::GetReturnValueObjectImpl
 if (!reg_ctx)
 return return_valobj_sp;
 
+Target *target = exe_ctx.GetTargetPtr();
+ByteOrder target_byte_order = target->GetArchitecture().GetByteOrder();
 const size_t byte_size = return_clang_type.GetByteSize(nullptr);
 const uint32_t type_flags = return_clang_type.GetTypeInfo (NULL);
+
+const RegisterInfo *r2_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+const RegisterInfo *r3_info = reg_ctx->GetRegisterInfoByName("r3", 0);
 
-if (type_flags & eTypeIsScalar)
+if (type_flags & eTypeIsScalar ||
+type_flags & eTypeIsPointer)
 {
 value.SetValueType(Value::eValueTypeScalar);
 
 bool success = false;
-if (type_flags & eTypeIsInteger)
+if (type_flags & eTypeIsInteger ||
+type_flags & eTypeIsPointer)
 {
 // Extract the register context so we can read arguments from 
registers
 // In MIPS register "r2" (v0) holds the integer function return 
values
 
-uint64_t raw_value = 
reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+uint64_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r2_info, 0);
 
 const bool is_signed = (type_flags & eTypeIsSigned) != 0;
 switch (byte_size)
@@ -444,25 +452,302 @@ ABISysV_mips64::GetReturnValueObjectImpl
 break;
 }
 }
+else if (type_flags & eTypeIsFloat)
+{
+if (type_flags & eTypeIsComplex)
+{
+// Don't handle complex yet.
+}
+else
+{
+if (byte_size <= sizeof(long double))
+{
+const RegisterInfo *f0_info = 
reg_ctx->GetRegisterInfoByName("f0", 0);
+const RegisterInfo *f2_info = 
reg_ctx->GetRegisterInfoByName("f2", 0);
+RegisterValue f0_value, f2_value;
+DataExtractor f0_data, f2_data;
+
+reg_ctx->ReadRegister (f0_info, f0_value);
+reg_ctx->ReadRegister (f2_info, f2_value);
+
+f0_value.GetData(f0_data);
+f2_value.GetData(f2_data);
+
+lldb::offset_t offset = 0;
+if (byte_size == sizeof(float))
+{
+value.GetScalar() = (float) f0_data.GetFloat(&offset);
+success = true;
+}
+else if (byte_size == sizeof(double))
+{
+value.GetScalar() = (double) 
f0_data.GetDouble(&offset);
+success = true;
+}
+else if (byte_size == sizeof(long double))
+{
+DataExtractor *copy_from_extractor = NULL;
+DataBufferSP data_sp (new DataBufferHeap(16, 0));
+DataExtractor return_ext (data_sp, 
+  target_byte_order, 
+  
target->GetArchitecture().GetAddressByteSize());
+
+if (target_byte_order == eByteOrderLittle)
+{
+ f0_data.Append(f2_data);
+ copy_from_extractor = &f0_data;
+}
+else
+{
+f2_data.Append(f0_d

Re: [Lldb-commits] [PATCH] D11641: Handle floating point and aggregate return types in SysV-mips64 ABI

2015-08-13 Thread Bhushan Attarde via lldb-commits
bhushan closed this revision.
bhushan added a comment.

Committed in revision 245026


Repository:
  rL LLVM

http://reviews.llvm.org/D11641



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11747: [MIPS] Support standard GDB remote stop reply packet for watchpoint

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL244865


Repository:
  rL LLVM

http://reviews.llvm.org/D11747



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11672: [MIPS] Handle false positives for MIPS hardware watchpoints

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL244864


Repository:
  rL LLVM

http://reviews.llvm.org/D11672



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11519: [MIPS] Use qfThreadID if qC packet is not supported by target

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL244866


Repository:
  rL LLVM

http://reviews.llvm.org/D11519



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11455: [MIPS] Create Unix Signals based on target architecture

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL243618


Repository:
  rL LLVM

http://reviews.llvm.org/D11455



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11133: [MIPS] Detect MIPS application specific extensions like micromips

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL242381


Repository:
  rL LLVM

http://reviews.llvm.org/D11133



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D10596: [MIPS] MIPS32 branch emulation and single-stepping

2015-08-13 Thread Jaydeep Patil via lldb-commits
jaydeep closed this revision.
jaydeep added a comment.

Closed by commit http://reviews.llvm.org/rL240373


Repository:
  rL LLVM

http://reviews.llvm.org/D10596



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11449: Handle old style 'S' packet correctly

2015-08-13 Thread Bhushan Attarde via lldb-commits
bhushan closed this revision.
bhushan added a comment.

Closed by Commit http://reviews.llvm.org/rL243091


Repository:
  rL LLVM

http://reviews.llvm.org/D11449



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-13 Thread Bhushan Attarde via lldb-commits
Hi Hans,

Could you please merge this to the release branch?

Thanks
Bhushan


-Original Message-
From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
Bhushan D. Attarde via lldb-commits
Sent: 14 August 2015 09:11
To: lldb-commits@lists.llvm.org
Subject: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and 
aggregate return types in SysV-mips [32 bit] ABI

Author: bhushan.attarde
Date: Thu Aug 13 22:40:31 2015
New Revision: 245020

URL: http://llvm.org/viewvc/llvm-project?rev=245020&view=rev
Log:
[MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

SUMMARY:
This patch adds support of floating point and aggregate return types in 
GetReturnValueObjectImpl() for mips32

Reviewers: clayborg
Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
Differential Revision: http://reviews.llvm.org/D11930

Modified:
lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245020&r1=245019&r2=245020&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Thu Aug 13 
22:40:31 2015
@@ -423,15 +423,16 @@ ABISysV_mips::GetReturnValueObjectImpl (
 if (!reg_ctx)
 return return_valobj_sp;
 
-bool is_signed;
+bool is_signed = false;
+bool is_complex = false;
+uint32_t count = 0;
 
 // In MIPS register "r2" (v0) holds the integer function return values
 const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
+size_t bit_width = return_clang_type.GetBitSize(&thread);
 
 if (return_clang_type.IsIntegerType (is_signed))
 {
-size_t bit_width = return_clang_type.GetBitSize(&thread);
-
 switch (bit_width)
 {
 default:
@@ -473,6 +474,52 @@ ABISysV_mips::GetReturnValueObjectImpl (
 uint32_t ptr = 
thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & 
UINT32_MAX;
 value.GetScalar() = ptr;
 }
+else if (return_clang_type.IsAggregateType ())
+{
+// Structure/Vector is always passed in memory and pointer to that 
memory is passed in r2. 
+uint64_t mem_address = 
reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
+// We have got the address. Create a memory object out of it
+return_valobj_sp = ValueObjectMemory::Create (&thread,
+  "",
+  Address (mem_address, 
NULL),
+  return_clang_type);
+return return_valobj_sp;
+}
+else if (return_clang_type.IsFloatingPointType (count, is_complex))
+{
+const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
+const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+
+if (count == 1 && !is_complex)
+{
+switch (bit_width)
+{
+default:
+return return_valobj_sp;
+case 64:
+{
+static_assert(sizeof(double) == sizeof(uint64_t), "");
+uint64_t raw_value;
+raw_value = reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & 
UINT32_MAX;
+raw_value |= 
((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(f1_info, 0) & UINT32_MAX)) << 32;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+case 32:
+{
+static_assert(sizeof(float) == sizeof(uint32_t), "");
+uint32_t raw_value = 
reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & UINT32_MAX;
+value.GetScalar() = *reinterpret_cast(&raw_value);
+break;
+}
+}
+}
+else
+{
+// not handled yet
+return return_valobj_sp;
+}
+}
 else
 {
 // not handled yet


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245033 - Fixed build failures caused by rL245026. Changed occurrences of ClangASTType to CompilerType.

2015-08-13 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Fri Aug 14 01:36:28 2015
New Revision: 245033

URL: http://llvm.org/viewvc/llvm-project?rev=245033&view=rev
Log:
Fixed build failures caused by rL245026. Changed occurrences of ClangASTType to 
CompilerType.

Modified:
lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=245033&r1=245032&r2=245033&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Fri Aug 14 
01:36:28 2015
@@ -559,7 +559,7 @@ ABISysV_mips64::GetReturnValueObjectImpl
 // Check if this structure contains only floating point fields
 for (uint32_t idx = 0; idx < num_children; idx++)
 {
-ClangASTType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
+CompilerType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
 
 if (field_clang_type.IsFloatingPointType (count, 
is_complex))
 use_fp_regs = 1;
@@ -583,7 +583,7 @@ ABISysV_mips64::GetReturnValueObjectImpl
 
 for (uint32_t idx = 0; idx < num_children; idx++)
 {
-ClangASTType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
+CompilerType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
 const size_t field_byte_width = 
field_clang_type.GetByteSize(nullptr);
 
 DataExtractor *copy_from_extractor = NULL;
@@ -644,7 +644,7 @@ ABISysV_mips64::GetReturnValueObjectImpl
 bool is_signed;
 uint32_t padding;
 
-ClangASTType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
+CompilerType field_clang_type = 
return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL);
 const size_t field_byte_width = 
field_clang_type.GetByteSize(nullptr);
 
 // if we don't know the size of the field (e.g. invalid type), 
just bail out


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits