Re: [Lldb-commits] [lldb] r280344 - XFail TestMemoryFind on 32-bit architectures

2016-09-02 Thread Pavel Labath via lldb-commits
Yeah, sorry about that, I wrote that message in a hurry.

This was a generic issue with expressions in backticks (``) concerning the
printing of pointers (or even integers, as I later found out) of different
sizes. Basically a 64-bit pointer would get printed as a decimal value, but
a 32-bit one in hex. So when you wrote "memory find `stringdata`", in the
32bit case, the "find" command got the wrong address and could not find the
string properly. I have put up  to address
that.

pl

On 1 September 2016 at 19:19, Enrico Granata  wrote:

> I am probably being a little dense right now, but I can't seem to find
> (const char*)0x1000 anywhere in the test case code...
>
> On Sep 1, 2016, at 2:17 AM, Pavel Labath via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
> Author: labath
> Date: Thu Sep  1 04:17:37 2016
> New Revision: 280344
>
> URL: http://llvm.org/viewvc/llvm-project?rev=280344&view=rev
> Log:
> XFail TestMemoryFind on 32-bit architectures
>
> the test fails for a very prosaic reason: `(const char *)0x1000` returns
> "4096" on x86_64 and
> "1000" (without the "0x") on i386. I haven't tried other 32-bit arches,
> but I am guessing the
> behaviour is the same. XFAIL until someone can get a chance to look at
> this.
>
> Modified:
>lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/
> TestMemoryFind.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/
> functionalities/memory/find/TestMemoryFind.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/memory/find/
> TestMemoryFind.py?rev=280344&r1=280343&r2=280344&view=diff
> 
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> Thu Sep  1 04:17:37 2016
> @@ -11,6 +11,7 @@ import re
> import lldb
> from lldbsuite.test.lldbtest import *
> import lldbsuite.test.lldbutil as lldbutil
> +from lldbsuite.test.decorators import *
>
> class MemoryFindTestCase(TestBase):
>
> @@ -22,6 +23,7 @@ class MemoryFindTestCase(TestBase):
> # Find the line number to break inside main().
> self.line = line_number('main.cpp', '// break here')
>
> +@expectedFailureAll(archs=["i386", "arm"])
> def test_memory_find(self):
> """Test the 'memory find' command."""
> self.build()
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r280477 - Bump up TestCallWithTimeout timeout

2016-09-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Sep  2 04:25:42 2016
New Revision: 280477

URL: http://llvm.org/viewvc/llvm-project?rev=280477&view=rev
Log:
Bump up TestCallWithTimeout timeout

