[Lldb-commits] [lldb] r260078 - Have lldb-server log the timestamp in its log messages

2016-02-08 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Feb  8 03:35:53 2016
New Revision: 260078

URL: http://llvm.org/viewvc/llvm-project?rev=260078&view=rev
Log:
Have lldb-server log the timestamp in its log messages

Modified:
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=260078&r1=260077&r2=260078&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Mon Feb  8 03:35:53 2016
@@ -531,7 +531,7 @@ main_gdbserver (int argc, char *argv[])
 exit(option_error);
 }
 
-if (!LLDBServerUtilities::SetupLogging(log_file, log_channels, 0))
+if (!LLDBServerUtilities::SetupLogging(log_file, log_channels, 
LLDB_LOG_OPTION_PREPEND_TIMESTAMP))
 return -1;
 
 Log *log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_VERBOSE));


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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.
labath added a comment.

Do we have a test for this?

If not, it sounds like it would be an easy thing to add one.


http://reviews.llvm.org/D16975



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Pavel Labath via lldb-commits
labath added a comment.

Nevermind, I now see you mention TestReturnValue. :/


http://reviews.llvm.org/D16975



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


[Lldb-commits] [lldb] r260081 - Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"

2016-02-08 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Feb  8 03:58:27 2016
New Revision: 260081

URL: http://llvm.org/viewvc/llvm-project?rev=260081&view=rev
Log:
Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"

