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

2016-09-01 Thread Pavel Labath via lldb-commits
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


[Lldb-commits] [PATCH] D24122: [LLDB][MIPS] Fix TestEhFrameUnwind.py for MIPS

2016-09-01 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, labath.
nitesh.jain added subscribers: jaydeep, bhushan, slthakur, lldb-commits.

This patch will fix TestEhFrameUnwind.py failure for MIPS

https://reviews.llvm.org/D24122

Files:
  packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c

Index: packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
===
--- packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
+++ packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
@@ -1,4 +1,6 @@
 void func() {
+
+#ifndef __mips__
__asm__ (
"pushq $0x10;"
".cfi_def_cfa_offset 16;"
@@ -10,11 +12,35 @@
"movq $0x48, %rax;"
"popq %rax;"
);
-
+#elif __mips64
+   __asm__ (
+"daddiu $sp,$sp,-16;"
+".cfi_def_cfa_offset 16;"
+"sd $ra,8($sp);"
+".cfi_offset 31, -8;"
+"daddiu $ra,$zero,0;"
+"ld $ra,8($sp);"
+"daddiu $sp, $sp,16;"
+".cfi_restore 31;"
+".cfi_def_cfa_offset 0;"
+   );
+#else
+   // For MIPS32
+   __asm__ (
+"addiu $sp,$sp,-8;"
+".cfi_def_cfa_offset 8;"
+"sw $ra,4($sp);"
+".cfi_offset 31, -4;"
+"addiu $ra,$zero,0;"
+"lw $ra,4($sp);"
+"addiu $sp,$sp,8;"
+".cfi_restore 31;"
+".cfi_def_cfa_offset 0;"
+   );
+#endif
 }
 
-
 int main(int argc, char const *argv[])
 {
func();
-}
\ No newline at end of file
+}


Index: packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
===
--- packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
+++ packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
@@ -1,4 +1,6 @@
 void func() {
+
+#ifndef __mips__
 	__asm__ (
 		"pushq $0x10;"
 		".cfi_def_cfa_offset 16;"
@@ -10,11 +12,35 @@
 		"movq $0x48, %rax;"
 		"popq %rax;"
 	);
-
+#elif __mips64
+   __asm__ (
+"daddiu $sp,$sp,-16;"
+".cfi_def_cfa_offset 16;"
+"sd $ra,8($sp);"
+".cfi_offset 31, -8;"
+"daddiu $ra,$zero,0;"
+"ld $ra,8($sp);"
+"daddiu $sp, $sp,16;"
+".cfi_restore 31;"
+".cfi_def_cfa_offset 0;"
+   );
+#else
+   // For MIPS32
+   __asm__ (
+"addiu $sp,$sp,-8;"
+".cfi_def_cfa_offset 8;"
+"sw $ra,4($sp);"
+".cfi_offset 31, -4;"
+"addiu $ra,$zero,0;"
+"lw $ra,4($sp);"
+"addiu $sp,$sp,8;"
+".cfi_restore 31;"
+".cfi_def_cfa_offset 0;"
+   );
+#endif
 }
 
-
 int main(int argc, char const *argv[])
 {
 	func();
-}
\ No newline at end of file
+}
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

2016-09-01 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, labath.
nitesh.jain added subscribers: jaydeep, bhushan, slthakur, lldb-commits.
Herald added a subscriber: sdardis.

The RegisterValue.SetBytes for 4 byte data followed by GetAsUInt64 for 32 bit 
big endian system will produce incorrect result. Instead use 
RegisterValue.SetUInt which will preserved endianess. This patch also add 
register read/write via PTRACE_PEEKUSER/PTRACE_POKEUSER for and fix floating 
point register read/write for MIPS.

https://reviews.llvm.org/D24124

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1840,8 +1840,12 @@
 
 // Build the reginfos response.
 StreamGDBRemote response;
+
+uint64_t value;
+value = reg_size == 4 ? *(uint32_t *)reg_bytes : *(uint64_t *)reg_bytes;
 