Still a bit flaky on remote targets. Trying a larger bump this time. :/

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py?rev=280477&r1=280476&r2=280477&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 Fri Sep  2 04:25:42 2016
@@ -57,7 +57,7 @@ class ExprCommandWithTimeoutsTestCase(Te
 
 frame = thread.GetFrameAtIndex(0)
 
-value = frame.EvaluateExpression("wait_a_while(30)", options)
+value = frame.EvaluateExpression("wait_a_while(100)", options)
 self.assertTrue (value.IsValid())
 self.assertFalse (value.GetError().Success())
 
@@ -65,7 +65,7 @@ class ExprCommandWithTimeoutsTestCase(Te
 interp = self.dbg.GetCommandInterpreter()
 
 result = lldb.SBCommandReturnObject()
-return_value = interp.HandleCommand("expr -t 100 -u true -- 
wait_a_while(30)", result)
+return_value = interp.HandleCommand("expr -t 100 -u true -- 
wait_a_while(100)", result)
 self.assertTrue (return_value == lldb.eReturnStatusFailed)
 
 # Okay, now do it again with long enough time outs:


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


[Lldb-commits] [lldb] r280476 - Make Scalar::GetValue more consistent

2016-09-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Sep  2 04:25:36 2016
New Revision: 280476

URL: http://llvm.org/viewvc/llvm-project?rev=280476&view=rev
Log:
Make Scalar::GetValue more consistent

Summary:
It seems the original intention of the function was printing signed values in 
decimal format, and
unsigned values in hex (without the leading "0x"). However, signed and unsigned 
long were
exchanged, which lead to amusing test failures in TestMemoryFind.py.

Instead of just switching the two, I think we should just print everything in 
decimal here, as
the current behaviour is very confusing (especially when one does not request 
printing of types).
Nothing seems to depend on this behaviour except and we already have a way for 
the user to
request the format he wants when printing values for most commands (which 
presumably does not go
through this function).

I also add a unit tests for the function in question.

Reviewers: clayborg, granata.enrico

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D24126

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
lldb/trunk/source/Core/Scalar.cpp
lldb/trunk/unittests/Core/ScalarTest.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py?rev=280476&r1=280475&r2=280476&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 Fri Sep  2 04:25:36 2016
@@ -23,7 +23,6 @@ class MemoryFindTestCase(TestBase):
 # Find the line number to break inside main().
 self.line = line_number('main.cpp', '// break here')
 
-@expectedFailureAll(archs=["i386", "arm"])
 def test_memory_find(self):
 """Test the 'memory find' command."""
 self.build()

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=280476&r1=280475&r2=280476&view=diff
==
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Fri Sep  2 04:25:36 2016
@@ -308,18 +308,16 @@ Scalar::GetValue (Stream *s, bool show_t
 case e_void:
 break;
 case e_sint:
-case e_ulong:
+case e_slong:
 case e_slonglong:
 case e_sint128:
 case e_sint256:
-s->Printf("%s",m_integer.toString(10,true).c_str());
-break;
 case e_uint:
-case e_slong:
+case e_ulong:
 case e_ulonglong:
 case e_uint128:
 case e_uint256:
-s->Printf("%s",m_integer.toString(16,false).c_str());
+s->PutCString(m_integer.toString(10, true).c_str());
 break;
 case e_float:
 case e_double:

Modified: lldb/trunk/unittests/Core/ScalarTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ScalarTest.cpp?rev=280476&r1=280475&r2=280476&view=diff
==
--- lldb/trunk/unittests/Core/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Core/ScalarTest.cpp Fri Sep  2 04:25:36 2016
@@ -19,6 +19,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Core/StreamString.h"
 
 using namespace lldb_private;
 
@@ -103,3 +104,31 @@ TEST(ScalarTest, ExtractBitfield)
 ASSERT_TRUE(u_scalar.ExtractBitfield(len - 4, 4));
 ASSERT_EQ(0, memcmp(&b2, u_scalar.GetBytes(), sizeof(b2)));
 }
+
+template 
+static std::string
+ScalarGetValue(T value)
+{
+StreamString stream;
+Scalar(value).GetValue(&stream, false);
+return stream.GetString();
+}
+
+TEST(ScalarTest, GetValue)
+{
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345678", ScalarGetValue(12345678L));
+EXPECT_EQ("-12345678", ScalarGetValue(-12345678L));
+EXPECT_EQ("12345678", ScalarGetValue(12345678UL));
+
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123LL));
+EXPECT_EQ("-1234567890123", ScalarGetValue(-1234567890123LL));
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123ULL));
+}


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


Re: [Lldb-commits] [PATCH] D24126: Make Scalar::GetValue more consistent

2016-09-02 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280476: Make Scalar::GetValue more consistent (authored by 
labath).

Changed prior to commit:
  https://reviews.llvm.org/D24126?vs=69979&id=70140#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24126

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
  lldb/trunk/source/Core/Scalar.cpp
  lldb/trunk/unittests/Core/ScalarTest.cpp

Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
@@ -23,7 +23,6 @@
 # Find the line number to break inside main().
 self.line = line_number('main.cpp', '// break here')
 
-@expectedFailureAll(archs=["i386", "arm"])
 def test_memory_find(self):
 """Test the 'memory find' command."""
 self.build()
Index: lldb/trunk/unittests/Core/ScalarTest.cpp
===
--- lldb/trunk/unittests/Core/ScalarTest.cpp
+++ lldb/trunk/unittests/Core/ScalarTest.cpp
@@ -19,6 +19,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Core/StreamString.h"
 
 using namespace lldb_private;
 
@@ -103,3 +104,31 @@
 ASSERT_TRUE(u_scalar.ExtractBitfield(len - 4, 4));
 ASSERT_EQ(0, memcmp(&b2, u_scalar.GetBytes(), sizeof(b2)));
 }