Test is still flaky.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=260081&r1=260080&r2=260081&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 Mon Feb  8 03:58:27 2016
@@ -57,6 +57,7 @@ class MiInterpreterExecTestCase(lldbmi_t
 
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
+@expectedFlakeyLinux(bugnumber="llvm.org/pr25470")
 def test_lldbmi_settings_set_target_run_args_before(self):
 """Test that 'lldb-mi --interpreter' can set target arguments by 
'setting set target.run-args' command before than target was created."""
 


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


[Lldb-commits] [lldb] r260082 - Show real error message in -data-evaluate-expression

2016-02-08 Thread Eugene Leviant via lldb-commits
Author: evgeny777
Date: Mon Feb  8 04:04:51 2016
New Revision: 260082

URL: http://llvm.org/viewvc/llvm-project?rev=260082&view=rev
Log:
Show real error message in -data-evaluate-expression

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdData.h

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py?rev=260082&r1=260081&r2=260082&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py 
Mon Feb  8 04:04:51 2016
@@ -38,7 +38,7 @@ class MiVarTestCase(lldbmi_testcase.MiTe
 self.runCmd("-var-create var1 * undef")
 self.expect("\^error,msg=\"error: error: use of undeclared identifier 
\'undef\'nerror: 1 errors parsing expressionn\"")
 self.runCmd("-data-evaluate-expression undef")
-self.expect("\^error,msg=\"Could not evaluate expression\"")
+self.expect("\^error,msg=\"error: use of undeclared identifier 
\'undef\'nerror: 1 errors parsing expressionn\"")
 
 # Print global "g_MyVar", modify, delete and create again
 self.runCmd("-data-evaluate-expression g_MyVar")

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp?rev=260082&r1=260081&r2=260082&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp Mon Feb  8 04:04:51 2016
@@ -117,7 +117,8 @@ CMICmdCmdDataEvaluateExpression::Execute
 
 lldb::SBFrame frame = thread.GetSelectedFrame();
 lldb::SBValue value = frame.EvaluateExpression(rExpression.c_str());
-if (!value.IsValid() || value.GetError().Fail())
+m_Error = value.GetError();
+if (!value.IsValid() || m_Error.Fail())
 value = frame.FindVariable(rExpression.c_str());
 const CMICmnLLDBUtilSBValue utilValue(value, true);
 if (!utilValue.IsValid() || utilValue.IsValueUnknown())
@@ -177,8 +178,10 @@ CMICmdCmdDataEvaluateExpression::Acknowl
 m_miResultRecord = miRecordResult;
 return MIstatus::success;
 }
-
-const CMICmnMIValueConst miValueConst("Could not evaluate expression");
+CMIUtilString mi_error_msg = "Could not evaluate expression";
+if (const char* err_msg = m_Error.GetCString())
+mi_error_msg = err_msg;
+const CMICmnMIValueConst miValueConst(mi_error_msg.Escape(true));
 const CMICmnMIValueResult miValueResult("msg", miValueConst);
 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, 
CMICmnMIResultRecord::eResultClass_Error, miValueResult);
 m_miResultRecord = miRecordResult;

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdData.h?rev=260082&r1=260081&r2=260082&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.h Mon Feb  8 04:04:51 2016
@@ -32,6 +32,7 @@
 
 // Third party headers:
 #include "lldb/API/SBCommandReturnObject.h"
+#include "lldb/API/SBError.h"
 
 // In-house headers:
 #include "MICmdBase.h"
@@ -71,6 +72,7 @@ class CMICmdCmdDataEvaluateExpression :
   private:
 bool m_bExpressionValid; // True = yes is valid, false = not valid
 bool m_bEvaluatedExpression; // True = yes is expression evaluated, false 
= failed
+lldb::SBError m_Error;   // Error object, which is examined when 
m_bEvaluatedExpression is false 
 CMIUtilString m_strValue;
 CMICmnMIValueTuple m_miValueTuple;
 bool m_bFoundInvalidChar; // True = yes found unexpected character in the 
expression, false = all ok


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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.

I agree with the idea in general, but I wanted to ask what is your plan with 
the android decorators: For them we use the additional `api_levels` flag, which 
does not exist on other platforms/decorators. I suppose we could add that flag 
to `expectedFailureAll`, but I am not sure if that would be a good idea...

Also, since we are doing all this refactoring, one more improvement I can think 
of is renaming `expectedFailureAll` to `expectedFailure`. It was named `All` 
because we already have an `expectedFailure` function, but I think that one is 
now more of an implementation detail and could be renamed to something else. Up 
to you...


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16938: A number of improvements to decorator conditionals

2016-02-08 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks good, after applying one fix.



Comment at: packages/Python/lldbsuite/test/decorators.py:148
@@ +147,3 @@
+skip_for_triple = _match_decorator_property(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
+skip_for_remote = _match_decorator_property(remote, remote == 
(lldb.remote_platform is not None))
+

The `actual` value should be simply `lldb.remote_platform is not None`. When 
remote_platform is None, we are local, when it is not None, we are remote.

Btw, since this flag can only have three values (None, True, False), the 
_match_decorator property dance is not really necessary. Although, I guess it 
won't hurt either...


http://reviews.llvm.org/D16938



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:581-591
@@ -580,10 +580,13 @@
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
 if (byte_size <= 4)
 {
 RegisterValue r0_reg_value;
 uint32_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 
0) & UINT32_MAX;
 value.SetBytes(&raw_value, byte_size);
 }
 else
 {
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;

I think if we are returning an aggregate containing 1 32 bit float (byte_size 
== 4) then it will be returned in s0 while your current implementation expect 
it to be returned in r0. I am not sure about it but please take a look.

If this is the case I would suggest to order the conditions the following way 
to decrees the nesting level of the ifs:

```
if (IsArmHardFloat(thread))
{
...
}
else if (byte_size <= 4)
{

}

```


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:597
@@ +596,3 @@
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{

What is float_count means here? Do we have to check its value to decide if we 
can print the return value (e.g. what happens when float_count == 2)?


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:612-619
@@ +611,10 @@
+
+if (base_byte_size == 4)
+::snprintf (reg_name, sizeof(reg_name), 
"s%u", reg_index);
+else if (base_byte_size == 8)
+::snprintf (reg_name, sizeof(reg_name), 
"d%u", reg_index);
+else
+break;
+
+const RegisterInfo *reg_info = 
reg_ctx->GetRegisterInfoByName(reg_name, 0);
+if (reg_info == NULL)

I would suggest to use the dwarf register numbers instead of the register names 
for the lookup:

```
uint32_t regnum = 0;
if (byte_size == 4)
regnum = dwarf_s0 + reg_index;
else if (base_byte_size == 8)
regnum = dwarf_d0 + reg_index;
else
break;
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoBy(eRegisterKindDWARF, 
regnum);
```


http://reviews.llvm.org/D16975



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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added a subscriber: tberghammer.
tberghammer added a comment.

In http://reviews.llvm.org/D16936#346182, @labath wrote:

> I agree with the idea in general, but I wanted to ask what is your plan with 
> the android decorators: For them we use the additional `api_levels` flag, 
> which does not exist on other platforms/decorators. I suppose we could add 
> that flag to `expectedFailureAll`, but I am not sure if that would be a good 
> idea...
>
> Also, since we are doing all this refactoring, one more improvement I can 
> think of is renaming `expectedFailureAll` to `expectedFailure`. It was named 
> `All` because we already have an `expectedFailure` function, but I think that 
> one is now more of an implementation detail and could be renamed to something 
> else. Up to you...


My suggestion for the android API level is to add an argument to 
expectedFailure where you can specify an arbitrary function and then we can 
write a function called android_device_matches(...) what will return a function 
checking for the API level. Then this can be used to create very specific xfail 
conditions what are checking some property of the target system (e.g. 
"@expectedFailure(fn=hardwareWatchpointsNotSupported)")

Something like this:

  def android_device_matches(apis):
  def impl(apis):
  return get_device_api() in apis
  return impl


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Muhammad Omair Javaid via lldb-commits
omjavaid added inline comments.


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:581-591
@@ -580,10 +580,13 @@
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
 if (byte_size <= 4)
 {
 RegisterValue r0_reg_value;
 uint32_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 
0) & UINT32_MAX;
 value.SetBytes(&raw_value, byte_size);
 }
 else
 {
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;

tberghammer wrote:
> I think if we are returning an aggregate containing 1 32 bit float (byte_size 
> == 4) then it will be returned in s0 while your current implementation expect 
> it to be returned in r0. I am not sure about it but please take a look.
> 
> If this is the case I would suggest to order the conditions the following way 
> to decrees the nesting level of the ifs:
> 
> ```
> if (IsArmHardFloat(thread))
> {
> ...
> }
> else if (byte_size <= 4)
> {
> 
> }
> 
> ```
Yes, you are right. I ll rearrange the code accordingly.




Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:597
@@ +596,3 @@
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{

tberghammer wrote:
> What is float_count means here? Do we have to check its value to decide if we 
> can print the return value (e.g. what happens when float_count == 2)?
float_count is just used to fullfil argument requirements. It was already 
declared in the function so didnt have to define it here.

It returns 1 if type is a standard builtin type (float or double), returns 2 
for complex and number of elements for vector types.

We are using homogeneous_count to tell the number of elements in our aggregate 
type.


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:612-619
@@ +611,10 @@
+
+if (base_byte_size == 4)
+::snprintf (reg_name, sizeof(reg_name), 
"s%u", reg_index);
+else if (base_byte_size == 8)
+::snprintf (reg_name, sizeof(reg_name), 
"d%u", reg_index);
+else
+break;
+
+const RegisterInfo *reg_info = 
reg_ctx->GetRegisterInfoByName(reg_name, 0);
+if (reg_info == NULL)

tberghammer wrote:
> I would suggest to use the dwarf register numbers instead of the register 
> names for the lookup:
> 
> ```
> uint32_t regnum = 0;
> if (byte_size == 4)
> regnum = dwarf_s0 + reg_index;
> else if (base_byte_size == 8)
> regnum = dwarf_d0 + reg_index;
> else
> break;
> const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoBy(eRegisterKindDWARF, 
> regnum);
> ```
Alright I ll make the appropriate change.


http://reviews.llvm.org/D16975



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:597
@@ +596,3 @@
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{

omjavaid wrote:
> tberghammer wrote:
> > What is float_count means here? Do we have to check its value to decide if 
> > we can print the return value (e.g. what happens when float_count == 2)?
> float_count is just used to fullfil argument requirements. It was already 
> declared in the function so didnt have to define it here.
> 
> It returns 1 if type is a standard builtin type (float or double), returns 2 
> for complex and number of elements for vector types.
> 
> We are using homogeneous_count to tell the number of elements in our 
> aggregate type.
In that case I think we should check that its value after the call is 1 because 
we don't want to use the current implementation for vector types (we already 
check for complex types)


http://reviews.llvm.org/D16975



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


Re: [Lldb-commits] [PATCH] D16868: [lldb] Fix invalid shift operator overload in Scalar

2016-02-08 Thread Marianne Mailhot-Sarrasin via lldb-commits
mamai added reviewers: labath, tberghammer.
mamai updated this revision to Diff 47190.

Repository:
  rL LLVM

http://reviews.llvm.org/D16868

Files:
  source/Core/Scalar.cpp

Index: source/Core/Scalar.cpp
===
--- source/Core/Scalar.cpp
+++ source/Core/Scalar.cpp
@@ -1875,7 +1875,7 @@
  case e_sint128:
  case e_uint128:
  {
- m_integer >> *rhs.m_integer.getRawData();
+ m_integer = m_integer.ashr(*(const uint_t 
*)rhs.m_integer.getRawData());
  break;
  }
 }


Index: source/Core/Scalar.cpp
===
--- source/Core/Scalar.cpp
+++ source/Core/Scalar.cpp
@@ -1875,7 +1875,7 @@
  case e_sint128:
  case e_uint128:
  {
- m_integer >> *rhs.m_integer.getRawData();
+ m_integer = m_integer.ashr(*(const uint_t *)rhs.m_integer.getRawData());
  break;
  }
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Muhammad Omair Javaid via lldb-commits
omjavaid updated this revision to Diff 47191.
omjavaid added a comment.

updated diff after incorporating suggested corrections.


http://reviews.llvm.org/D16975

Files:
  source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp

Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
===
--- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -579,6 +579,75 @@
 else if (compiler_type.IsAggregateType())
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
+
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;
+const uint32_t homogeneous_count = 
compiler_type.IsHomogeneousAggregate (&base_type);
+
+if (homogeneous_count > 0 && homogeneous_count <= 4)
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{
+if (!is_complex)
+{
+ProcessSP process_sp (thread.GetProcess());
+ByteOrder byte_order = process_sp->GetByteOrder();
+
+DataBufferSP data_sp (new DataBufferHeap(byte_size, 
0));
+const size_t base_byte_size = 
base_type.GetByteSize(nullptr);
+uint32_t data_offset = 0;
+
+for (uint32_t reg_index = 0; reg_index < 
homogeneous_count; reg_index++)
+{
+uint32_t regnum = 0;
+
+if (base_byte_size == 4)
+regnum = dwarf_s0 + reg_index;
+else if (base_byte_size == 8)
+regnum = dwarf_d0 + reg_index;
+else
+break;
+
+const RegisterInfo *reg_info = 
reg_ctx->GetRegisterInfo (eRegisterKindDWARF, regnum);
+if (reg_info == NULL)
+break;
+
+RegisterValue reg_value;
+if (!reg_ctx->ReadRegister(reg_info, reg_value))
+break;
+
+// Make sure we have enough room in "data_sp"
+if ((data_offset + base_byte_size) <= 
data_sp->GetByteSize())
+{
+Error error;
+const size_t bytes_copied = 
reg_value.GetAsMemoryData (reg_info,
+   
data_sp->GetBytes() + data_offset,
+   
base_byte_size,
+   
byte_order,
+   
error);
+if (bytes_copied != base_byte_size)
+break;
+
+data_offset += bytes_copied;
+}
+}
+
+if (data_offset == byte_size)
+{
+DataExtractor data;
+data.SetByteOrder(byte_order);
+
data.SetAddressByteSize(process_sp->GetAddressByteSize());
+data.SetData(data_sp);
+
+return ValueObjectConstResult::Create (&thread, 
compiler_type, ConstString(""), data);
+}
+
+}
+}
+}
+}
+
 if (byte_size <= 4)
 {
 RegisterValue r0_reg_value;


Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
===
--- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -579,6 +579,75 @@
 else if (compiler_type.IsAggregateType())
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
+
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;
+const uint32_t homogeneous_count = compiler_type.IsHomogeneousAggregate (&base_type);
+
+if (homogeneous_count > 0 && homogeneous_count <= 4)
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{
+if (!is_complex)
+{
+ProcessSP process_sp (thread.GetProcess());
+ByteOrder byte_order = process_sp->GetByteOrder();
+
+DataBufferSP data_sp (new DataBufferHeap(byte_size, 0));
+const size_t base_byte_size = base_type.GetByteSize(nullptr);
+   

Re: [Lldb-commits] [PATCH] D16868: [lldb] Fix invalid shift operator overload in Scalar

2016-02-08 Thread Pavel Labath via lldb-commits
labath added a comment.

`Scalar::operator<<=` seems to do a `m_integer <<= ...`. Will it suffer from 
the same recursion problem?

In any case, I think the implementations of both methods should use the same 
API (it doesn't matter which one if both work).

Also it would be super great if you could make a tiny test for this, say in 
`unittests/Core/ScalarTest.cpp`


Repository:
  rL LLVM

http://reviews.llvm.org/D16868



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Muhammad Omair Javaid via lldb-commits
omjavaid updated this revision to Diff 47198.
omjavaid added a comment.

Updated adding float_count check.


http://reviews.llvm.org/D16975

Files:
  source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp

Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
===
--- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -579,6 +579,74 @@
 else if (compiler_type.IsAggregateType())
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;
+const uint32_t homogeneous_count = 
compiler_type.IsHomogeneousAggregate (&base_type);
+
+if (homogeneous_count > 0 && homogeneous_count <= 4)
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{
+if (float_count == 1 && !is_complex)
+{
+ProcessSP process_sp (thread.GetProcess());
+ByteOrder byte_order = process_sp->GetByteOrder();
+
+DataBufferSP data_sp (new DataBufferHeap(byte_size, 
0));
+const size_t base_byte_size = 
base_type.GetByteSize(nullptr);
+uint32_t data_offset = 0;
+
+for (uint32_t reg_index = 0; reg_index < 
homogeneous_count; reg_index++)
+{
+uint32_t regnum = 0;
+
+if (base_byte_size == 4)
+regnum = dwarf_s0 + reg_index;
+else if (base_byte_size == 8)
+regnum = dwarf_d0 + reg_index;
+else
+break;
+
+const RegisterInfo *reg_info = 
reg_ctx->GetRegisterInfo (eRegisterKindDWARF, regnum);
+if (reg_info == NULL)
+break;
+
+RegisterValue reg_value;
+if (!reg_ctx->ReadRegister(reg_info, reg_value))
+break;
+
+// Make sure we have enough room in "data_sp"
+if ((data_offset + base_byte_size) <= 
data_sp->GetByteSize())
+{
+Error error;
+const size_t bytes_copied = 
reg_value.GetAsMemoryData (reg_info,
+   
data_sp->GetBytes() + data_offset,
+   
base_byte_size,
+   
byte_order,
+   
error);
+if (bytes_copied != base_byte_size)
+break;
+
+data_offset += bytes_copied;
+}
+}
+
+if (data_offset == byte_size)
+{
+DataExtractor data;
+data.SetByteOrder(byte_order);
+
data.SetAddressByteSize(process_sp->GetAddressByteSize());
+data.SetData(data_sp);
+
+return ValueObjectConstResult::Create (&thread, 
compiler_type, ConstString(""), data);
+}
+
+}
+}
+}
+}
+
 if (byte_size <= 4)
 {
 RegisterValue r0_reg_value;


Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
===
--- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -579,6 +579,74 @@
 else if (compiler_type.IsAggregateType())
 {
 size_t byte_size = compiler_type.GetByteSize(&thread);
+if (IsArmHardFloat(thread))
+{
+CompilerType base_type;
+const uint32_t homogeneous_count = compiler_type.IsHomogeneousAggregate (&base_type);
+
+if (homogeneous_count > 0 && homogeneous_count <= 4)
+{
+if (base_type.IsFloatingPointType(float_count, is_complex))
+{
+if (float_count == 1 && !is_complex)
+{
+ProcessSP process_sp (thread.GetProcess());
+ByteOrder byte_order = process_sp->GetByteOrder();
+
+DataBufferSP data_sp (new DataBufferHeap(byte_size, 0));
+const size_t base_byte_size = base_type.GetByteSize(nullptr);
+ 

Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:592
@@ +591,3 @@
+{
+if (!is_complex)
+{

Please check that "float_count == 1" as well (we don't want to use this code 
path for vector types)


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:592
@@ +591,3 @@
+{
+if (!is_complex)
+{

tberghammer wrote:
> Please check that "float_count == 1" as well (we don't want to use this code 
> path for vector types)
What the ABI says about homogeneous complex types? The current implementation 
treats them as in-memory return types what I think is not the right thing to do 
(I am happy with saying we don't support it but then we should return an empty 
object)


Comment at: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:636
@@ +635,3 @@
+
+if (data_offset == byte_size)
+{

If we failed to read out all data (this condition is false) then we will fall 
through to the non hard float case and will try to read out the return value as 
an in-memory return value. I think this isn't what we want to do based on the 
ABI.


http://reviews.llvm.org/D16975



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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Zachary Turner via lldb-commits
zturner added a comment.

In http://reviews.llvm.org/D16936#346293, @tberghammer wrote:

> In http://reviews.llvm.org/D16936#346182, @labath wrote:
>
> > I agree with the idea in general, but I wanted to ask what is your plan 
> > with the android decorators: For them we use the additional `api_levels` 
> > flag, which does not exist on other platforms/decorators. I suppose we 
> > could add that flag to `expectedFailureAll`, but I am not sure if that 
> > would be a good idea...
> >
> > Also, since we are doing all this refactoring, one more improvement I can 
> > think of is renaming `expectedFailureAll` to `expectedFailure`. It was 
> > named `All` because we already have an `expectedFailure` function, but I 
> > think that one is now more of an implementation detail and could be renamed 
> > to something else. Up to you...
>
>
> My suggestion for the android API level is to add an argument to 
> expectedFailure where you can specify an arbitrary function and then we can 
> write a function called android_device_matches(...) what will return a 
> function checking for the API level. Then this can be used to create very 
> specific xfail conditions what are checking some property of the target 
> system (e.g. "@expectedFailure(fn=hardwareWatchpointsNotSupported)")


Yes, that's one option I thought of.   And the function could be specified with 
any combination of other parameters at the same time, and the result of the 
function would just be one value checked in determining whether to skip / xfail.


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

In http://reviews.llvm.org/D16936#346408, @zturner wrote:

> In http://reviews.llvm.org/D16936#346293, @tberghammer wrote:
>
> > In http://reviews.llvm.org/D16936#346182, @labath wrote:
> >
> > > I agree with the idea in general, but I wanted to ask what is your plan 
> > > with the android decorators: For them we use the additional `api_levels` 
> > > flag, which does not exist on other platforms/decorators. I suppose we 
> > > could add that flag to `expectedFailureAll`, but I am not sure if that 
> > > would be a good idea...
> > >
> > > Also, since we are doing all this refactoring, one more improvement I can 
> > > think of is renaming `expectedFailureAll` to `expectedFailure`. It was 
> > > named `All` because we already have an `expectedFailure` function, but I 
> > > think that one is now more of an implementation detail and could be 
> > > renamed to something else. Up to you...
> >
> >
> > My suggestion for the android API level is to add an argument to 
> > expectedFailure where you can specify an arbitrary function and then we can 
> > write a function called android_device_matches(...) what will return a 
> > function checking for the API level. Then this can be used to create very 
> > specific xfail conditions what are checking some property of the target 
> > system (e.g. "@expectedFailure(fn=hardwareWatchpointsNotSupported)")
>
>
> Yes, that's one option I thought of.   And the function could be specified 
> with any combination of other parameters at the same time, and the result of 
> the function would just be one value checked in determining whether to skip / 
> xfail.


I agree but I also might consider going further where the only thing you can 
specify is a function and we remove all arguments. Then we implement functions 
like architectureMatches, targetOsMatches, hostOsMatches, etc.. and some 
logical function what can combine them (e.g. not, any_of, all_of). This way we 
just build up the condition in the decorator and we don't have a lot of check 
inside expectedFailure. What do you think?


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16868: [lldb] Fix invalid shift operator overload in Scalar

2016-02-08 Thread Marianne Mailhot-Sarrasin via lldb-commits
mamai added a comment.

Scalar::operator<<= works well as-is because it uses  APInt 
&operator<<=(unsigned shiftAmt), whereas the right shift equivalent is not 
implemented. Should I add APInt &operator>>=, or should I change 
Scalar::operator<<=  for consistency ?


Repository:
  rL LLVM

http://reviews.llvm.org/D16868



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


Re: [Lldb-commits] [PATCH] D16868: [lldb] Fix invalid shift operator overload in Scalar

2016-02-08 Thread Pavel Labath via lldb-commits
labath added a comment.

Ah, ok I understand what's going on now. I guess APInt operator >> probably 
does not exist because it would be ambiguous (arithmetic or bitwise shift?). 
Let's just leave this as it is now.

Could you add that test though?


Repository:
  rL LLVM

http://reviews.llvm.org/D16868



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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Todd Fiala via lldb-commits
tfiala added a comment.

> I agree but I also might consider going further where the only thing you can 
> specify is a function and we remove all arguments. Then we implement 
> functions like architectureMatches, targetOsMatches, hostOsMatches, etc.. and 
> some logical function what can combine them (e.g. not, any_of, all_of). This 
> way we just build up the condition in the decorator and we don't have a lot 
> of check inside expectedFailure. What do you think?


That does sound pretty appealing.

So then there would be some kind of combinator functions that do the equivalent 
of "or" and "and" logical operations?  So you can get something like ((tes1() 
&& test2()) or test3())?

-Todd


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16938: A number of improvements to decorator conditionals

2016-02-08 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.

LGTM.

Regarding the section Pavel was looking at, on the Apple side we have a 
simulator target that is not technically remote, but isn't really local either. 
 I'll have to look at that if/when we actually want to mark a simulator test as 
failed.


http://reviews.llvm.org/D16938



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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

In http://reviews.llvm.org/D16936#346536, @tfiala wrote:

> > I agree but I also might consider going further where the only thing you 
> > can specify is a function and we remove all arguments. Then we implement 
> > functions like architectureMatches, targetOsMatches, hostOsMatches, etc.. 
> > and some logical function what can combine them (e.g. not, any_of, all_of). 
> > This way we just build up the condition in the decorator and we don't have 
> > a lot of check inside expectedFailure. What do you think?
>
>
> That does sound pretty appealing.
>
> So then there would be some kind of combinator functions that do the 
> equivalent of "or" and "and" logical operations?  So you can get something 
> like ((tes1() && test2()) or test3())?
>
> -Todd


I think we need an extra level of function nesting so the conditions only 
evaluated during the execution of the test. Because of it all test function 
will have to return a function (taking no argument) and we can't apply binary 
operators to them directly so I expect something like this: or(and(test1(), 
test2()), test3()) If you want to use binary operators then we have to use 
operator overloading what is a bit more work and I am not sure if it worth it 
but it is still possible.


http://reviews.llvm.org/D16936



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


[Lldb-commits] [PATCH] D16996: Improve the handling of missing elf symtab and missing symbol sizes

2016-02-08 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added a reviewer: clayborg.
tberghammer added a subscriber: lldb-commits.

Improve the handling of missing elf symtab and missing symbol sizes

* Generate artificial symbol names from eh_fame during symbol parsing
  so these symbols are already present when we calculate the size of
  the symbols where 0 is specified.
* Fix symbol size calculation for the last symbol in the file where
  it have to last until the end of the parent section

http://reviews.llvm.org/D16996

Files:
  include/lldb/Core/RangeMap.h
  include/lldb/Symbol/DWARFCallFrameInfo.h
  include/lldb/Symbol/Symtab.h
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  source/Symbol/DWARFCallFrameInfo.cpp
  source/Symbol/Symtab.cpp

Index: source/Symbol/Symtab.cpp
===
--- source/Symbol/Symtab.cpp
+++ source/Symbol/Symtab.cpp
@@ -944,43 +944,33 @@
 m_file_addr_to_index.Append(entry);
 }
 }
+
+lldb::addr_t total_size = 0;
+
 const size_t num_entries = m_file_addr_to_index.GetSize();
 if (num_entries > 0)
 {
 m_file_addr_to_index.Sort();
-m_file_addr_to_index.CalculateSizesOfZeroByteSizeRanges();
-
+
 // Now our last symbols might not have had sizes because there
 // was no subsequent symbol to calculate the size from. If this is
 // the case, then calculate the size by capping it at the end of the
 // section in which the symbol resides
 for (int i = num_entries - 1; i >= 0; --i)
 {
-const FileRangeToIndexMap::Entry &entry = m_file_addr_to_index.GetEntryRef(i);
-// As we iterate backwards, as soon as we find a symbol with a valid
-// byte size, we are done
+const FileRangeToIndexMap::Entry& entry = m_file_addr_to_index.GetEntryRef(i);
+
+// As we iterate backwards, as soon as we find a symbol with a valid byte size, we
+// are done.
 if (entry.GetByteSize() > 0)
 break;
 
-// Cap the size to the end of the section in which the symbol resides
-SectionSP section_sp (m_objfile->GetSectionList()->FindSectionContainingFileAddress (entry.GetRangeBase()));
-if (section_sp)
-{
-const lldb::addr_t end_section_file_addr = section_sp->GetFileAddress() + section_sp->GetByteSize();
-const lldb::addr_t symbol_file_addr = entry.GetRangeBase();
-if (end_section_file_addr > symbol_file_addr)
-{
-Symbol &symbol = m_symbols[entry.data];
-if (!symbol.GetByteSizeIsValid())
-{
-symbol.SetByteSize(end_section_file_addr - symbol_file_addr);
-symbol.SetSizeIsSynthesized(true);
-}
-}
-}
+const Address& address = m_symbols[entry.data].GetAddressRef();
+if (SectionSP section_sp = address.GetSection())
+total_size = entry.base + section_sp->GetByteSize() - address.GetOffset();
 }
-// Sort again in case the range size changes the ordering
-m_file_addr_to_index.Sort();
+
+m_file_addr_to_index.CalculateSizesOfZeroByteSizeRanges(total_size);
 }
 }
 }
@@ -1020,37 +1010,18 @@
 }
 
 Symbol *
-Symtab::FindSymbolContainingFileAddress (addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes)
+Symtab::FindSymbolAtFileAddress (addr_t file_addr)
 {
 Mutex::Locker locker (m_mutex);
+if (!m_file_addr_to_index_computed)
+InitAddressIndexes();
 
-
-SymbolSearchInfo info = { this, file_addr, nullptr, nullptr, 0 };
-
-::bsearch (&info, 
-   indexes, 
-   num_indexes, 
-   sizeof(uint32_t), 
-   (ComparisonFunction)SymbolWithClosestFileAddress);
-
-if (info.match_symbol)
+const FileRangeToIndexMap::Entry *entry = m_file_addr_to_index.FindEntryStartsAt(file_addr);
+if (entry)
 {
-if (info.match_offset == 0)
-{
-// We found an exact match!
-return info.match_symbol;
-}
-
-if (!info.match_symbol->GetByteSizeIsValid())
-{
-// The matched symbol dosn't have a valid byte size so lets just go with that match...
-return info.match_symbol;
-}
-
-// We were able to figure out a symbol size so lets make sure our 
-// offset puts "file_addr" in the symbol's address range.
-if (info.match_offset < info.match_symbol->GetByteSize())
-return info.match_symbol;
+Symbol* symbol = SymbolAt

Re: [Lldb-commits] [PATCH] D16868: [lldb] Fix invalid shift operator overload in Scalar

2016-02-08 Thread Marianne Mailhot-Sarrasin via lldb-commits
mamai updated this revision to Diff 47218.
mamai added a comment.

Added a small unit test for scalar right shift operator, which invokes the >>= 
operator.


Repository:
  rL LLVM

http://reviews.llvm.org/D16868

Files:
  source/Core/Scalar.cpp
  unittests/CMakeLists.txt
  unittests/Core/CMakeLists.txt
  unittests/Core/ScalarTest.cpp

Index: unittests/Core/ScalarTest.cpp
===
--- /dev/null
+++ unittests/Core/ScalarTest.cpp
@@ -0,0 +1,32 @@
+//===-- ScalarTest.cpp --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#if defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
+// Workaround for MSVC standard library bug, which fails to include  
when
+// exceptions are disabled.
+#include 
+#endif
+
+#include "gtest/gtest.h"
+
+#include "lldb/Core/Scalar.h"
+
+using namespace lldb_private;
+
+TEST(ScalarTest, RightShiftOperator)
+{
+int a = 0x1000;
+int b = 0x;
+int c = 4;
+Scalar a_scalar(a);
+Scalar b_scalar(b);
+Scalar c_scalar(c);
+ASSERT_EQ(a >> c, a_scalar >> c_scalar);
+ASSERT_EQ(b >> c, b_scalar >> c_scalar);
+}
Index: unittests/Core/CMakeLists.txt
===
--- /dev/null
+++ unittests/Core/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_lldb_unittest(CoreTests
+  ScalarTest.cpp
+  )
Index: unittests/CMakeLists.txt
===
--- unittests/CMakeLists.txt
+++ unittests/CMakeLists.txt
@@ -23,6 +23,7 @@
   llvm_config(${test_name} ${LLVM_LINK_COMPONENTS})
 endfunction()
 
+add_subdirectory(Core)
 add_subdirectory(Editline)
 add_subdirectory(Expression)
 add_subdirectory(Host)
Index: source/Core/Scalar.cpp
===
--- source/Core/Scalar.cpp
+++ source/Core/Scalar.cpp
@@ -1875,7 +1875,7 @@
  case e_sint128:
  case e_uint128:
  {
- m_integer >> *rhs.m_integer.getRawData();
+ m_integer = m_integer.ashr(*(const uint_t 
*)rhs.m_integer.getRawData());
  break;
  }
 }


Index: unittests/Core/ScalarTest.cpp
===
--- /dev/null
+++ unittests/Core/ScalarTest.cpp
@@ -0,0 +1,32 @@
+//===-- ScalarTest.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#if defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
+// Workaround for MSVC standard library bug, which fails to include  when
+// exceptions are disabled.
+#include 
+#endif
+
+#include "gtest/gtest.h"
+
+#include "lldb/Core/Scalar.h"
+
+using namespace lldb_private;
+
+TEST(ScalarTest, RightShiftOperator)
+{
+int a = 0x1000;
+int b = 0x;
+int c = 4;
+Scalar a_scalar(a);
+Scalar b_scalar(b);
+Scalar c_scalar(c);
+ASSERT_EQ(a >> c, a_scalar >> c_scalar);
+ASSERT_EQ(b >> c, b_scalar >> c_scalar);
+}
Index: unittests/Core/CMakeLists.txt
===
--- /dev/null
+++ unittests/Core/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_lldb_unittest(CoreTests
+  ScalarTest.cpp
+  )
Index: unittests/CMakeLists.txt
===
--- unittests/CMakeLists.txt
+++ unittests/CMakeLists.txt
@@ -23,6 +23,7 @@
   llvm_config(${test_name} ${LLVM_LINK_COMPONENTS})
 endfunction()
 
+add_subdirectory(Core)
 add_subdirectory(Editline)
 add_subdirectory(Expression)
 add_subdirectory(Host)
Index: source/Core/Scalar.cpp
===
--- source/Core/Scalar.cpp
+++ source/Core/Scalar.cpp
@@ -1875,7 +1875,7 @@
  case e_sint128:
  case e_uint128:
  {
- m_integer >> *rhs.m_integer.getRawData();
+ m_integer = m_integer.ashr(*(const uint_t *)rhs.m_integer.getRawData());
  break;
  }
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Zachary Turner via lldb-commits
zturner added a comment.

I'm not opposed to it in principle, but I think we should optimize the design 
for conciseness at the point where you decorate a class or function.  If it 
makes the point of decoration more verbose or harder to read, then I would 
probably be against it.  I guess I'd need to see a proposed syntax for what you 
want it to look like when you decorate a function.


http://reviews.llvm.org/D16936



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


Re: [Lldb-commits] [PATCH] D16975: Handle floating-point type homogeneous aggregate return values in ABISysV_arm

2016-02-08 Thread Greg Clayton via lldb-commits
clayborg resigned from this revision.
clayborg removed a reviewer: clayborg.
clayborg added a comment.

I am fine as long as tberghammer is happy.


http://reviews.llvm.org/D16975



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


[Lldb-commits] [lldb] r260135 - A number of improvements to decorator conditionals.

2016-02-08 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Feb  8 13:35:18 2016
New Revision: 260135

URL: http://llvm.org/viewvc/llvm-project?rev=260135&view=rev
Log:
A number of improvements to decorator conditionals.

* Change the `not_in` function to be called `no_match`.  This makes
  it clear that keyword arguments can be more than just lists.
* Change the name of `_check_list_or_lambda` to
  `_match_decorator_property`.  Again clarifying that decorator params
  are not always lists.
* Always use a regex match when matching strings.  This allows automatic
  support for regex matching on all decorator properties.  Also support
  compiled regex values.
* Fix a bug in the compiler check used by _decorateTest.  The two
  arguments were reversed, the condition was always wrong.
* Change one test that uses skipUnlessArch to use skipIf, to
  demonstrate that skipIf can now handle more scenarios.

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=260135&r1=260134&r2=260135&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Mon Feb  8 13:35:18 
2016
@@ -25,6 +25,13 @@ from lldbsuite.test import lldbplatformu
 class DecorateMode:
 Skip, Xfail = range(2)
 
+
+# You can use no_match to reverse the test of the conditional that is used to 
match keyword
+# arguments in the skip / xfail decorators.  If oslist=["windows", "linux"] 
skips windows
+# and linux, oslist=no_match(["windows", "linux"]) skips *unless* windows or 
linux.
+class no_match:
+def __init__(self, item):
+self.item = item
 
 def _check_expected_version(comparison, expected, actual):
 def fn_leq(x,y): return x <= y
@@ -49,18 +56,18 @@ def _check_expected_version(comparison,
 
 return op_lookup[comparison](LooseVersion(actual_str), 
LooseVersion(expected_str))
 
-def _check_list_or_lambda(list_or_lambda, value):
-if six.callable(list_or_lambda):
-return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-for item in list_or_lambda:
-if value in item:
-return True
-return False
-elif isinstance(list_or_lambda, str):
-return value is None or value in list_or_lambda
+def _match_decorator_property(expected, actual):
+if actual is None or expected is None:
+return True
+
+if isinstance(expected, no_match):
+return not _match_decorator_property(expected.item, actual)
+elif isinstance(expected, (str, re._pattern_type)):
+return re.search(expected, actual) is not None
+elif hasattr(expected, "__iter__"):
+return any([x is not None and _match_decorator_property(x, actual) for 
x in expected])
 else:
-return list_or_lambda is None or value is None or list_or_lambda == 
value
+return expected == actual
 
 def expectedFailure(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
@@ -131,15 +138,16 @@ def _decorateTest(mode,
  swig_version=None, py_version=None,
  remote=None):
 def fn(self):
-skip_for_os = _check_list_or_lambda(oslist, self.getPlatform())
-skip_for_hostos = _check_list_or_lambda(hostoslist, 
lldbplatformutil.getHostPlatform())
-skip_for_compiler = _check_list_or_lambda(self.getCompiler(), 
compiler) and self.expectedCompilerVersion(compiler_version)
-skip_for_arch = _check_list_or_lambda(archs, self.getArchitecture())
-skip_for_debug_info = _check_list_or_lambda(debug_info, 
self.debug_info)
-skip_for_triple = triple is None or re.match(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
+skip_for_os = _match_decorator_property(oslist, self.getPlatform())
+skip_for_hostos = _match_decorator_property(hostoslist, 
lldbplatformutil.getHostPlatform())
+skip_for_compiler = _match_decorator_property(compiler, 
self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
+skip_for_arch = _match_decorator_property(archs, 
self.getArchitecture())
+skip_for_debug_info = _match_decorator_property(debug_info, 
self.debug_info)
+skip_for_triple = _match_decorator_property(triple, 
lldb.DBG.GetSelectedPlatform().GetTriple())
+skip_for_remote = _match_decorator_property(remote, 
lldb.remote_platform is not None)
+

Re: [Lldb-commits] [PATCH] D16938: A number of improvements to decorator conditionals

2016-02-08 Thread Zachary Turner via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260135: A number of improvements to decorator conditionals. 
(authored by zturner).

Changed prior to commit:
  http://reviews.llvm.org/D16938?vs=47068&id=47233#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16938

Files:
  lldb/trunk/packages/Python/lldbsuite/test/decorators.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py

Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
@@ -16,7 +16,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipUnlessArch(archs=re.compile('mips*'))
+@skipIf(archs=no_match(re.compile('mips*')))
 def test(self):
 self.build()
 exe = os.path.join(os.getcwd(), "a.out")
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -14,7 +14,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIf(archs=not_in(["i386", "i686"]))
+@skipIf(archs=no_match(["i386", "i686"]))
 @no_debug_info_test
 def test_asm_int_3(self):
 """Test that intrinsics like `__debugbreak();` and `asm {"int3"}` are treated like breakpoints."""
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
@@ -7,7 +7,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIf(debug_info=not_in(["dwarf"]))
+@skipIf(debug_info=no_match(["dwarf"]))
 def test_limit_debug_info(self):
 self.build()
 
Index: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py
@@ -25,6 +25,13 @@
 class DecorateMode:
 Skip, Xfail = range(2)
 
+
+# You can use no_match to reverse the test of the conditional that is used to match keyword
+# arguments in the skip / xfail decorators.  If oslist=["windows", "linux"] skips windows
+# and linux, oslist=no_match(["windows", "linux"]) skips *unless* windows or linux.
+class no_match:
+def __init__(self, item):
+self.item = item
 
 def _check_expected_version(comparison, expected, actual):
 def fn_leq(x,y): return x <= y
@@ -49,18 +56,18 @@
 
 return op_lookup[comparison](LooseVersion(actual_str), LooseVersion(expected_str))
 
-def _check_list_or_lambda(list_or_lambda, value):
-if six.callable(list_or_lambda):
-return list_or_lambda(value)
-elif isinstance(list_or_lambda, list):
-for item in list_or_lambda:
-if value in item:
-return True
-return False
-elif isinstance(list_or_lambda, str):
-return value is None or value in list_or_lambda
+def _match_decorator_property(expected, actual):
+if actual is None or expected is None:
+return True
+
+if isinstance(expected, no_match):
+return not _match_decorator_property(expected.item, actual)
+elif isinstance(expected, (str, re._pattern_type)):
+return re.search(expected, actual) is not None
+elif hasattr(expected, "__iter__"):
+return any([x is not None and _match_decorator_property(x, actual) for x in expected])
 else:
-return list_or_lambda is None or value is None or list_or_lambda == value
+return expected == actual
 
 def expectedFailure(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
@@ -131,15 +138,16 @@
  swig_version=None, py_version=None,
  remote=None):
 def fn(self):
-skip_for_os = _check_list_or_lambda(oslist, self.getPlatform())
-skip_for_hostos = _check_list_or_lambda(hostoslist, lldbplatformutil.getHostPlatform())
-skip_for_compil

Re: [Lldb-commits] [PATCH] D16996: Improve the handling of missing elf symtab and missing symbol sizes

2016-02-08 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Make sure we use a consistent naming scheme for symbols that don't have names 
between all ObjectFile subclasses.



Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2929
@@ +2928,3 @@
+symbol_id,   // Symbol table index.
+"???",   // Symbol name.
+false,   // Is the symbol name mangled?

Use the same naming convention as ObjectFileMachO for these unnamed symbols:

Before starting to parse these symbols:
```
uint32_t synthetic_function_symbol_idx = 0;
```

Then when you find en EH frame FDE that doesn't have a symbol, the name is 
calculated with:

```
snprintf (synthetic_function_symbol,
  sizeof(synthetic_function_symbol),
  "___lldb_unnamed_function%u$$%s",
  ++synthetic_function_symbol_idx,
  
module_sp->GetFileSpec().GetFilename().GetCString());
```

We could move this into ObjectFile.cpp somehow and then have both ObjectFileELF 
and ObjectFileMachO use the same function to create the function name. If we do 
this, we should use a lldb_private::StreamString when making the name.



http://reviews.llvm.org/D16996



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


[Lldb-commits] [lldb] r260177 - Remove skipIfHostPlatform and skipUnlessHostPlatform decorators.

2016-02-08 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Feb  8 18:36:27 2016
New Revision: 260177

URL: http://llvm.org/viewvc/llvm-project?rev=260177&view=rev
Log:
Remove skipIfHostPlatform and skipUnlessHostPlatform decorators.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=260177&r1=260176&r2=260177&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Mon Feb  8 18:36:27 
2016
@@ -490,18 +490,10 @@ def skipIfLinux(func):
 """Decorate the item to skip tests that should be skipped on Linux."""
 return skipIfPlatform(["linux"])(func)
 
-def skipUnlessHostLinux(func):
-"""Decorate the item to skip tests that should be skipped on any non Linux 
host."""
-return skipUnlessHostPlatform(["linux"])(func)
-
 def skipIfWindows(func):
 """Decorate the item to skip tests that should be skipped on Windows."""
 return skipIfPlatform(["windows"])(func)
 
-def skipIfHostWindows(func):
-"""Decorate the item to skip tests that should be skipped on Windows."""
-return skipIfHostPlatform(["windows"])(func)
-
 def skipUnlessWindows(func):
 """Decorate the item to skip tests that should be skipped on any 
non-Windows platform."""
 return skipUnlessPlatform(["windows"])(func)
@@ -543,14 +535,6 @@ def skipIfHostIncompatibleWithRemote(fun
 return None
 return skipTestIfFn(is_host_incompatible_with_remote)(func)
 
-def skipIfHostPlatform(oslist):
-"""Decorate the item to skip tests if running on one of the listed host 
platforms."""
-return skipIf(hostoslist=oslist)
-
-def skipUnlessHostPlatform(oslist):
-"""Decorate the item to skip tests unless running on one of the listed 
host platforms."""
-return skipIf(hostoslist=no_match(oslist))
-
 def skipIfPlatform(oslist):
 """Decorate the item to skip tests if running on one of the listed 
platforms."""
 # This decorator cannot be ported to `skipIf` yet because it is used on 
entire

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py?rev=260177&r1=260176&r2=260177&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
 Mon Feb  8 18:36:27 2016
@@ -28,21 +28,21 @@ class CompDirSymLinkTestCase(TestBase):
 self.line = line_number(_SRC_FILE, '// Set break point at this line.')
 self.src_path = os.path.join(os.getcwd(), _SRC_FILE)
 
-@skipIfHostWindows
+@skipIf(hostoslist=["windows"])
 def test_symlink_paths_set(self):
 pwd_symlink = self.create_src_symlink()
 self.doBuild(pwd_symlink)
 self.runCmd("settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, 
pwd_symlink))
 lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
 
-@skipUnlessHostLinux
+@skipIf(hostoslist=no_match(["linux"]))
 def test_symlink_paths_set_procselfcwd(self):
 pwd_symlink = '/proc/self/cwd'
 self.doBuild(pwd_symlink)
 self.runCmd("settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, 
pwd_symlink))
 lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
 
-@skipIfHostWindows
+@skipIf(hostoslist=["windows"])
 def test_symlink_paths_unset(self):
 pwd_symlink = self.create_src_symlink()
 self.doBuild(pwd_symlink)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py?rev=260177&r1=260176&r2=260177&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
 Mon Feb  8 18:36:27 2016
@@ -15,7 +15,7 @@ class ChangedInferiorTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIfHostWindows
+@skipIf(hostoslist=["window

[Lldb-commits] [lldb] r260176 - Remove the skipUnlessArch decorator.

2016-02-08 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Feb  8 18:36:22 2016
New Revision: 260176

URL: http://llvm.org/viewvc/llvm-project?rev=260176&view=rev
Log:
Remove the skipUnlessArch decorator.

Convert everything over to using skipIf.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py
lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=260176&r1=260175&r2=260176&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Mon Feb  8 18:36:22 
2016
@@ -291,14 +291,6 @@ def not_remote_testsuite_ready(func):
 return "Not ready for remote testsuite" if lldb.remote_platform else 
None
 return skipTestIfFn(is_remote)(func)
 
-def _match_architectures(archs, actual_arch):
-retype = type(re.compile('hello, world'))
-list_passes = isinstance(archs, list) and actual_arch in archs
-basestring_passes = isinstance(archs, six.string_types) and actual_arch == 
archs
-regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch)
-
-return (list_passes or basestring_passes or regex_passes)
-
 def expectedFailureDwarf(bugnumber=None):
 return expectedFailureAll(bugnumber=bugnumber, debug_info="dwarf")
 
@@ -559,25 +551,6 @@ def skipUnlessHostPlatform(oslist):
 """Decorate the item to skip tests unless running on one of the listed 
host platforms."""
 return skipIf(hostoslist=no_match(oslist))
 
-def skipUnlessArch(archs):
-"""Decorate the item to skip tests unless running on one of the listed 
architectures."""
-# This decorator cannot be ported to `skipIf` yet because it is uused with 
regular
-# expressions, which the common matcher does not yet support.
-def myImpl(func):
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@skipUnlessArch can only be used to decorate a 
test method")
-
-@wraps(func)
-def wrapper(*args, **kwargs):
-self = args[0]
-if not _match_architectures(archs, self.getArchitecture()):
-self.skipTest("skipping for architecture %s" % 
(self.getArchitecture())) 
-else:
-func(*args, **kwargs)
-return wrapper
-
-return myImpl
-
 def skipIfPlatform(oslist):
 """Decorate the item to skip tests if running on one of the listed 
platforms."""
 # This decorator cannot be ported to `skipIf` yet because it is used on 
entire

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py?rev=260176&r1=260175&r2=260176&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py
 Mon Feb  8 18:36:22 2016
@@ -26,7 +26,7 @@ class RegisterCommandsTestCase(TestBase)
 TestBase.tearDown(self)
 
 @skipIfiOSSimulator
-@skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64'])
+@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
 def test_register_commands(self):
 """Test commands related to registers, in particular vector 
registers."""
 self.build()
@@ -49,7 +49,7 @@ class RegisterCommandsTestCase(TestBase)
 
 @skipIfiOSSimulator
 @skipIfTargetAndroid(archs=["i386"]) # Writing of mxcsr register fails, 
presumably due to a kernel/hardware problem
-@skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64'])
+@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
 def test_fp_register_write(self):
 """Test commands that write to registers, in particular floating-point 
registers."""
 self.build()
@@ -58,14 +58,14 @@ class RegisterCommandsTestCase(TestBase)
 @skipIfiOSSimulator
 @expectedFailureAndroid(archs=["i386"]) # "register read fstat" always 
return 0x
 @skipIfFreeBSD#llvm.org/pr25057
-@skipUnlessArch(['amd64', 'i386', 'x86_64'])
+@skipIf(archs=no_match(['amd64', 'i386', 'x86_64']))
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 self.build()
 self.fp_special_purpose_register_read()
 
 @skipIfiOSSimulator
-@skipUnlessArch(['amd64', 'arm', 'i386', 'x86_64'])
+@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
 def test_register_expressions(self):
 """Test expression evaluat

[Lldb-commits] [lldb] r260178 - Remove skip and xfail decorators for target architecture.

2016-02-08 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Feb  8 18:36:34 2016
New Revision: 260178

URL: http://llvm.org/viewvc/llvm-project?rev=260178&view=rev
Log:
Remove skip and xfail decorators for target architecture.

This removes the following decorators:

* skipIfI386
* expectedFailureI386
* expectedFailurex86_64
* skipIfArch
* skipUnlessArch
* skipUnlessI386

And other related decorators.  All code using those decorators
is updated to use expectedFailureAll and skipIf

Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py?rev=260178&r1=260177&r2=260178&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
 Mon Feb  8 18:36:34 2016
@@ -16,9 +16,9 @@ class TestMultipleSimultaneousDebuggers(
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIfi386
 @skipIfNoSBHeaders
 @expectedFlakeyDarwin()
+@expectedFailureAll(archs="i[3-6]86", bugnumber="multi-process-driver.cpp 
creates an x64 target")
 @expectedFailureAll(oslist=["windows", "linux", "freebsd"], 
bugnumber="llvm.org/pr20282")
 def test_multiple_debuggers(self):
 env = {self.dylibPath : self.getLLDBLibraryEnvVal()}

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=260178&r1=260177&r2=260178&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Mon Feb  8 18:36:34 
2016
@@ -316,15 +316,6 @@ def expectedFailureGcc(bugnumber=None, c
 def expectedFailureIcc(bugnumber=None):
 return expectedFailureCompiler('icc', None, bugnumber)
 
-def expectedFailureArch(arch, bugnumber=None):
-return expectedFailureAll(archs=arch, bugnumber=bugnumber)
-
-def expectedFailurei386(bugnumber=None):
-return expectedFailureArch('i386', bugnumber)
-
-def expectedFailurex86_64(bugnumber=None):
-return expectedFailureArch('x86_64', bugnumber)
-
 def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None, 
archs=None):
 return expectedFailureAll(oslist=oslist, bugnumber=bugnumber, 
compiler=compilers, archs=archs, debug_info=debug_info)
 
@@ -570,10 +561,6 @@ def skipIfIcc(func):
 """Decorate the item to skip tests that should be skipped if building with 
icc ."""
 return skipIf(compiler="icc")(func)
 
-def skipIfi386(func):
-"""Decorate the item to skip tests that should be skipped if building 
32-bit."""
-return skipIf(archs="i386")(func)
-
 def skipIfTargetAndroid(api_levels=None, archs=None):
 """Decorator to skip tests when the target is Android.
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py?rev=260178&r1=260177&r2=260178&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
 Mon Feb  8 18:36:34 2016
@@ -57,15 +57,13 @@ class ExprCharTestCase(TestBase):
 def test_default_char(self):
 self.do_test()
 
-@expectedFailureArch("arm", "llvm.org/pr23069")
-@expectedFailureArch("aarch64", "llvm.org/pr23069")
+@expectedFailureAll(archs=["arm, aarch64"], bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailurei386("llvm.org/pr23069")
-@expectedFailurex86_64("

[Lldb-commits] LLVM buildmaster will be restarted tonight

2016-02-08 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated and restarted after 6 PM Pacific time
today.

Thanks

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


Re: [Lldb-commits] [PATCH] D16936: Remove expectedFailureWindows decorator

2016-02-08 Thread Zachary Turner via lldb-commits
zturner added a comment.

In http://reviews.llvm.org/D16936#346594, @zturner wrote:

> I'm not opposed to it in principle, but I think we should optimize the design 
> for conciseness at the point where you decorate a class or function.  If it 
> makes the point of decoration more verbose or harder to read, then I would 
> probably be against it.  I guess I'd need to see a proposed syntax for what 
> you want it to look like when you decorate a function.


I did think of one possible way to make this elegant (at least in my opinion).  
I like the keyword argument syntax because it makes it clear at a glance what 
you are testing, and it's also very concise while still allowing complex 
conditionals to be built up.

But one area that is lacking is the ability for it to specify OR conditions.  
Basically if you say `@skipIf(A=a, B=b, C=c)` then it only skips if EVERY 
condition is true.  You hinted at this above, but it would be nice if OR were 
somehow supported.  So one possibility is something like this:

1. Skips if all conditions are true. @skipIf(all(A=a, B=b, C=c))
2. Skips if any condition is true. @skipIf(any(A=a, B=b, C=c))
3. Skips if none of the conditions are true. @skipIf(none(A=a, B=b, C=c))

Of course, the values here could be `no_match` objects as well, just as now, so 
you could write:

1. skips if ~a || b || c @skipIf(any(A=no_match(a), B=b, C=c))

but even better, they could be written to take *args and **kwargs as well, so 
that non-keyword arguments are treated as compound objects.  This is easier to 
illustrate with an example:

1. skips if ~a || b || c || ~(aa && bb) @skipIf(any(A=no_match(a), B=b, C=c, 
none(A=aa, B=bb)))

This should support arbitrarily complex conditionals, but is still pretty 
concise IMO.

Thoughts?


Repository:
  rL LLVM

http://reviews.llvm.org/D16936



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


[Lldb-commits] [PATCH] D17014: [TestExprsChar] Fix a typo is failure archs list

2016-02-08 Thread Siva Chandra via lldb-commits
sivachandra created this revision.
sivachandra added a reviewer: zturner.
sivachandra added a subscriber: lldb-commits.

http://reviews.llvm.org/D17014

Files:
  packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py

Index: packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -62,7 +62,7 @@
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailureAll(archs=["i[3-6]86", "x86_x64"], 
bugnumber="llvm.org/pr23069")
+@expectedFailureAll(archs=["i[3-6]86", "x86_64"], 
bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
 def test_unsigned_char(self):


Index: packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -62,7 +62,7 @@
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailureAll(archs=["i[3-6]86", "x86_x64"], bugnumber="llvm.org/pr23069")
+@expectedFailureAll(archs=["i[3-6]86", "x86_64"], bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
 def test_unsigned_char(self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r260192 - [TestExprsChar] Fix a typo is failure archs list

2016-02-08 Thread Siva Chandra via lldb-commits
Author: sivachandra
Date: Mon Feb  8 20:18:50 2016
New Revision: 260192

URL: http://llvm.org/viewvc/llvm-project?rev=260192&view=rev
Log:
[TestExprsChar] Fix a typo is failure archs list

Reviewers: zturner

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py?rev=260192&r1=260191&r2=260192&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
 Mon Feb  8 20:18:50 2016
@@ -62,7 +62,7 @@ class ExprCharTestCase(TestBase):
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailureAll(archs=["i[3-6]86", "x86_x64"], 
bugnumber="llvm.org/pr23069")
+@expectedFailureAll(archs=["i[3-6]86", "x86_64"], 
bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
 def test_unsigned_char(self):


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


Re: [Lldb-commits] [PATCH] D17014: [TestExprsChar] Fix a typo is failure archs list

2016-02-08 Thread Siva Chandra via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260192: [TestExprsChar] Fix a typo is failure archs list 
(authored by sivachandra).

Changed prior to commit:
  http://reviews.llvm.org/D17014?vs=47283&id=47284#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17014

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -62,7 +62,7 @@
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailureAll(archs=["i[3-6]86", "x86_x64"], 
bugnumber="llvm.org/pr23069")
+@expectedFailureAll(archs=["i[3-6]86", "x86_64"], 
bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
 def test_unsigned_char(self):


Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -62,7 +62,7 @@
 def test_signed_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})
 
-@expectedFailureAll(archs=["i[3-6]86", "x86_x64"], bugnumber="llvm.org/pr23069")
+@expectedFailureAll(archs=["i[3-6]86", "x86_64"], bugnumber="llvm.org/pr23069")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @expectedFailureAll(triple = 'mips*', bugnumber="llvm.org/pr23069")
 def test_unsigned_char(self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r260199 - Fix an issue where pressing CTRL+C in the interactive script interpreter causes LLDB to crash

2016-02-08 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Feb  8 23:46:47 2016
New Revision: 260199

URL: http://llvm.org/viewvc/llvm-project?rev=260199&view=rev
Log:
Fix an issue where pressing CTRL+C in the interactive script interpreter causes 
LLDB to crash

This is because PyThreadState_Get() assumes a non-NULL thread state and crashes 
otherwise; but PyThreadState_GET is just a shortcut (in non-Python-debugging 
builds) for the global variable that holds the thread state

The behavior of CTRL+C is slightly more erratic than one would like. CTRL+C in 
the middle of execution of Python code will cause that execution to be 
interrupted (e.g. time.sleep(1000)), but a CTRL+C at the prompt will just cause 
a KeyboardInterrupt and not exit the interpreter - worse, it will only trigger 
the exception once one presses ENTER.

None of this is optimal, of course, but I don't have a lot of time to appease 
the Python deities with the proper spells right now, and fixing the crasher is 
already a good thing in and of itself


Modified:

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=260199&r1=260198&r2=260199&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Mon Feb  8 23:46:47 2016
@@ -1019,7 +1019,7 @@ ScriptInterpreterPython::Interrupt()
 
 if (IsExecutingPython())
 {
-PyThreadState *state = PyThreadState_Get();
+PyThreadState *state = PyThreadState_GET();
 if (!state)
 state = GetThreadState();
 if (state)


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