-RegisterValue reg_value (reg_bytes, reg_size, process_arch.GetByteOrder ());
+RegisterValue reg_value;
+reg_value.SetUInt (value, reg_size);
 Error error = reg_context_sp->WriteRegister (reg_info, reg_value);
 if (error.Fail ())
 {
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
@@ -94,15 +94,22 @@
 
 protected:
 Error
-DoReadRegisterValue(uint32_t offset,
-const char* reg_name,
-uint32_t size,
-RegisterValue &value) override;
+DoReadRegister_SR_Config (uint32_t offset,
+  const char* reg_name,
+  uint32_t size,
+  RegisterValue &value);
+
+uint32_t
+GetPtraceRegisterOffset (uint32_t reg_index,
+ const RegisterInfo *const reg_info);
+
+Error
+ReadRegisterRaw (uint32_t reg_index,
+ RegisterValue &value) override;
 
 Error
-DoWriteRegisterValue(uint32_t offset,
- const char* reg_name,
- const RegisterValue &value) override;
+WriteRegisterRaw (uint32_t reg_index,
+  const RegisterValue &value) override;
 
 Error
 DoReadWatchPointRegisterValue(lldb::tid_t tid, void* watch_readback);
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -28,9 +28,16 @@
 #include "Plugins/Process/Linux/Procfs.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_mips.h"
+
 #define NT_MIPS_MSA 0x600
 #define CONFIG5_FRE (1 << 8)
 #define SR_FR (1 << 26)
+#define FPR_BASE32
+#define PC  64
+#define CAUSE   65
+#define BADVADDR66
+#define MMHI67
+#define MMLO68
 #define NUM_REGISTERS 32
 
 #include 
@@ -649,7 +656,7 @@
 
 if (IsFPR(reg_index) || IsMSA(reg_index))
 {
-uint8_t *dst;
+uint8_t *dst, byte_size;
 uint64_t *src;
 
 // Initialise the FP and MSA buffers by reading all co-processor 1 registers
@@ -659,13 +666,14 @@
 {
 assert (reg_info->byte_offset < sizeof(UserArea));
 dst = (uint8_t *)&m_fpr + reg_info->byte_offset - (sizeof(m_gpr));
+byte_size = IsFR0 () ? 4 : 8;
 }
 else
 {
 assert (reg_info->byte_offset < sizeof(UserArea));
 dst = (uint8_t *)&m_msa + reg_info->byte_offset - (sizeof(m_gpr) + sizeof(m_fpr));
 }
-switch (reg_info->byte_size)
+switch (byte_size)
 {
 case 4:
 *(uint32_t *)dst = reg_value.GetAsUInt32();
@@ -801,7 +809,7 @@
 
 lldb::ByteOrder byte_order = GetByteOrder();
 
-uint32_t IsBigEndian = (byte_order == lldb::eByteOrderBig);
+bool IsBigEndian = (byte_order == lldb::eByteOrderBig);
 
 if (IsMSAAvailable())
 {
@@ -827,12 +835,20 @@
 // TODO: Add support for FRE
 if (IsFR0())
 {
- src = (uint8_t *)&m_fpr + 4 + (IsBigEndian * 4);
- dst = (uint8_t *)&m

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

2016-09-01 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: clayborg, granata.enrico.
labath added a subscriber: lldb-commits.

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.

https://reviews.llvm.org/D24126

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

Index: unittests/Core/ScalarTest.cpp
===
--- unittests/Core/ScalarTest.cpp
+++ 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("-1234567890124", ScalarGetValue(-1234567890123LL));
+EXPECT_EQ("1234567890122", ScalarGetValue(1234567890123ULL));
+}
Index: source/Core/Scalar.cpp
===
--- source/Core/Scalar.cpp
+++ 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: 
packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
===
--- packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
+++ 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: unittests/Core/ScalarTest.cpp
===
--- unittests/Core/ScalarTest.cpp
+++ 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("-1234567890124", ScalarGetVa

Re: [Lldb-commits] [PATCH] D24122: [LLDB][MIPS] Fix TestEhFrameUnwind.py for MIPS

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

Looks great. Thanks.


https://reviews.llvm.org/D24122



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


Re: [Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

2016-09-01 Thread Pavel Labath via lldb-commits
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

I don't think the patch can go in in this form. Also, you seem to be putting 
multiple unrelated changes in one patch. It would be much easier to review if 
you split that up into multiple patches.



Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:1844
@@ +1843,3 @@
+
+uint64_t value;
+value = reg_size == 4 ? *(uint32_t *)reg_bytes : *(uint64_t *)reg_bytes;

This looks like a massive hack. The register value object already takes a byte 
order as a parameter, so the fact that you are doing some funny endian 
conversions here means that there is something wrong. Also, this probably will 
not work for registers whose sizes are not 4 or 8 (%ah, %ax, all SSE registers, 
etc.).

I think we'll need to find a different way to fix this.


https://reviews.llvm.org/D24124



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


[Lldb-commits] [lldb] r280356 - Minidump parsing

2016-09-01 Thread Dimitar Vlahovski via lldb-commits
Author: dvlahovski
Date: Thu Sep  1 06:29:53 2016
New Revision: 280356

URL: http://llvm.org/viewvc/llvm-project?rev=280356&view=rev
Log:
Minidump parsing

Summary:
This is a Minidump parsing code.
There are still some more structures/data streams that need to be added.
The aim ot this is to be used in the implementation of
a minidump debugging plugin that works on all platforms/architectures.
Currently we have a windows-only plugin that uses the WinAPI to parse
the dump files.
Also added unittests for the current functionality.

Reviewers: labath, amccarth

Subscribers: tberghammer, danalbert, srhines, lldb-commits, dschuff

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

Added:
lldb/trunk/source/Plugins/Process/minidump/
lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.cpp
lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h
lldb/trunk/unittests/Process/minidump/
lldb/trunk/unittests/Process/minidump/CMakeLists.txt
lldb/trunk/unittests/Process/minidump/Inputs/
lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.dmp
lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/source/Plugins/Process/CMakeLists.txt
lldb/trunk/unittests/Process/CMakeLists.txt

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=280356&r1=280355&r2=280356&view=diff
==
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Thu Sep  1 06:29:53 2016
@@ -81,6 +81,7 @@ set( LLDB_USED_LIBS
   lldbPluginInstrumentationRuntimeThreadSanitizer
   lldbPluginSystemRuntimeMacOSX
   lldbPluginProcessElfCore
+  lldbPluginProcessMinidump
   lldbPluginJITLoaderGDB
   lldbPluginExpressionParserClang
   lldbPluginExpressionParserGo

Modified: lldb/trunk/source/Plugins/Process/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/CMakeLists.txt?rev=280356&r1=280355&r2=280356&view=diff
==
--- lldb/trunk/source/Plugins/Process/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/CMakeLists.txt Thu Sep  1 06:29:53 2016
@@ -17,3 +17,4 @@ add_subdirectory(gdb-remote)
 add_subdirectory(Utility)
 add_subdirectory(mach-core)
 add_subdirectory(elf-core)
+add_subdirectory(minidump)

Added: lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt?rev=280356&view=auto
==
--- lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt (added)
+++ lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt Thu Sep  1 
06:29:53 2016
@@ -0,0 +1,6 @@
+include_directories(../Utility)
+
+add_lldb_library(lldbPluginProcessMinidump
+  MinidumpTypes.cpp
+  MinidumpParser.cpp
+  )

Added: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp?rev=280356&view=auto
==
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp (added)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp Thu Sep  1 
06:29:53 2016
@@ -0,0 +1,160 @@
+//===-- MinidumpParser.cpp ---*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// Project includes
+#include "MinidumpParser.h"
+
+// Other libraries and framework includes
+// C includes
+// C++ includes
+
+using namespace lldb_private;
+using namespace minidump;
+
+llvm::Optional
+MinidumpParser::Create(const lldb::DataBufferSP &data_buf_sp)
+{
+if (data_buf_sp->GetByteSize() < sizeof(MinidumpHeader))
+{
+return llvm::None;
+}
+
+llvm::ArrayRef header_data(data_buf_sp->GetBytes(), 
sizeof(MinidumpHeader));
+const MinidumpHeader *header = MinidumpHeader::Parse(header_data);
+
+if (header == nullptr)
+{
+return llvm::None;
+}
+
+lldb::offset_t directory_list_offset = header->stream_directory_rva;
+// check if there is enough data for the parsing of the directory list
+if ((directory_list_offset + sizeof(MinidumpDirectory) * 
header->stream

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

2016-09-01 Thread Dimitar Vlahovski via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280356: Minidump parsing (authored by dvlahovski).

Changed prior to commit:
  https://reviews.llvm.org/D23545?vs=69340&id=69988#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23545

Files:
  lldb/trunk/cmake/LLDBDependencies.cmake
  lldb/trunk/source/Plugins/Process/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/minidump/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
  lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
  lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.cpp
  lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h
  lldb/trunk/unittests/Process/CMakeLists.txt
  lldb/trunk/unittests/Process/minidump/CMakeLists.txt
  lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
  lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.dmp
  lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Index: lldb/trunk/cmake/LLDBDependencies.cmake
===
--- lldb/trunk/cmake/LLDBDependencies.cmake
+++ lldb/trunk/cmake/LLDBDependencies.cmake
@@ -81,6 +81,7 @@
   lldbPluginInstrumentationRuntimeThreadSanitizer
   lldbPluginSystemRuntimeMacOSX
   lldbPluginProcessElfCore
+  lldbPluginProcessMinidump
   lldbPluginJITLoaderGDB
   lldbPluginExpressionParserClang
   lldbPluginExpressionParserGo
Index: lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
===
--- lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
+++ lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
@@ -0,0 +1,25 @@
+// Example source from breakpad's linux tutorial
+// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/linux_starter_guide.md
+
+#include 
+#include 
+#include 
+
+#include "client/linux/handler/exception_handler.h"
+
+
+static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
+void* context, bool succeeded) {
+printf("Dump path: %s\n", descriptor.path());
+return succeeded;
+}
+
+void crash() { volatile int* a = (int*)(NULL); *a = 1; }
+
+int main(int argc, char* argv[]) {
+google_breakpad::MinidumpDescriptor descriptor("/tmp");
+google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1);
+printf("pid: %d\n", getpid());
+crash();
+return 0;
+}
Index: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
===
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -0,0 +1,97 @@
+//===-- MinidumpTypesTest.cpp ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// Project includes
+#include "Plugins/Process/minidump/MinidumpParser.h"
+#include "Plugins/Process/minidump/MinidumpTypes.h"
+
+// Other libraries and framework includes
+#include "gtest/gtest.h"
+
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Core/DataExtractor.h"
+#include "lldb/Host/FileSpec.h"
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+
+// C includes
+
+// C++ includes
+#include 
+
+extern const char *TestMainArgv0;
+
+using namespace lldb_private;
+using namespace minidump;
+
+class MinidumpParserTest : public testing::Test
+{
+public:
+void
+SetUp() override
+{
+llvm::StringRef dmp_folder = llvm::sys::path::parent_path(TestMainArgv0);
+inputs_folder = dmp_folder;
+llvm::sys::path::append(inputs_folder, "Inputs");
+}
+
+void
+SetUpData(const char *minidump_filename, size_t load_size = SIZE_MAX)
+{
+llvm::SmallString<128> filename = inputs_folder;
+llvm::sys::path::append(filename, minidump_filename);
+FileSpec minidump_file(filename.c_str(), false);
+lldb::DataBufferSP data_sp(minidump_file.MemoryMapFileContents(0, load_size));
+llvm::Optional optional_parser = MinidumpParser::Create(data_sp);
+ASSERT_TRUE(optional_parser.hasValue());
+parser.reset(new MinidumpParser(optional_parser.getValue()));
+ASSERT_GT(parser->GetByteSize(), 0UL);
+}
+
+llvm::SmallString<128> inputs_folder;
+std::unique_ptr parser;
+};
+
+TEST_F(MinidumpParserTest, GetThreads)
+{
+SetUpData("linux-x86_64.dmp");
+llvm::Optional> thread_list;
+
+thread_list = parser->GetThreads();
+ASSERT_TRUE(thread_list.hasValue());
+ASSERT_EQ(1UL, thread_list->size());
+
+const MinidumpThread *thread = thread_list.getValue()[0];
+ASSERT_EQ(16001UL, thread->thread_id);
+}
+
+TES

Re: [Lldb-commits] [PATCH] D24078: [zorg] Move lldb-x86_64-ubuntu-14.04-cmake buildbot to the stable category

2016-09-01 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280362: [zorg] Move lldb-x86_64-ubuntu-14.04-cmake buildbot 
to the stable category (authored by labath).

Changed prior to commit:
  https://reviews.llvm.org/D24078?vs=69853&id=69996#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24078

Files:
  zorg/trunk/buildbot/osuosl/master/config/builders.py

Index: zorg/trunk/buildbot/osuosl/master/config/builders.py
===
--- zorg/trunk/buildbot/osuosl/master/config/builders.py
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py
@@ -612,6 +612,14 @@
 downloadBinary=False,
 buildAndroid=True,
 runTest=False)},
+{'name': "lldb-x86_64-ubuntu-14.04-cmake",
+ 'slavenames': ["lldb-build1-ubuntu-1404"],
+ 'builddir': "buildWorkingDir",
+ 'category' : 'lldb',
+ 'factory': LLDBBuilder.getLLDBScriptCommandsFactory(
+downloadBinary=False,
+buildAndroid=False,
+runTest=True)},
 {'name': "lldb-amd64-ninja-netbsd7",
  'slavenames': ["lldb-amd64-ninja-netbsd7"],
  'builddir': "build",
@@ -1077,14 +1085,6 @@
  'factory': LLDBBuilder.getLLDBBuildFactory(triple=None, # use default
 
extra_configure_args=['--enable-cxx11', '--enable-optimized', 
'--enable-assertions'],
 
env={'PATH':'/home/llvmbb/bin/clang-latest/bin:/home/llvmbb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'})},
-{'name': "lldb-x86_64-ubuntu-14.04-cmake",
- 'slavenames': ["lldb-build1-ubuntu-1404"],
- 'builddir': "buildWorkingDir",
- 'category' : 'lldb',
- 'factory': LLDBBuilder.getLLDBScriptCommandsFactory(
-downloadBinary=False,
-buildAndroid=False,
-runTest=True)},
 {'name': "lldb-x86_64-darwin-13.4",
  'slavenames': ["lldb-x86_64-darwin-13.4"],
  'builddir': "buildDir",


Index: zorg/trunk/buildbot/osuosl/master/config/builders.py
===
--- zorg/trunk/buildbot/osuosl/master/config/builders.py
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py
@@ -612,6 +612,14 @@
 downloadBinary=False,
 buildAndroid=True,
 runTest=False)},
+{'name': "lldb-x86_64-ubuntu-14.04-cmake",
+ 'slavenames': ["lldb-build1-ubuntu-1404"],
+ 'builddir': "buildWorkingDir",
+ 'category' : 'lldb',
+ 'factory': LLDBBuilder.getLLDBScriptCommandsFactory(
+downloadBinary=False,
+buildAndroid=False,
+runTest=True)},
 {'name': "lldb-amd64-ninja-netbsd7",
  'slavenames': ["lldb-amd64-ninja-netbsd7"],
  'builddir': "build",
@@ -1077,14 +1085,6 @@
  'factory': LLDBBuilder.getLLDBBuildFactory(triple=None, # use default
 extra_configure_args=['--enable-cxx11', '--enable-optimized', '--enable-assertions'],
 env={'PATH':'/home/llvmbb/bin/clang-latest/bin:/home/llvmbb/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'})},
-{'name': "lldb-x86_64-ubuntu-14.04-cmake",
- 'slavenames': ["lldb-build1-ubuntu-1404"],
- 'builddir': "buildWorkingDir",
- 'category' : 'lldb',
- 'factory': LLDBBuilder.getLLDBScriptCommandsFactory(
-downloadBinary=False,
-buildAndroid=False,
-runTest=True)},
 {'name': "lldb-x86_64-darwin-13.4",
  'slavenames': ["lldb-x86_64-darwin-13.4"],
  'builddir': "buildDir",
___
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-01 Thread Zachary Turner via lldb-commits
What about a case in the unit test where the value overflows the type?
Would that be useful?
On Thu, Sep 1, 2016 at 3:50 AM Pavel Labath via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> labath created this revision.
> labath added reviewers: clayborg, granata.enrico.
> labath added a subscriber: lldb-commits.
>
> 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.
>
> https://reviews.llvm.org/D24126
>
> Files:
>
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
>   source/Core/Scalar.cpp
>   unittests/Core/ScalarTest.cpp
>
> Index: unittests/Core/ScalarTest.cpp
> ===
> --- unittests/Core/ScalarTest.cpp
> +++ 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 long>(1234567890123LL));
> +EXPECT_EQ("-1234567890124", ScalarGetValue long>(-1234567890123LL));
> +EXPECT_EQ("1234567890122", ScalarGetValue long>(1234567890123ULL));
> +}
> Index: source/Core/Scalar.cpp
> ===
> --- source/Core/Scalar.cpp
> +++ 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:
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> ===
> ---
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> +++
> 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()
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2016-09-01 Thread Pavel Labath via lldb-commits
I don't think that even makes sense. :)

Scalar class has constructors overrides for each of the primitive
types. I cannot construct it with a value which is larger than it will
fit in the primitive type. I suppose I could try the boundary
conditions like UINT32_MAX, but that's about it.

Or I am misunderstanding the question..

pl

On 1 September 2016 at 15:15, Zachary Turner  wrote:
> What about a case in the unit test where the value overflows the type? Would
> that be useful?
> On Thu, Sep 1, 2016 at 3:50 AM Pavel Labath via lldb-commits
>  wrote:
>>
>> labath created this revision.
>> labath added reviewers: clayborg, granata.enrico.
>> labath added a subscriber: lldb-commits.
>>
>> 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.
>>
>> https://reviews.llvm.org/D24126
>>
>> Files:
>>
>> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
>>   source/Core/Scalar.cpp
>>   unittests/Core/ScalarTest.cpp
>>
>> Index: unittests/Core/ScalarTest.cpp
>> ===
>> --- unittests/Core/ScalarTest.cpp
>> +++ 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> long>(1234567890123LL));
>> +EXPECT_EQ("-1234567890124", ScalarGetValue> long>(-1234567890123LL));
>> +EXPECT_EQ("1234567890122", ScalarGetValue> long>(1234567890123ULL));
>> +}
>> Index: source/Core/Scalar.cpp
>> ===
>> --- source/Core/Scalar.cpp
>> +++ 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:
>> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
>> ===
>> ---
>> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
>> +++
>> 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()
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2016-09-01 Thread Zachary Turner via lldb-commits
Actually you're right, i read the test backwards and thought the string was
the argument. I shouldn't do this 30 seconds after waking up :)
On Thu, Sep 1, 2016 at 7:26 AM Pavel Labath  wrote:

> I don't think that even makes sense. :)
>
> Scalar class has constructors overrides for each of the primitive
> types. I cannot construct it with a value which is larger than it will
> fit in the primitive type. I suppose I could try the boundary
> conditions like UINT32_MAX, but that's about it.
>
> Or I am misunderstanding the question..
>
> pl
>
> On 1 September 2016 at 15:15, Zachary Turner  wrote:
> > What about a case in the unit test where the value overflows the type?
> Would
> > that be useful?
> > On Thu, Sep 1, 2016 at 3:50 AM Pavel Labath via lldb-commits
> >  wrote:
> >>
> >> labath created this revision.
> >> labath added reviewers: clayborg, granata.enrico.
> >> labath added a subscriber: lldb-commits.
> >>
> >> 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.
> >>
> >> https://reviews.llvm.org/D24126
> >>
> >> Files:
> >>
> >>
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> >>   source/Core/Scalar.cpp
> >>   unittests/Core/ScalarTest.cpp
> >>
> >> Index: unittests/Core/ScalarTest.cpp
> >> ===
> >> --- unittests/Core/ScalarTest.cpp
> >> +++ 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 >> long>(1234567890123LL));
> >> +EXPECT_EQ("-1234567890124", ScalarGetValue >> long>(-1234567890123LL));
> >> +EXPECT_EQ("1234567890122", ScalarGetValue >> long>(1234567890123ULL));
> >> +}
> >> Index: source/Core/Scalar.cpp
> >> ===
> >> --- source/Core/Scalar.cpp
> >> +++ 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:
> >>
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> >> ===
> >> ---
> >>
> packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
> >> +++
> >>
> 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_m