+
+template 
+static std::string
+ScalarGetValue(T value)
+{
+StreamString stream;
+Scalar(value).GetValue(&stream, false);
+return stream.GetString();
+}
+
+TEST(ScalarTest, GetValue)
+{
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345678", ScalarGetValue(12345678L));
+EXPECT_EQ("-12345678", ScalarGetValue(-12345678L));
+EXPECT_EQ("12345678", ScalarGetValue(12345678UL));
+
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123LL));
+EXPECT_EQ("-1234567890123", ScalarGetValue(-1234567890123LL));
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123ULL));
+}
Index: lldb/trunk/source/Core/Scalar.cpp
===
--- lldb/trunk/source/Core/Scalar.cpp
+++ lldb/trunk/source/Core/Scalar.cpp
@@ -308,18 +308,16 @@
 case e_void:
 break;
 case e_sint:
-case e_ulong:
+case e_slong:
 case e_slonglong:
 case e_sint128:
 case e_sint256:
-s->Printf("%s",m_integer.toString(10,true).c_str());
-break;
 case e_uint:
-case e_slong:
+case e_ulong:
 case e_ulonglong:
 case e_uint128:
 case e_uint256:
-s->Printf("%s",m_integer.toString(16,false).c_str());
+s->PutCString(m_integer.toString(10, true).c_str());
 break;
 case e_float:
 case e_double:


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
@@ -23,7 +23,6 @@
 # Find the line number to break inside main().
 self.line = line_number('main.cpp', '// break here')
 
-@expectedFailureAll(archs=["i386", "arm"])
 def test_memory_find(self):
 """Test the 'memory find' command."""
 self.build()
Index: lldb/trunk/unittests/Core/ScalarTest.cpp
===
--- lldb/trunk/unittests/Core/ScalarTest.cpp
+++ lldb/trunk/unittests/Core/ScalarTest.cpp
@@ -19,6 +19,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Core/StreamString.h"
 
 using namespace lldb_private;
 
@@ -103,3 +104,31 @@
 ASSERT_TRUE(u_scalar.ExtractBitfield(len - 4, 4));
 ASSERT_EQ(0, memcmp(&b2, u_scalar.GetBytes(), sizeof(b2)));
 }
+
+template 
+static std::string
+ScalarGetValue(T value)
+{
+StreamString stream;
+Scalar(value).GetValue(&stream, false);
+return stream.GetString();
+}
+
+TEST(ScalarTest, GetValue)
+{
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+
+EXPECT_EQ("12345678", ScalarGetValue(12345678L));
+

Re: [Lldb-commits] [PATCH] D23545: Minidump parsing

2016-09-02 Thread Pavel Labath via lldb-commits
labath added inline comments.


Comment at: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp:146
@@ +145,3 @@
+break;
+}
+

You have a "enumeration not handled in a switch" warning here. Could you do 
something about that?


Repository:
  rL LLVM

https://reviews.llvm.org/D23545



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


[Lldb-commits] [lldb] r280478 - Revert "Make Scalar::GetValue more consistent"

2016-09-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Sep  2 04:52:18 2016
New Revision: 280478

URL: http://llvm.org/viewvc/llvm-project?rev=280478&view=rev
Log:
Revert "Make Scalar::GetValue more consistent"

This reverts commit r280476 as it breaks several tests on i386. I was fixing an 
32-bit
breakage, and I did not run the 32-bit test suite before submitting, oops.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
lldb/trunk/source/Core/Scalar.cpp
lldb/trunk/unittests/Core/ScalarTest.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py?rev=280478&r1=280477&r2=280478&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 Fri Sep  2 04:52:18 2016
@@ -23,6 +23,7 @@ class MemoryFindTestCase(TestBase):
 # Find the line number to break inside main().
 self.line = line_number('main.cpp', '// break here')
 