Re: [Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

2016-09-01 Thread Nitesh Jain via lldb-commits
nitesh.jain added inline comments.


Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:1844
@@ +1843,3 @@
+
+uint64_t value;
+value = reg_size == 4 ? *(uint32_t *)reg_bytes : *(uint64_t *)reg_bytes;

labath wrote:
> This looks like a massive hack. The register value object already takes a 
> byte order as a parameter, so the fact that you are doing some funny endian 
> conversions here means that there is something wrong. Also, this probably 
> will not work for registers whose sizes are not 4 or 8 (%ah, %ax, all SSE 
> registers, etc.).
> 
> I think we'll need to find a different way to fix this.
The problem is  with RegisterValue.SetBytes 

RegisterValue (uint8_t *bytes, size_t length, lldb::ByteOrder byte_order)
{
SetBytes (bytes, length, byte_order);
}

The RegisterValue.SetBytes use memcpy to perform copy . So for register whose 
size is 4 it will be copy to lower 32bit LSB and hence 
RegisterValue.GetAsUInt64 will give incorrect result for 32 bit big endian 
system. 


https://reviews.llvm.org/D24124



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


Re: [Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

2016-09-01 Thread Greg Clayton via lldb-commits
clayborg added inline comments.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:808
@@ -799,3 +807,3 @@
 
 uint8_t *src, *dst;
 

init nullptr please.


https://reviews.llvm.org/D24124



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


Re: [Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

2016-09-01 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:659-660
@@ -651,4 +658,4 @@
 {
-uint8_t *dst;
+uint8_t *dst, byte_size;
 uint64_t *src;
 

Please initialize these. Note that "byte_size" will be used with an random 
value since it isn't initialized in the else clause below.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:673
@@ -664,3 +672,3 @@
 {
 assert (reg_info->byte_offset < sizeof(UserArea));
 dst = (uint8_t *)&m_msa + reg_info->byte_offset - (sizeof(m_gpr) + 
sizeof(m_fpr));

set "byte_size" in else clause.


Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:1845
@@ -1843,1 +1844,3 @@
+uint64_t value;
+value = reg_size == 4 ? *(uint32_t *)reg_bytes : *(uint64_t *)reg_bytes;
 

There is coded that can do what you want in:

```
lldb::offset_t
DataExtractor::CopyByteOrderedData (lldb::offset_t src_offset,
 lldb::offset_t src_len,
 void *dst, 
 lldb::offset_t dst_len,
 lldb::ByteOrder dst_byte_order) const;
```

It lets you say "I want to copy 4 big endian bytes over into 8 little endian 
bytes. It will pad and do the right thing as long as the source data is the 
smaller or the same size as the destination". We can probably make this 
function available as a static function where you specify the source "void *", 
the src_len, and the src_byte_order, and the dst void *, dst_len and 
dst_byte_order. Then you can call this function.


https://reviews.llvm.org/D24124



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


[Lldb-commits] [lldb] r280389 - Change the formula for tagged NSIndexPath data formatting

2016-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep  1 13:09:01 2016
New Revision: 280389

URL: http://llvm.org/viewvc/llvm-project?rev=280389&view=rev
Log:
Change the formula for tagged NSIndexPath data formatting

Fixes rdar://25192935


Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/main.m
Modified:
lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile?rev=280389&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile
 Thu Sep  1 13:09:01 2016
@@ -0,0 +1,9 @@
+LEVEL = ../../../../make
+
+OBJC_SOURCES := main.m
+
+CFLAGS_EXTRAS += -w
+
+include $(LEVEL)/Makefile.rules
+
+LDFLAGS += -framework Foundation

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py?rev=280389&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
 Thu Sep  1 13:09:01 2016
@@ -0,0 +1,70 @@
+# encoding: utf-8
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+
+import os, time
+import datetime
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class NSIndexPathDataFormatterTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def appkit_tester_impl(self,commands):
+self.build()
+self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, 
num_expected_locations=1, loc_exact=True)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+# The stop reason of the thread should be breakpoint.
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs = ['stopped',
+   'stop reason = breakpoint'])
+
+# This is the function to remove the custom formats in order to have a
+# clean slate for the next test case.
+def cleanup():
+self.runCmd('type format clear', check=False)
+self.runCmd('type summary clear', check=False)
+self.runCmd('type synth clear', check=False)
+
+
+# Execute the cleanup function during test case tear down.
+self.addTearDownHook(cleanup)
+commands()
+
+@skipUnlessDarwin
+def test_nsindexpath_with_run_command(self):
+"""Test formatters for NSIndexPath."""
+self.appkit_tester_impl(self.nsindexpath_data_formatter_commands)
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Find the line number to break at.
+self.line = line_number('main.m', '// break here')
+
+def nsindexpath_data_formatter_commands(self):
+# check 'frame variable'
+self.expect('frame variable --ptr-depth=1 -d run -- indexPath1', 
substrs = ['[0] = 1'])
+self.expect('frame variable --ptr-depth=1 -d run -- indexPath2', 
substrs = ['[0] = 1', '[1] = 2'])
+self.expect('frame variable --ptr-depth=1 -d run -- indexPath3', 
substrs = ['[0] = 1', '[1] = 2', '[2] = 3'])
+self.expect('frame variable --ptr-depth=1 -d run -- indexPath4', 
substrs = ['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4'])
+self.expect('frame variable --ptr-depth=1 -d run -- indexPath5', 
substrs = ['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4', '[4] = 5'])
+
+# and 'expression'
+self.expect('expression --ptr-depth=1 -d run -- indexPath1', substrs = 
['[0] = 1'])
+self.expect('expression --ptr-depth=1 -d run -- indexPath2', substrs = 
[

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

2016-09-01 Thread Enrico Granata via lldb-commits
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 
>  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


Re: [Lldb-commits] [PATCH] D24124: [LLDB][MIPS] Fix register read/write for big endian

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


Comment at: 
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:1844
@@ +1843,3 @@
+
+uint64_t value;
+value = reg_size == 4 ? *(uint32_t *)reg_bytes : *(uint64_t *)reg_bytes;

nitesh.jain wrote:
> labath wrote:
> > This looks like a massive hack. The register value object already takes a 
> > byte order as a parameter, so the fact that you are doing some funny endian 
> > conversions here means that there is something wrong. Also, this probably 
> > will not work for registers whose sizes are not 4 or 8 (%ah, %ax, all SSE 
> > registers, etc.).
> > 
> > I think we'll need to find a different way to fix this.
> The problem is  with RegisterValue.SetBytes 
> 
> RegisterValue (uint8_t *bytes, size_t length, lldb::ByteOrder byte_order)
> {
> SetBytes (bytes, length, byte_order);
> }
> 
> The RegisterValue.SetBytes use memcpy to perform copy . So for register whose 
> size is 4 it will be copy to lower 32bit LSB and hence 
> RegisterValue.GetAsUInt64 will give incorrect result for 32 bit big endian 
> system. 
I see that, but I still don't think this is a good idea. I think the fix should 
be done in a different way although I have to say I don't have an idea how (I 
am not too familiar with the RegisterValue class).
A couple of thoughts come to mind:
- Why are you calling GetAsUint64 on a 32-bit register in the first place?
- GetAsUint64 (or GetAsUInt32 for that matter) doesn't seem to be very 
endian-aware. Maybe it should be?
- It could be that what you need to do is simply not possible to do sanely with 
the current RegisterValue interface. If that's the case, we need to change the 
interface.


https://reviews.llvm.org/D24124



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


[Lldb-commits] [lldb] r280395 - When updating a ValueObjectRegister, set the flag to remind yourself of whether it changed

2016-09-01 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep  1 13:31:40 2016
New Revision: 280395

URL: http://llvm.org/viewvc/llvm-project?rev=280395&view=rev
Log:
When updating a ValueObjectRegister, set the flag to remind yourself of whether 
it changed


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

Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=280395&r1=280394&r2=280395&view=diff
==
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Thu Sep  1 13:31:40 2016
@@ -369,6 +369,7 @@ ValueObjectRegister::UpdateValue ()
 
 if (m_reg_ctx_sp)
 {
+RegisterValue m_old_reg_value(m_reg_value);
 if (m_reg_ctx_sp->ReadRegister (&m_reg_info, m_reg_value))
 {
 if (m_reg_value.GetData (m_data))
@@ -380,6 +381,7 @@ ValueObjectRegister::UpdateValue ()
 m_value.SetValueType(Value::eValueTypeHostAddress);
 m_value.GetScalar() = (uintptr_t)m_data.GetDataStart();
 SetValueIsValid (true);
+SetValueDidChange(!(m_old_reg_value == m_reg_value));
 return true;
 }
 }


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


Re: [Lldb-commits] [PATCH] D23026: [LLDB-MI] removing requirement of a parameter for -break-insert's -f flag

2016-09-01 Thread Pierson Lee via lldb-commits
pieandcakes updated this revision to Diff 70088.
pieandcakes added a comment.

Added error message if location is not specified per reviewers comments.


Repository:
  rL LLVM

https://reviews.llvm.org/D23026

Files:
  tools/lldb-mi/MICmdCmdBreak.cpp
  tools/lldb-mi/MICmnResources.cpp
  tools/lldb-mi/MICmnResources.h

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -236,6 +236,7 @@
 IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND,
 IDS_CMD_ERR_BRKPT_INVALID,
 IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,
+IDS_CMD_ERR_BRKPT_BAD_LOCATION,
 IDS_CMD_ERR_SOME_ERROR,
 IDS_CMD_ERR_THREAD_INVALID,
 IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -219,6 +219,7 @@
 {IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, "Command '%s'. Breakpoint location 
'%s' not found"},
 {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
 {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint 
exceeded %d. Cannot create new breakpoint '%s'"},
+{IDS_CMD_ERR_BRKPT_BAD_LOCATION, "Command '%s'. Unable to parse breakpoint 
location."},
 {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
 {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
 {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range 
invalid"},
Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -90,8 +90,7 @@
 {
 m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedTempBrkPt, 
false, true));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( 
m_constStrArgNamedHWBrkPt, false, false));
-m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true,
-   
CMICmdArgValListBase::eArgValType_StringQuotedNumberPath, 1));
+m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true));
 m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedDisableBrkPt, false, false));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( 
m_constStrArgNamedTracePt, false, false));
 m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedConditionalBrkPt, false, true,
@@ -156,10 +155,11 @@
 m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
 if (pArgLocation->GetFound())
 m_brkName = pArgLocation->GetValue();
-else if (m_bBrkPtIsPending)
-{
-pArgPendingBrkPt->GetExpectedOption(m_brkName);
+else {
+SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_BRKPT_BAD_LOCATION), 
m_cmdData.strMiCmd.c_str()));
+return MIstatus::failure;
 }