+@expectedFailureAll(archs=["i386", "arm"])
 def test_memory_find(self):
 """Test the 'memory find' command."""
 self.build()

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=280478&r1=280477&r2=280478&view=diff
==
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Fri Sep  2 04:52:18 2016
@@ -308,16 +308,18 @@ Scalar::GetValue (Stream *s, bool show_t
 case e_void:
 break;
 case e_sint:
-case e_slong:
+case e_ulong:
 case e_slonglong:
 case e_sint128:
 case e_sint256:
+s->Printf("%s",m_integer.toString(10,true).c_str());
+break;
 case e_uint:
-case e_ulong:
+case e_slong:
 case e_ulonglong:
 case e_uint128:
 case e_uint256:
-s->PutCString(m_integer.toString(10, true).c_str());
+s->Printf("%s",m_integer.toString(16,false).c_str());
 break;
 case e_float:
 case e_double:

Modified: lldb/trunk/unittests/Core/ScalarTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ScalarTest.cpp?rev=280478&r1=280477&r2=280478&view=diff
==
--- lldb/trunk/unittests/Core/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Core/ScalarTest.cpp Fri Sep  2 04:52:18 2016
@@ -19,7 +19,6 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Endian.h"
-#include "lldb/Core/StreamString.h"
 
 using namespace lldb_private;
 
@@ -104,31 +103,3 @@ TEST(ScalarTest, ExtractBitfield)
 ASSERT_TRUE(u_scalar.ExtractBitfield(len - 4, 4));
 ASSERT_EQ(0, memcmp(&b2, u_scalar.GetBytes(), sizeof(b2)));
 }
-
-template 
-static std::string
-ScalarGetValue(T value)
-{
-StreamString stream;
-Scalar(value).GetValue(&stream, false);
-return stream.GetString();
-}
-
-TEST(ScalarTest, GetValue)
-{
-EXPECT_EQ("12345", ScalarGetValue(12345));
-EXPECT_EQ("-12345", ScalarGetValue(-12345));
-EXPECT_EQ("12345", ScalarGetValue(12345));
-
-EXPECT_EQ("12345", ScalarGetValue(12345));
-EXPECT_EQ("-12345", ScalarGetValue(-12345));
-EXPECT_EQ("12345", ScalarGetValue(12345));
-
-EXPECT_EQ("12345678", ScalarGetValue(12345678L));
-EXPECT_EQ("-12345678", ScalarGetValue(-12345678L));
-EXPECT_EQ("12345678", ScalarGetValue(12345678UL));
-
-EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123LL));
-EXPECT_EQ("-1234567890123", ScalarGetValue(-1234567890123LL));
-EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123ULL));
-}


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


[Lldb-commits] [lldb] r280480 - Reapply "Make Scalar::GetValue more consistent"

2016-09-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Sep  2 05:58:52 2016
New Revision: 280480

URL: http://llvm.org/viewvc/llvm-project?rev=280480&view=rev
Log:
Reapply "Make Scalar::GetValue more consistent"

this is a resubmission of r280476. The problem with the original commit was 
that it was printing
out all numbers as signed, which was wrong for unsigned numbers with the MSB 
set. Fix that and
add a unit test covering that case.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
lldb/trunk/source/Core/Scalar.cpp
lldb/trunk/unittests/Core/ScalarTest.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py?rev=280480&r1=280479&r2=280480&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
 Fri Sep  2 05:58:52 2016
@@ -23,7 +23,6 @@ class MemoryFindTestCase(TestBase):
 # Find the line number to break inside main().
 self.line = line_number('main.cpp', '// break here')
 
-@expectedFailureAll(archs=["i386", "arm"])
 def test_memory_find(self):
 """Test the 'memory find' command."""
 self.build()

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=280480&r1=280479&r2=280480&view=diff
==
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Fri Sep  2 05:58:52 2016
@@ -308,18 +308,18 @@ Scalar::GetValue (Stream *s, bool show_t
 case e_void:
 break;
 case e_sint:
-case e_ulong:
+case e_slong:
 case e_slonglong:
 case e_sint128:
 case e_sint256:
-s->Printf("%s",m_integer.toString(10,true).c_str());
+s->PutCString(m_integer.toString(10, true).c_str());
 break;
 case e_uint:
-case e_slong:
+case e_ulong:
 case e_ulonglong:
 case e_uint128:
 case e_uint256:
-s->Printf("%s",m_integer.toString(16,false).c_str());
+s->PutCString(m_integer.toString(10, false).c_str());
 break;
 case e_float:
 case e_double:

Modified: lldb/trunk/unittests/Core/ScalarTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ScalarTest.cpp?rev=280480&r1=280479&r2=280480&view=diff
==
--- lldb/trunk/unittests/Core/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Core/ScalarTest.cpp Fri Sep  2 05:58:52 2016
@@ -19,6 +19,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Core/StreamString.h"
 
 using namespace lldb_private;
 
@@ -103,3 +104,39 @@ TEST(ScalarTest, ExtractBitfield)
 ASSERT_TRUE(u_scalar.ExtractBitfield(len - 4, 4));
 ASSERT_EQ(0, memcmp(&b2, u_scalar.GetBytes(), sizeof(b2)));
 }
+
+template 
+static std::string
+ScalarGetValue(T value)
+{
+StreamString stream;
+Scalar(value).GetValue(&stream, false);
+return stream.GetString();
+}
+
+TEST(ScalarTest, GetValue)
+{
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ(std::to_string(std::numeric_limits::max()),
+  ScalarGetValue(std::numeric_limits::max()));
+
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ("-12345", ScalarGetValue(-12345));
+EXPECT_EQ("12345", ScalarGetValue(12345));
+EXPECT_EQ(std::to_string(std::numeric_limits::max()),
+  ScalarGetValue(std::numeric_limits::max()));
+
+EXPECT_EQ("12345678", ScalarGetValue(12345678L));
+EXPECT_EQ("-12345678", ScalarGetValue(-12345678L));
+EXPECT_EQ("12345678", ScalarGetValue(12345678UL));
+EXPECT_EQ(std::to_string(std::numeric_limits::max()),
+  ScalarGetValue(std::numeric_limits::max()));
+
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123LL));
+EXPECT_EQ("-1234567890123", ScalarGetValue(-1234567890123LL));
+EXPECT_EQ("1234567890123", ScalarGetValue(1234567890123ULL));
+EXPECT_EQ(std::to_string(std::numeric_limits::max()),
+  ScalarGetValue(std::numeric_limits::max()));
+}


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


Re: [Lldb-commits] [PATCH] D23545: Minidump parsing

2016-09-02 Thread Dimitar Vlahovski via lldb-commits
dvlahovski added inline comments.


Comment at: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp:146
@@ +145,3 @@
+break;
+}
+

labath wrote:
> You have a "enumeration not handled in a switch" warning here. Could you do 
> something about that?
Yes, I fixed it locally. Will submit it with the next CL. :)


Repository:
  rL LLVM

https://reviews.llvm.org/D23545



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


[Lldb-commits] [lldb] r280490 - Fix 2 waring in the OCaml AST context

2016-09-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Fri Sep  2 10:52:19 2016
New Revision: 280490

URL: http://llvm.org/viewvc/llvm-project?rev=280490&view=rev
Log:
Fix 2 waring in the OCaml AST context

Modified:
lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
lldb/trunk/source/Symbol/OCamlASTContext.cpp

Modified: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/OCamlASTContext.h?rev=280490&r1=280489&r2=280490&view=diff
==
--- lldb/trunk/include/lldb/Symbol/OCamlASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/OCamlASTContext.h Fri Sep  2 10:52:19 2016
@@ -334,7 +334,6 @@ class OCamlASTContext : public TypeSyste
 
   private:
 int m_pointer_byte_size;
-int m_int_byte_size;
 std::unique_ptr m_dwarf_ast_parser_ap;
 OCamlTypeMap m_base_type_map;
 

Modified: lldb/trunk/source/Symbol/OCamlASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/OCamlASTContext.cpp?rev=280490&r1=280489&r2=280490&view=diff
==
--- lldb/trunk/source/Symbol/OCamlASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/OCamlASTContext.cpp Fri Sep  2 10:52:19 2016
@@ -350,8 +350,6 @@ OCamlASTContext::IsIntegerType(lldb::opa
 case OCamlPrimitiveType::eTypeInt:
 is_signed = true;
 return true;
-default:
-break;
 }
 }
 


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


[Lldb-commits] [lldb] r280492 - Fix build breakage caused by r280490

2016-09-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Fri Sep  2 10:56:33 2016
New Revision: 280492

URL: http://llvm.org/viewvc/llvm-project?rev=280492&view=rev
Log:
Fix build breakage caused by r280490

Modified:
lldb/trunk/source/Symbol/OCamlASTContext.cpp