+
 if (pArgIgnoreCnt->GetFound())
 {
 pArgIgnoreCnt->GetExpectedOption(m_nBrkPtIgnoreCount);


Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -236,6 +236,7 @@
 IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND,
 IDS_CMD_ERR_BRKPT_INVALID,
 IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,
+IDS_CMD_ERR_BRKPT_BAD_LOCATION,
 IDS_CMD_ERR_SOME_ERROR,
 IDS_CMD_ERR_THREAD_INVALID,
 IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -219,6 +219,7 @@
 {IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, "Command '%s'. Breakpoint location '%s' not found"},
 {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
 {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint '%s'"},
+{IDS_CMD_ERR_BRKPT_BAD_LOCATION, "Command '%s'. Unable to parse breakpoint location."},
 {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
 {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
 {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range invalid"},
Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -90,8 +90,7 @@
 {
 m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedTempBrkPt, false, true));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( m_constStrArgNamedHWBrkPt, false, false));
-m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true,
-   CMICmdArgValListBase:

Re: [Lldb-commits] [PATCH] D23026: [LLDB-MI] removing requirement of a parameter for -break-insert's -f flag

2016-09-01 Thread Pierson Lee via lldb-commits
pieandcakes updated this revision to Diff 70107.
pieandcakes added a comment.

Fixed bracket.


Repository:
  rL LLVM

https://reviews.llvm.org/D23026

Files:
  tools/lldb-mi/MICmdCmdBreak.cpp
  tools/lldb-mi/MICmnResources.cpp
  tools/lldb-mi/MICmnResources.h

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -236,6 +236,7 @@
 IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND,
 IDS_CMD_ERR_BRKPT_INVALID,
 IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,
+IDS_CMD_ERR_BRKPT_BAD_LOCATION,
 IDS_CMD_ERR_SOME_ERROR,
 IDS_CMD_ERR_THREAD_INVALID,
 IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -219,6 +219,7 @@
 {IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, "Command '%s'. Breakpoint location 
'%s' not found"},
 {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
 {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint 
exceeded %d. Cannot create new breakpoint '%s'"},
+{IDS_CMD_ERR_BRKPT_BAD_LOCATION, "Command '%s'. Unable to parse breakpoint 
location."},
 {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
 {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
 {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range 
invalid"},
Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -90,8 +90,7 @@
 {
 m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedTempBrkPt, 
false, true));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( 
m_constStrArgNamedHWBrkPt, false, false));
-m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true,
-   
CMICmdArgValListBase::eArgValType_StringQuotedNumberPath, 1));
+m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true));
 m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedDisableBrkPt, false, false));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( 
m_constStrArgNamedTracePt, false, false));
 m_setCmdArgs.Add(new 
CMICmdArgValOptionShort(m_constStrArgNamedConditionalBrkPt, false, true,
@@ -156,10 +155,12 @@
 m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
 if (pArgLocation->GetFound())
 m_brkName = pArgLocation->GetValue();
-else if (m_bBrkPtIsPending)
+else 
 {
-pArgPendingBrkPt->GetExpectedOption(m_brkName);
+SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_BRKPT_BAD_LOCATION), 
m_cmdData.strMiCmd.c_str()));
+return MIstatus::failure;
 }
+
 if (pArgIgnoreCnt->GetFound())
 {
 pArgIgnoreCnt->GetExpectedOption(m_nBrkPtIgnoreCount);


Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -236,6 +236,7 @@
 IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND,
 IDS_CMD_ERR_BRKPT_INVALID,
 IDS_CMD_ERR_BRKPT_CNT_EXCEEDED,
+IDS_CMD_ERR_BRKPT_BAD_LOCATION,
 IDS_CMD_ERR_SOME_ERROR,
 IDS_CMD_ERR_THREAD_INVALID,
 IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID,
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -219,6 +219,7 @@
 {IDS_CMD_ERR_BRKPT_LOCATION_NOT_FOUND, "Command '%s'. Breakpoint location '%s' not found"},
 {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
 {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint '%s'"},
+{IDS_CMD_ERR_BRKPT_BAD_LOCATION, "Command '%s'. Unable to parse breakpoint location."},
 {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
 {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
 {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range invalid"},
Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -90,8 +90,7 @@
 {
 m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedTempBrkPt, false, true));
 // Not implemented m_setCmdArgs.Add(new CMICmdArgValOptionShort( m_constStrArgNamedHWBrkPt, false, false));
-m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true,
-   CMICmdArgValListBase::eArgValType_StringQuotedNumberPath, 1));
+m_setCmdArgs

[Lldb-commits] Buildbot numbers for the last week of 8/21/2016 - 8/27/2016

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

Below are some buildbot numbers for the last week of 8/21/2016 - 8/27/2016.

Please see the same data in attached csv files:

The longest time each builder was red during the last week;
"Status change ratio" by active builder (percent of builds that changed the
builder status from greed to red or from red to green);
Count of commits by project;
Number of completed builds, failed builds and average build time for
successful builds per active builder;
Average waiting time for a revision to get build result per active builder
(response time);

Thanks

Galina


The longest time each builder was red during the last week:

 buildername|  was_red
+---
 sanitizer-x86_64-linux | 57:56:58
 clang-ppc64le-linux-lnt| 32:41:36
 clang-3stage-ubuntu| 32:07:22
 perf-x86_64-penryn-O3-polly-before-vectorizer-detect-only  | 30:11:27
 clang-with-lto-ubuntu  | 29:38:56
 clang-ppc64le-linux-multistage | 27:57:37
 sanitizer-x86_64-linux-bootstrap   | 27:28:07
 llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast   | 27:07:42
 perf-x86_64-penryn-O3-polly-fast   | 23:57:05
 sanitizer-x86_64-linux-fast| 23:44:59
 llvm-clang-lld-x86_64-debian-fast  | 23:13:10
 perf-x86_64-penryn-O3  | 22:59:44
 clang-cuda-build   | 22:08:52
 sanitizer-ppc64le-linux| 21:27:07
 sanitizer-ppc64be-linux| 21:05:11
 clang-ppc64be-linux-multistage | 20:55:00
 clang-ppc64be-linux-lnt| 20:20:42
 clang-ppc64le-linux| 20:11:09
 llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast | 20:07:59
 clang-x86-win2008-selfhost | 19:38:04
 perf-x86_64-penryn-O3-polly-before-vectorizer  | 18:29:00
 perf-x86_64-penryn-O3-polly-unprofitable   | 18:23:50
 perf-x86_64-penryn-O3-polly| 18:10:22
 clang-ppc64be-linux| 17:30:42
 sanitizer-x86_64-linux-autoconf| 16:37:33
 sanitizer-windows  | 13:39:34
 perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable | 13:01:09
 llvm-mips-linux| 10:26:05
 lldb-windows7-android  | 10:03:07
 perf-x86_64-penryn-O3-polly-parallel-fast  | 09:59:46
 clang-native-aarch64-full  | 06:21:28
 polly-amd64-linux  | 06:00:24
 clang-cmake-armv7-a15-selfhost | 05:53:25
 clang-cmake-thumbv7-a15-full-sh| 05:50:27
 clang-cmake-mips   | 05:02:08
 llvm-sphinx-docs   | 04:29:29
 clang-x64-ninja-win7   | 03:43:50
 sanitizer-x86_64-linux-fuzzer  | 03:06:17
 clang-cmake-aarch64-full   | 03:03:52
 clang-bpf-build| 02:29:38
 clang-x86_64-debian-fast   | 01:59:28
 libcxx-libcxxabi-x86_64-linux-ubuntu-tsan  | 01:51:11
 libcxx-libcxxabi-x86_64-linux-ubuntu-ubsan | 01:28:59
 lld-x86_64-freebsd | 01:10:46
 lld-x86_64-darwin13| 01:10:14
 lldb-x86_64-ubuntu-14.04-android   | 01:07:43
 clang-cmake-thumbv7-a15| 01:02:01
 clang-cmake-aarch64-42vma  | 00:54:48
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z | 00:52:00
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14 | 00:50:48
 lld-sphinx-docs| 00:45:14
 clang-sphinx-docs  | 00:45:07
 clang-atom-d525-fedora-rel | 00:42:58
 clang-cmake-armv7-a15-full | 00:36:23
 clang-cmake-aarch64-quick  | 00:32:45
 lldb-x86_64-ubuntu-14.04-cmake | 00:32:20
 lldb-x86_64-ubuntu-14.04-buildserver   | 00:32:17
 clang-hexagon-elf  | 00:29:00
 clang-cmake-armv7-a15  | 00:23:00
 clang-x86_64-linux-abi-