Modified: lldb/trunk/source/Symbol/OCamlASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/OCamlASTContext.cpp?rev=280492&r1=280491&r2=280492&view=diff
==
--- lldb/trunk/source/Symbol/OCamlASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/OCamlASTContext.cpp Fri Sep  2 10:56:33 2016
@@ -128,8 +128,7 @@ namespace
 
 OCamlASTContext::OCamlASTContext()
 : TypeSystem(eKindOCaml),
-  m_pointer_byte_size(0),
-  m_int_byte_size(0)
+  m_pointer_byte_size(0)
 {
 }
 


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


[Lldb-commits] LLVM buildmaster will be updated and restarted tonight

2016-09-02 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


[Lldb-commits] [lldb] r280513 - Check for null

2016-09-02 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Sep  2 13:15:48 2016
New Revision: 280513

URL: http://llvm.org/viewvc/llvm-project?rev=280513&view=rev
Log:
Check for null


Modified:
lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=280513&r1=280512&r2=280513&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Fri Sep  2 13:15:48 2016
@@ -1251,6 +1251,13 @@ ValueObject::ReadPointedString (lldb::Da
 if (cstr_address_type == eAddressTypeHost && is_array)
 {
 const char* cstr = GetDataExtractor().PeekCStr(0);
+if (cstr == nullptr)
+{
+s << "";
+error.SetErrorString("invalid address");
+CopyStringDataToBufferSP(s, buffer_sp);
+return {0,was_capped};
+}
 buffer_sp.reset(new DataBufferHeap(cstr_len, 0));
 memcpy(buffer_sp->GetBytes(), cstr, cstr_len);
 return {cstr_len,was_capped};


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


[Lldb-commits] SVN mirror in the LLVM Lab is behind the master SVN

2016-09-02 Thread Galina Kistanova via lldb-commits
SVN mirror in the LLVM Lab is behind the master SVN. This affects the build
bots.
I'm looking in to this.


Thanks

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


[Lldb-commits] [PATCH] D24202: [lldb-mi] Fix parsing expressions to evaluate with spaces and optional args

2016-09-02 Thread Ed Munoz via lldb-commits
edmunoz created this revision.
edmunoz added a reviewer: ki.stfu.
edmunoz added a subscriber: lldb-commits.
edmunoz set the repository for this revision to rL LLVM.
edmunoz added a project: LLDB.
Herald added a subscriber: ki.stfu.

When extracting options for long options (starting with "--"), the use of
MIUtilString::SplitConsiderQuotes to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.

Repository:
  rL LLVM

https://reviews.llvm.org/D24202

Files:
  packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
  tools/lldb-mi/MICmdArgValOptionLong.cpp

Index: tools/lldb-mi/MICmdArgValOptionLong.cpp
===
--- tools/lldb-mi/MICmdArgValOptionLong.cpp
+++ tools/lldb-mi/MICmdArgValOptionLong.cpp
@@ -187,15 +187,9 @@
 bool
 CMICmdArgValOptionLong::ExtractExpectedOptions(CMICmdArgContext &vrwTxt, const 
MIuint nArgIndex)
 {
-CMIUtilString::VecString_t vecOptions;
-MIuint nOptionsPresent = 0;
-if ((m_eExpectingOptionType != eArgValType_StringQuoted) && 
(m_eExpectingOptionType != eArgValType_StringQuotedNumber) &&
-(m_eExpectingOptionType != eArgValType_StringQuotedNumberPath))
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().Split(" ", vecOptions);
-else
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().SplitConsiderQuotes(" ", 
vecOptions);
-if (nOptionsPresent == 0)
+if (vrwTxt.GetNumberArgsPresent() == 0)
 return MIstatus::failure;
+CMIUtilString::VecString_t vecOptions = vrwTxt.GetArgs();
 
 MIuint nArgIndexCnt = 0;
 MIuint nTypeCnt = 0;
Index: packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
@@ -128,6 +128,12 @@
 # FIXME: The name below is not correct. It should be "var.*argv[0]".
 
self.expect("\^done,numchild=\"1\",children=\[child=\{name=\"var6\.\*\$[0-9]+\",exp=\"\*\$[0-9]+\",numchild=\"0\",type=\"const
 char\",thread-id=\"4294967295\",value=\"47 
'/'\",has_more=\"0\"\}\],has_more=\"0\"") #FIXME -var-list-children shows 
invalid thread-id
 
+# Print an expression with spaces and optional arguments
+self.runCmd("-data-evaluate-expression \"a + b\"")
+self.expect("\^done,value=\"12\"")
+self.runCmd("-var-create var7 * \"a + b\" --thread 1 --frame 0")
+
self.expect("\^done,name=\"var7\",numchild=\"0\",value=\"12\",type=\"int\",thread-id=\"1\",has_more=\"0\"")
+
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots


Index: tools/lldb-mi/MICmdArgValOptionLong.cpp
===
--- tools/lldb-mi/MICmdArgValOptionLong.cpp
+++ tools/lldb-mi/MICmdArgValOptionLong.cpp
@@ -187,15 +187,9 @@
 bool
 CMICmdArgValOptionLong::ExtractExpectedOptions(CMICmdArgContext &vrwTxt, const MIuint nArgIndex)
 {
-CMIUtilString::VecString_t vecOptions;
-MIuint nOptionsPresent = 0;
-if ((m_eExpectingOptionType != eArgValType_StringQuoted) && (m_eExpectingOptionType != eArgValType_StringQuotedNumber) &&
-(m_eExpectingOptionType != eArgValType_StringQuotedNumberPath))
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().Split(" ", vecOptions);
-else
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().SplitConsiderQuotes(" ", vecOptions);
-if (nOptionsPresent == 0)
+if (vrwTxt.GetNumberArgsPresent() == 0)
 return MIstatus::failure;
+CMIUtilString::VecString_t vecOptions = vrwTxt.GetArgs();
 
 MIuint nArgIndexCnt = 0;
 MIuint nTypeCnt = 0;
Index: packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
@@ -128,6 +128,12 @@
 # FIXME: The name below is not correct. It should be "var.*argv[0]".
 self.expect("\^done,numchild=\"1\",children=\[child=\{name=\"var6\.\*\$[0-9]+\",exp=\"\*\$[0-9]+\",numchild=\"0\",type=\"const char\",thread-id=\"4294967295\",value=\"47 '/'\",has_more=\"0\"\}\],has_more=\"0\"") #FIXME -var-list-children shows invalid thread-id
 
+# Print an expression with spaces and optional arguments
+self.runCmd("-data-evaluate-expression \"a + b\"")
+self.expect("\^done,value=\"12\"")
+self.runCmd("-var-create var7 * \"a + b\" --thread 1 --frame 0")
+self.expect("\^done,name=\"var7\",numchild=\

Re: [Lldb-commits] [PATCH] D24202: [lldb-mi] Fix parsing expressions to evaluate with spaces and optional args

2016-09-02 Thread Ed Munoz via lldb-commits
edmunoz added inline comments.


Comment at: tools/lldb-mi/MICmdArgValOptionLong.cpp:190
@@ -189,10 +189,3 @@
 {
-CMIUtilString::VecString_t vecOptions;
-MIuint nOptionsPresent = 0;
-if ((m_eExpectingOptionType != eArgValType_StringQuoted) && 
(m_eExpectingOptionType != eArgValType_StringQuotedNumber) &&
-(m_eExpectingOptionType != eArgValType_StringQuotedNumberPath))
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().Split(" ", vecOptions);
-else
-nOptionsPresent = vrwTxt.GetArgsLeftToParse().SplitConsiderQuotes(" ", 
vecOptions);
-if (nOptionsPresent == 0)
+if (vrwTxt.GetNumberArgsPresent() == 0)
 return MIstatus::failure;

We could use the size of `vrwTxt.GetArgs()` to reduce the number of calls to 
`CMIUtilString::SplitConsiderQuotes` in `CMICmdArgContext`.

I left it using the more expressive method name, but I'm open to changing it.


Repository:
  rL LLVM

https://reviews.llvm.org/D24202



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


Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex

2016-09-02 Thread Michał Górny via lldb-commits
mgorny added a comment.

In https://reviews.llvm.org/D23882#527682, @ki.stfu wrote:

> lgtm if tests are passed


I can't say tests pass for me right now, but the results (failures, errors and 
unexpected passes) are the same with and without the patch.


https://reviews.llvm.org/D23882



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


[Lldb-commits] LLVM master is back to work

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

The issue with the SVN mirror in the Lab has been resolved.

Please let me know if anything seems wrong with the builders.
Thank you for understanding.

Thanks

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