Re: [Lldb-commits] [PATCH] D15877: Fix for undefined behavior while updating PC value on arm-linux

2016-01-05 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.

Looks good but please fix the indentation to match with the LLDB style (4 space)


http://reviews.llvm.org/D15877



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


Re: [Lldb-commits] [PATCH] D15834: Handle hardcoded breakpoints on Windows (e.g., int3 or __debugbreak())

2016-01-05 Thread Pavel Labath via lldb-commits
labath added a comment.

I agree that the new test is better than the existing linux one, which can 
therefore be removed. If you wish, I can do it after you get this in.


http://reviews.llvm.org/D15834



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


[Lldb-commits] [PATCH] D15886: [LLDB][MIPS32]Merge emulation of similar instructions

2016-01-05 Thread Bhushan Attarde via lldb-commits
bhushan created this revision.
bhushan added a reviewer: clayborg.
bhushan added subscribers: lldb-commits, nitesh.jain, mohit.bhakkad, sagar, 
jaydeep.
bhushan set the repository for this revision to rL LLVM.
Herald added a subscriber: dsanders.

Currently there is a separate emulation function for each branch instruction, 
however the emulation logic is almost identical for many of these instructions.
This patch merges emulation of similar instructions into a single function 
(wherever possible) to remove code duplication.

Repository:
  rL LLVM

http://reviews.llvm.org/D15886

Files:
  source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
  source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h

Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
===
--- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
+++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
@@ -160,121 +160,37 @@
 Emulate_LDST_Reg (llvm::MCInst& insn);
 
 bool
-Emulate_BEQ (llvm::MCInst& insn);
+Emulate_BXX_3ops (llvm::MCInst& insn);
 
 bool
-Emulate_BNE (llvm::MCInst& insn);
+Emulate_BXX_3ops_C (llvm::MCInst& insn);
 
 bool
-Emulate_BEQL (llvm::MCInst& insn);
+Emulate_BXX_2ops (llvm::MCInst& insn);
 
 bool
-Emulate_BNEL (llvm::MCInst& insn);
+Emulate_BXX_2ops_C (llvm::MCInst& insn);
 
 bool
-Emulate_BGEZALL (llvm::MCInst& insn);
+Emulate_Bcond_Link_C (llvm::MCInst& insn);
 
 bool
-Emulate_BAL (llvm::MCInst& insn);
-
-bool
-Emulate_BGEZAL (llvm::MCInst& insn);
-
-bool
-Emulate_BALC (llvm::MCInst& insn);
-
-bool
-Emulate_BC (llvm::MCInst& insn);
-
-bool
-Emulate_BGEZ (llvm::MCInst& insn);
-
-bool
-Emulate_BLEZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BGEZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BGTZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BEQZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BNEZALC (llvm::MCInst& insn);
-
-bool
-Emulate_BEQC (llvm::MCInst& insn);
-
-bool
-Emulate_BNEC (llvm::MCInst& insn);
-
-bool
-Emulate_BLTC (llvm::MCInst& insn);
-
-bool
-Emulate_BGEC (llvm::MCInst& insn);
-
-bool
-Emulate_BLTUC (llvm::MCInst& insn);
-
-bool
-Emulate_BGEUC (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZC (llvm::MCInst& insn);
-
-bool
-Emulate_BLEZC (llvm::MCInst& insn);
+Emulate_Bcond_Link (llvm::MCInst& insn);
 
 bool
-Emulate_BGEZC (llvm::MCInst& insn);
+Emulate_FP_branch (llvm::MCInst& insn);
 
 bool
-Emulate_BGTZC (llvm::MCInst& insn);
+Emulate_3D_branch (llvm::MCInst& insn);
 
 bool
-Emulate_BEQZC (llvm::MCInst& insn);
-
-bool
-Emulate_BNEZC (llvm::MCInst& insn);
-
-bool
-Emulate_BGEZL (llvm::MCInst& insn);
-
-bool
-Emulate_BGTZ (llvm::MCInst& insn);
-
-bool
-Emulate_BGTZL (llvm::MCInst& insn);
-
-bool
-Emulate_BLEZ (llvm::MCInst& insn);
-
-bool
-Emulate_BLEZL (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZ (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZAL (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZALL (llvm::MCInst& insn);
-
-bool
-Emulate_BLTZL (llvm::MCInst& insn);
+Emulate_BAL (llvm::MCInst& insn);
 
 bool
-Emulate_BOVC (llvm::MCInst& insn);
+Emulate_BALC (llvm::MCInst& insn);
 
 bool
-Emulate_BNVC (llvm::MCInst& insn);
+Emulate_BC (llvm::MCInst& insn);
 
 bool
 Emulate_J (llvm::MCInst& insn);
@@ -295,36 +211,12 @@
 Emulate_JR (llvm::MCInst& insn);
 
 bool
-Emulate_BC1F (llvm::MCInst& insn);
-
-bool
-Emulate_BC1T (llvm::MCInst& insn);
-
-bool
-Emulate_BC1FL (llvm::MCInst& insn);
-
-bool
-Emulate_BC1TL (llvm::MCInst& insn);
-
-bool
 Emulate_BC1EQZ (llvm::MCInst& insn);
 
 bool
 Emulate_BC1NEZ (llvm::MCInst& insn);
 
 bool
-Emulate_BC1ANY2F  (llvm::MCInst& insn);
-
-bool
-Emulate_BC1ANY2T  (llvm::MCInst& insn);
-
-bool
-Emulate_BC1ANY4F  (llvm::MCInst& insn);
-
-bool
-Emulate_BC1ANY4T  (llvm::MCInst& insn);
-
-bool
 Emulate_BNZB  (llvm::MCInst& insn);
 
 bool
Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
===
--- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -591,45 +591,45 @@
 //--
 // Branch instructions
 //--
-{ "BEQ",::Emulate_BEQ, "BEQ rs,rt,offset"  },
-{ "BNE",::Emulate_BNE, "BNE rs,rt,offset"  },
-{ "BEQL",   ::Emulate_BEQL,"BEQL 

Re: [Lldb-commits] [PATCH] D15877: Fix for undefined behavior while updating PC value on arm-linux

2016-01-05 Thread Muhammad Omair Javaid via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL256847: Fix for undefined behavior while updating PC value 
on arm-linux (authored by omjavaid).

Changed prior to commit:
  http://reviews.llvm.org/D15877?vs=43941=44015#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15877

Files:
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp

Index: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -973,7 +973,24 @@
 if (error.Fail())
 return error;
 
-m_gpr_arm[offset / sizeof(uint32_t)] = value.GetAsUInt32();
+uint32_t reg_value = value.GetAsUInt32();
+// As precaution for an undefined behavior encountered while setting PC we
+// will clear thumb bit of new PC if we are already in thumb mode; that is
+// CPSR thumb mode bit is set.
+if (offset / sizeof(uint32_t) == gpr_pc_arm)
+{
+// Check if we are already in thumb mode and
+// thumb bit of current PC is read out to be zero and
+// thumb bit of next PC is read out to be one.
+if ((m_gpr_arm[gpr_cpsr_arm] &  0x20) &&
+!(m_gpr_arm[gpr_pc_arm] &  0x01) &&
+(value.GetAsUInt32() & 0x01))
+{
+reg_value &= (~1ull);
+}
+}
+
+m_gpr_arm[offset / sizeof(uint32_t)] = reg_value;
 return DoWriteGPR(m_gpr_arm, sizeof(m_gpr_arm));
 }
 


Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -973,7 +973,24 @@
 if (error.Fail())
 return error;
 
-m_gpr_arm[offset / sizeof(uint32_t)] = value.GetAsUInt32();
+uint32_t reg_value = value.GetAsUInt32();
+// As precaution for an undefined behavior encountered while setting PC we
+// will clear thumb bit of new PC if we are already in thumb mode; that is
+// CPSR thumb mode bit is set.
+if (offset / sizeof(uint32_t) == gpr_pc_arm)
+{
+// Check if we are already in thumb mode and
+// thumb bit of current PC is read out to be zero and
+// thumb bit of next PC is read out to be one.
+if ((m_gpr_arm[gpr_cpsr_arm] &  0x20) &&
+!(m_gpr_arm[gpr_pc_arm] &  0x01) &&
+(value.GetAsUInt32() & 0x01))
+{
+reg_value &= (~1ull);
+}
+}
+
+m_gpr_arm[offset / sizeof(uint32_t)] = reg_value;
 return DoWriteGPR(m_gpr_arm, sizeof(m_gpr_arm));
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r256847 - Fix for undefined behavior while updating PC value on arm-linux

2016-01-05 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Tue Jan  5 10:56:13 2016
New Revision: 256847

URL: http://llvm.org/viewvc/llvm-project?rev=256847=rev
Log:
Fix for undefined behavior while updating PC value on arm-linux

Differential revision: http://reviews.llvm.org/D15877


Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp?rev=256847=256846=256847=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
Tue Jan  5 10:56:13 2016
@@ -973,7 +973,24 @@ NativeRegisterContextLinux_arm::DoWriteR
 if (error.Fail())
 return error;
 
-m_gpr_arm[offset / sizeof(uint32_t)] = value.GetAsUInt32();
+uint32_t reg_value = value.GetAsUInt32();
+// As precaution for an undefined behavior encountered while setting PC we
+// will clear thumb bit of new PC if we are already in thumb mode; that is
+// CPSR thumb mode bit is set.
+if (offset / sizeof(uint32_t) == gpr_pc_arm)
+{
+// Check if we are already in thumb mode and
+// thumb bit of current PC is read out to be zero and
+// thumb bit of next PC is read out to be one.
+if ((m_gpr_arm[gpr_cpsr_arm] &  0x20) &&
+!(m_gpr_arm[gpr_pc_arm] &  0x01) &&
+(value.GetAsUInt32() & 0x01))
+{
+reg_value &= (~1ull);
+}
+}
+
+m_gpr_arm[offset / sizeof(uint32_t)] = reg_value;
 return DoWriteGPR(m_gpr_arm, sizeof(m_gpr_arm));
 }
 


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


[Lldb-commits] [PATCH] D15893: Adds expectedFailureArmLinux test decorator

2016-01-05 Thread Muhammad Omair Javaid via lldb-commits
omjavaid created this revision.
omjavaid added a reviewer: clayborg.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: rengolin, aemerson.

This patch adds a new expectedFailureArmLinux which marks arm-linux tests as 
xfails.

Also marked a couple of failing tests to use expectedFailureArmLinux decorator.

http://reviews.llvm.org/D15893

Files:
  
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
  
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
  packages/Python/lldbsuite/test/lldbtest.py

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -703,6 +703,12 @@
 (debug_info is None or self.debug_info in debug_info))
 return expectedFailure(fn, bugnumber)
 
+def expectedFailureArmLinux(bugnumber=None, compilers=None, debug_info=None):
+def fn(self):
+return (self.getPlatform() in ['linux'] and
+self.getArchitecture() in ['arm'])
+return expectedFailure(fn, bugnumber)
+
 def expectedFailureHostOS(oslist, bugnumber=None, compilers=None):
 def fn(self):
 return (getHostPlatform() in oslist and
Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -27,6 +27,7 @@
 # Build dictionary to have unique executable names for each test 
method.
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureArmLinux("llvm.org/pr26031")
 @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_watchlocation_using_watchpoint_set(self):
 """Test watching a location with 'watchpoint set expression -w write 
-s size' option."""
Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -17,6 +17,7 @@
 return ['basic_process']
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureArmLinux("llvm.org/pr26031")
 @expectedFailureWindows("llvm.org/pr24446")
 def test(self):
 """Test stepping over watchpoints."""


Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -703,6 +703,12 @@
 (debug_info is None or self.debug_info in debug_info))
 return expectedFailure(fn, bugnumber)
 
+def expectedFailureArmLinux(bugnumber=None, compilers=None, debug_info=None):
+def fn(self):
+return (self.getPlatform() in ['linux'] and
+self.getArchitecture() in ['arm'])
+return expectedFailure(fn, bugnumber)
+
 def expectedFailureHostOS(oslist, bugnumber=None, compilers=None):
 def fn(self):
 return (getHostPlatform() in oslist and
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -27,6 +27,7 @@
 # Build dictionary to have unique executable names for each test method.
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
+@expectedFailureArmLinux("llvm.org/pr26031")
 @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows
 def test_watchlocation_using_watchpoint_set(self):
 """Test watching a location with 'watchpoint set expression -w write -s size' option."""
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ 

[Lldb-commits] [lldb] r256835 - Mark a test_lldbmi_gdb_set_target_async_on as flaky on linux

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 08:21:15 2016
New Revision: 256835

URL: http://llvm.org/viewvc/llvm-project?rev=256835=rev
Log:
Mark a test_lldbmi_gdb_set_target_async_on as flaky on linux

Test fails in about 1% of buildbot runs. Marking as flaky to avoid the noise.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py?rev=256835=256834=256835=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py 
Tue Jan  5 08:21:15 2016
@@ -35,6 +35,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
 
 @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
+@expectedFlakeyLinux("llvm.org/pr26028") # Fails in ~1% of cases
 def test_lldbmi_gdb_set_target_async_on(self):
 """Test that 'lldb-mi --interpreter' can execute commands in async 
mode."""
 


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


Re: [Lldb-commits] [PATCH] D15773: Add LogDump methods to lldb_private::StringList to ease printing of iterable string containers

2016-01-05 Thread Luke Drummond via lldb-commits
ldrumm added a subscriber: lldb-commits.
ldrumm updated this revision to Diff 44000.
ldrumm added a comment.

Addresses @clayborg's feedback in http://reviews.llvm.org/D15773


http://reviews.llvm.org/D15773

Files:
  source/Core/StringList.cpp

Index: source/Core/StringList.cpp
===
--- source/Core/StringList.cpp
+++ source/Core/StringList.cpp
@@ -12,6 +12,7 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/StreamString.h"
 
 #include 
 
@@ -362,10 +363,16 @@
 {
 if (!log)
 return;
+
+StreamString strm;
 if (name)
-log->Debug("Begin %s:", name);
-for (const auto  : m_strings)
-log->Debug("\t%s", s.c_str());
+strm.Printf("Begin %s:\n", name);
+for (const auto  : m_strings) {
+strm.Indent();
+strm.Printf("%s\n", s.c_str());
+}
 if (name)
-log->Debug("End %s.", name);
+strm.Printf("End %s.\n", name);
+
+log->Debug("%s", strm.GetData());
 }


Index: source/Core/StringList.cpp
===
--- source/Core/StringList.cpp
+++ source/Core/StringList.cpp
@@ -12,6 +12,7 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/StreamString.h"
 
 #include 
 
@@ -362,10 +363,16 @@
 {
 if (!log)
 return;
+
+StreamString strm;
 if (name)
-log->Debug("Begin %s:", name);
-for (const auto  : m_strings)
-log->Debug("\t%s", s.c_str());
+strm.Printf("Begin %s:\n", name);
+for (const auto  : m_strings) {
+strm.Indent();
+strm.Printf("%s\n", s.c_str());
+}
 if (name)
-log->Debug("End %s.", name);
+strm.Printf("End %s.\n", name);
+
+log->Debug("%s", strm.GetData());
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r256834 - [LLDB][MIPS] Make register read/write to set/get the size of register according to abi.

2016-01-05 Thread Sagar Thakur via lldb-commits
Author: slthakur
Date: Tue Jan  5 08:03:45 2016
New Revision: 256834

URL: http://llvm.org/viewvc/llvm-project?rev=256834=rev
Log:
[LLDB][MIPS] Make register read/write to set/get the size of register according 
to abi.

Summary:
For O32 abi register size should be 4 bytes.
For N32 and N64 abi register size should be 8 bytes.
This patch will make register read/write to set/get the size of register 
according to abi.

Reviewers: clayborg, tberghammer
Subscribers: lldb-commits, nitesh.jain, mohit.bhakkad, bhushan, jaydeep
Differential: http://reviews.llvm.org/D15884

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=256834=256833=256834=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
Tue Jan  5 08:03:45 2016
@@ -1388,7 +1388,7 @@ NativeRegisterContextLinux_mips64::DoRea
 {
 lldb_private::ArchSpec arch;
 if (m_thread.GetProcess()->GetArchitecture(arch))
-value.SetBytes((void *)(((unsigned char *)) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), arch.GetAddressByteSize(), 
arch.GetByteOrder());
+value.SetBytes((void *)(((unsigned char *)) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8, arch.GetByteOrder());
 else
 error.SetErrorString("failed to get architecture");
 }
@@ -1404,8 +1404,14 @@ NativeRegisterContextLinux_mips64::DoWri
 Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, 
m_thread.GetID(), NULL, , sizeof regs);
 if (error.Success())
 {
-::memcpy((void *)(((unsigned char *)()) + offset), 
value.GetBytes(), 8);
-error = NativeProcessLinux::PtraceWrapper(PTRACE_SETREGS, 
m_thread.GetID(), NULL, , sizeof regs);
+lldb_private::ArchSpec arch;
+if (m_thread.GetProcess()->GetArchitecture(arch))
+{
+::memcpy((void *)(((unsigned char *)()) + offset), 
value.GetBytes(), arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 
8);
+error = NativeProcessLinux::PtraceWrapper(PTRACE_SETREGS, 
m_thread.GetID(), NULL, , sizeof regs);
+}
+else
+error.SetErrorString("failed to get architecture");
 }
 return error;
 }


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


Re: [Lldb-commits] [PATCH] D15886: [LLDB][MIPS32]Merge emulation of similar instructions

2016-01-05 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks fine.


Repository:
  rL LLVM

http://reviews.llvm.org/D15886



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


Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Dawn Perchik via lldb-commits
dawn added a comment.

In http://reviews.llvm.org/D15593#319670, @clayborg wrote:

> ... in the future when adding things for MI, please add an API in the 
> lldb::SB layer to do what you need.


Thanks for not asking me to do that as part of this patch.

> Text scraping is really not the solution we should be adding into the code. 
> Other people using MI are going to see this kind of code and think it is what 
> they should do when implementing/fixing new/existing MI commands.


I agree that MI should have used the SB layer - did anyone ask the authors 
about that?  Because as you say, the text scraping has now become a precedent 
for MI commands.

> We have an API for a debugger that we are trying to make with the lldb::SB 
> layer, so we should use it and stop ANY form of text scraping in the future. 
> I think an API'ized version of what you are requesting here -- all line table 
> entries for a given source file -- should be available from SBTarget and a 
> future modification to MICmdCmdSymbol.cpp should switch over to using it.


+100.  Except that I think it should only apply to new code - bug fixes like 
this shouldn't be held back because of preexisting code.

Rewriting lldb-mi to use the SB layer would be a great project for an intern or 
someone who wants to get familiar with lldb.  We should keep that in mind 
if/when folks on lldb-dev ask about how they can help out.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

So I am going to let this through because you have done all we asked and I 
really like the "source info" command!

But in the future when adding things for MI, please add an API in the lldb::SB 
layer to do what you need. Text scraping is really not the solution we should 
be adding into the code. Other people using MI are going to see this kind of 
code and think it is what they should do when implementing/fixing new/existing 
MI commands.

We have an API for a debugger that we are trying to make with the lldb::SB 
layer, so we should use it and stop ANY form of text scraping in the future. I 
think an API'ized version of what you are requesting here -- all line table 
entries for a given source file -- should be available from SBTarget and a 
future modification to MICmdCmdSymbol.cpp should switch over to using it.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


[Lldb-commits] [lldb] r256853 - Add logging to SBProcess::GetRestartedFromEvent

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 11:55:35 2016
New Revision: 256853

URL: http://llvm.org/viewvc/llvm-project?rev=256853=rev
Log:
Add logging to SBProcess::GetRestartedFromEvent

Modified:
lldb/trunk/source/API/SBProcess.cpp

Modified: lldb/trunk/source/API/SBProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=256853=256852=256853=diff
==
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Tue Jan  5 11:55:35 2016
@@ -995,7 +995,14 @@ SBProcess::GetStateFromEvent (const SBEv
 bool
 SBProcess::GetRestartedFromEvent (const SBEvent )
 {
-return Process::ProcessEventData::GetRestartedFromEvent (event.get());
+Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+bool ret_val = Process::ProcessEventData::GetRestartedFromEvent 
(event.get());
+
+if (log)
+log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, 
event.get(), ret_val);
+
+return ret_val;
 }
 
 size_t


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


[Lldb-commits] [lldb] r256851 - Fix a typo in lldbutil.py

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 11:55:29 2016
New Revision: 256851

URL: http://llvm.org/viewvc/llvm-project?rev=256851=rev
Log:
Fix a typo in lldbutil.py

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py?rev=256851=256850=256851=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Tue Jan  5 11:55:29 
2016
@@ -740,7 +740,7 @@ def expect_state_changes(test, listener,
 event = lldb.SBEvent()
 for expected_state in states:
 if not listener.WaitForEvent(timeout, event):
-test.Fail("Timed out while waiting for a transition to state %s" %
+test.fail("Timed out while waiting for a transition to state %s" %
 lldb.SBDebugger.StateAsCString(expected_state))
 
 got_state = lldb.SBProcess.GetStateFromEvent(event)


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


[Lldb-commits] [lldb] r256852 - Fix a typo in Process.cpp

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 11:55:32 2016
New Revision: 256852

URL: http://llvm.org/viewvc/llvm-project?rev=256852=rev
Log:
Fix a typo in Process.cpp

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

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=256852=256851=256852=diff
==
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Jan  5 11:55:32 2016
@@ -3980,7 +3980,7 @@ Process::ShouldBroadcastEvent (Event *ev
 {
 Vote stop_vote = m_thread_list.ShouldReportStop 
(event_ptr);
 if (log)
-log->Printf ("Process::ShouldBroadcastEvent: 
should_stop: %i state: %s was_restarted: %i stop_vote: %d.",
+log->Printf ("Process::ShouldBroadcastEvent: 
should_resume: %i state: %s was_restarted: %i stop_vote: %d.",
  should_resume, StateAsCString(state),
  was_restarted, stop_vote);
 


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


Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL256863: Add support for "source info" and use it to fix MI's 
-symbol-list-lines. (authored by dperchik).

Changed prior to commit:
  http://reviews.llvm.org/D15593?vs=43429=44038#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15593

Files:
  lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
  lldb/trunk/source/Commands/CommandObjectSource.cpp
  lldb/trunk/source/Commands/CommandObjectTarget.cpp
  lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp

Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -48,12 +48,19 @@
 eline = line_number('symbol_list_lines_inline_test2.cpp', '// END_gfunc2')
 self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
 self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*\]" % (sline, eline))
-##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due to clang bug llvm.org/pr24716
+##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due to clang bug llvm.org/pr24716 (fixed in newer versions of clang)
 ##sline = line_number('symbol_list_lines_inline_test.cpp', '// FUNC_gfunc')
 ##eline = line_number('symbol_list_lines_inline_test.cpp', '// STRUCT_s')
 ##self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.cpp")
 ##self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]" % (sline, eline))
 
+# Test that -symbol-list-lines works on header files by checking the first
+# and last line, and making sure the other lines are under 29.
+sline = line_number('symbol_list_lines_inline_test.h', '// FUNC_ifunc')
+eline = line_number('symbol_list_lines_inline_test.h', '// FUNC_mfunc')
+self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.h")
+self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d\"\})*(,\{pc=\"0x[0-9a-f]+\",line=\"1\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"2\d\"\})*\]" % (sline, eline))
+
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
 self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'\. error: no source filenames matched any command arguments \"")
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
@@ -2,7 +2,7 @@
 {
 inline int
 ifunc(int i)
-{
+{ // FUNC_ifunc
 return i;
 }
 struct S
@@ -16,7 +16,7 @@
 }
 int
 mfunc()
-{
+{ // FUNC_mfunc
 return a + b;
 }
 };
Index: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
@@ -137,7 +137,7 @@
 """Command 'help image du line' is not ambiguous and should work."""
 # 'image' is an alias for 'target modules'.
 self.expect("help image du line",
-substrs = ['Dump the line table for one or more compilation units'])
+substrs = ['Dump the line table for one or more files'])
 
 @no_debug_info_test
 def test_help_target_variable_syntax(self):
Index: lldb/trunk/source/Commands/CommandObjectTarget.cpp
===
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp
@@ -2577,8 +2577,9 @@
 
 if (command.GetArgumentCount() == 0)
 {
-result.AppendErrorWithFormat ("\nSyntax: %s\n", m_cmd_syntax.c_str());
+result.AppendError ("file option must be specified.");
 result.SetStatus (eReturnStatusFailed);
+return result.Succeeded();
 }
 else
 {
Index: lldb/trunk/source/Commands/CommandObjectSource.cpp

Re: [Lldb-commits] [PATCH] D15884: [LLDB][MIPS] Make register read/write to set/get the size of register according to abi.

2016-01-05 Thread Sagar Thakur via lldb-commits
sagar closed this revision.
sagar marked an inline comment as done.
sagar added a comment.

Committed in revision 256834


Repository:
  rL LLVM

http://reviews.llvm.org/D15884



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


[Lldb-commits] [lldb] r256915 - [LLDB][MIPS32]Merge emulation of similar instructions

2016-01-05 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Tue Jan  5 23:44:02 2016
New Revision: 256915

URL: http://llvm.org/viewvc/llvm-project?rev=256915=rev
Log:
[LLDB][MIPS32]Merge emulation of similar instructions

SUMMARY:
This patch merges emulation of similar instructions into a single function 
(wherever possible) to remove code duplication.

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

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h

Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=256915=256914=256915=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Tue 
Jan  5 23:44:02 2016
@@ -591,45 +591,45 @@ EmulateInstructionMIPS::GetOpcodeForInst
 
//--
 // Branch instructions
 
//--
-{ "BEQ",::Emulate_BEQ, "BEQ 
rs,rt,offset"  },
-{ "BNE",::Emulate_BNE, "BNE 
rs,rt,offset"  },
-{ "BEQL",   ::Emulate_BEQL,"BEQL 
rs,rt,offset" },
-{ "BNEL",   ::Emulate_BNEL,"BNEL 
rs,rt,offset" },
-{ "BGEZALL",::Emulate_BGEZALL, "BGEZALL 
rt,offset" },
+{ "BEQ",::Emulate_BXX_3ops,"BEQ 
rs,rt,offset"  },
+{ "BNE",::Emulate_BXX_3ops,"BNE 
rs,rt,offset"  },
+{ "BEQL",   ::Emulate_BXX_3ops,"BEQL 
rs,rt,offset" },
+{ "BNEL",   ::Emulate_BXX_3ops,"BNEL 
rs,rt,offset" },
+{ "BGEZALL",::Emulate_Bcond_Link,  "BGEZALL 
rt,offset" },
 { "BAL",::Emulate_BAL, "BAL 
offset"},
-{ "BGEZAL", ::Emulate_BGEZAL,  "BGEZAL 
rs,offset"  },
+{ "BGEZAL", ::Emulate_Bcond_Link,  "BGEZAL 
rs,offset"  },
 { "BALC",   ::Emulate_BALC,"BALC 
offset"   },
 { "BC", ::Emulate_BC,  "BC 
offset" },
-{ "BGEZ",   ::Emulate_BGEZ,"BGEZ 
rs,offset"},
-{ "BLEZALC",::Emulate_BLEZALC, "BLEZALC 
rs,offset" },
-{ "BGEZALC",::Emulate_BGEZALC, "BGEZALC 
rs,offset" },
-{ "BLTZALC",::Emulate_BLTZALC, "BLTZALC 
rs,offset" },
-{ "BGTZALC",::Emulate_BGTZALC, "BGTZALC 
rs,offset" },
-{ "BEQZALC",::Emulate_BEQZALC, "BEQZALC 
rs,offset" },
-{ "BNEZALC",::Emulate_BNEZALC, "BNEZALC 
rs,offset" },
-{ "BEQC",   ::Emulate_BEQC,"BEQC 
rs,rt,offset" },
-{ "BNEC",   ::Emulate_BNEC,"BNEC 
rs,rt,offset" },
-{ "BLTC",   ::Emulate_BLTC,"BLTC 
rs,rt,offset" },
-{ "BGEC",   ::Emulate_BGEC,"BGEC 
rs,rt,offset" },
-{ "BLTUC",  ::Emulate_BLTUC,   "BLTUC 
rs,rt,offset"},
-{ "BGEUC",  ::Emulate_BGEUC,   "BGEUC 
rs,rt,offset"},
-{ "BLTZC",  ::Emulate_BLTZC,   "BLTZC 
rt,offset"   },
-{ "BLEZC",  ::Emulate_BLEZC,   "BLEZC 
rt,offset"   },
-{ "BGEZC",  ::Emulate_BGEZC,   "BGEZC 
rt,offset"   },
-{ "BGTZC",  ::Emulate_BGTZC,   "BGTZC 
rt,offset"   },
-{ "BEQZC",  ::Emulate_BEQZC,   "BEQZC 
rt,offset"   },
-{ "BNEZC",  ::Emulate_BNEZC,   "BNEZC 
rt,offset"   },
-{ "BGEZL",  ::Emulate_BGEZL,   "BGEZL 
rt,offset"   },
-{ "BGTZ",   ::Emulate_BGTZ,"BGTZ 
rt,offset"},
-{ "BGTZL",  ::Emulate_BGTZL,   "BGTZL 
rt,offset"   },
-{ "BLEZ",   ::Emulate_BLEZ,"BLEZ 
rt,offset"},
-{ "BLEZL",  ::Emulate_BLEZL,   "BLEZL 
rt,offset"   },
-{ "BLTZ",   ::Emulate_BLTZ,"BLTZ 
rt,offset"},
-{ "BLTZAL", ::Emulate_BLTZAL,  "BLTZAL 
rt,offset"  },
-{ "BLTZALL",::Emulate_BLTZALL, "BLTZALL 
rt,offset" },
-{ "BLTZL",  ::Emulate_BLTZL,   "BLTZL 
rt,offset"   },
-{ "BOVC",   ::Emulate_BOVC,"BOVC 
rs,rt,offset" },
-{ "BNVC",   ::Emulate_BNVC,"BNVC 
rs,rt,offset" },
+  

[Lldb-commits] [PATCH] D15915: [LLDB][MIPS] Fix TestDisassembleRawData.py

2016-01-05 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, ovehakola, emaste.
nitesh.jain added subscribers: jaydeep, bhushan, sagar, mohit.bhakkad, 
lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

This patch adds check for the correctness of Disassembling instruction for MIPS 
target. 

Repository:
  rL LLVM

http://reviews.llvm.org/D15915

Files:
  
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py

Index: 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -21,11 +21,18 @@
 def test_disassemble_raw_data(self):
 """Test disassembling raw bytes with the API."""
 # Create a target from the debugger.
-target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "x86_64")
+arch = self.getArchitecture()
+if re.match("mips*el",arch):
+   target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "mipsel")
+   raw_bytes = bytearray([0x21,0xf0, 0xa0, 0x03])
+elif re.match("mips",arch):
+ target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "mips")
+ raw_bytes = bytearray([0x03,0xa0, 0xf0, 0x21])
+else:
+   target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "x86_64")
+   raw_bytes = bytearray([0x48, 0x89, 0xe5])
+
 self.assertTrue(target, VALID_TARGET)
-
-raw_bytes = bytearray([0x48, 0x89, 0xe5])
-
 insts = target.GetInstructions(lldb.SBAddress(0, target), raw_bytes)
 
 inst = insts.GetInstructionAtIndex(0)
@@ -34,6 +41,9 @@
 print()
 print("Raw bytes:", [hex(x) for x in raw_bytes])
 print("Disassembled%s" % str(inst))
- 
-self.assertTrue (inst.GetMnemonic(target) == "movq")
-self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' + 
"rbp")
+if re.match("mips",arch):
+   self.assertTrue (inst.GetMnemonic(target) == "move")
+   self.assertTrue (inst.GetOperands(target) == '$' + "fp, " + '$' + 
"sp")
+else:
+ self.assertTrue (inst.GetMnemonic(target) == "movq")
+ self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' 
+ "rbp")


Index: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -21,11 +21,18 @@
 def test_disassemble_raw_data(self):
 """Test disassembling raw bytes with the API."""
 # Create a target from the debugger.
-target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "x86_64")
+arch = self.getArchitecture()
+if re.match("mips*el",arch):
+   target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "mipsel")
+   raw_bytes = bytearray([0x21,0xf0, 0xa0, 0x03])
+elif re.match("mips",arch):
+ target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "mips")
+ raw_bytes = bytearray([0x03,0xa0, 0xf0, 0x21])
+else:
+   target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "x86_64")
+   raw_bytes = bytearray([0x48, 0x89, 0xe5])
+
 self.assertTrue(target, VALID_TARGET)
-
-raw_bytes = bytearray([0x48, 0x89, 0xe5])
-
 insts = target.GetInstructions(lldb.SBAddress(0, target), raw_bytes)
 
 inst = insts.GetInstructionAtIndex(0)
@@ -34,6 +41,9 @@
 print()
 print("Raw bytes:", [hex(x) for x in raw_bytes])
 print("Disassembled%s" % str(inst))
- 
-self.assertTrue (inst.GetMnemonic(target) == "movq")
-self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' + "rbp")
+if re.match("mips",arch):
+   self.assertTrue (inst.GetMnemonic(target) == "move")
+   self.assertTrue (inst.GetOperands(target) == '$' + "fp, " + '$' + "sp")
+else:
+ self.assertTrue (inst.GetMnemonic(target) == "movq")
+ self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' + "rbp")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15904: Fix tests after svn r256863 - can someone please commit?

2016-01-05 Thread Dawn Perchik via lldb-commits
dawn created this revision.
dawn added a reviewer: lldb-commits.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

This patch includes missed changes that should have gone in with r256863, but I 
can't get to svn at lldb.org at the moment (is it down?), so if someone else 
can, please commit these for me, and update http://reviews.llvm.org/D15593 to 
include the commit.  Thanks!

Intended commit message was:
Apply missed changes from svn r256863 "Add support for "source info" and 
use it to fix MI's -symbol-list-lines.".

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

Repository:
  rL LLVM

http://reviews.llvm.org/D15904

Files:
  packages/Python/lldbsuite/test/help/TestHelp.py
  packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
  tools/lldb-mi/MICmdCmdSymbol.cpp

Index: tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- tools/lldb-mi/MICmdCmdSymbol.cpp
+++ tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -106,8 +106,8 @@
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
-// ^1=file  ^2=cu^3=module
+"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
+//   ^1=file  ^2=cu^3=module
 
 MIUtilParse::CRegexParser::Match match(4);
 
Index: packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -63,11 +63,11 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_file'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_file'\. \"")
 
 # Test that -symbol-list-lines fails when file is specified using 
relative path
 self.runCmd("-symbol-list-lines ./main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'\./main\.cpp'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'\./main\.cpp'\. \"")
 
 # Test that -symbol-list-lines works when file is specified using 
absolute path
 import os
@@ -77,4 +77,4 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_dir/main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_dir/main\.cpp'\. error: no source filenames matched any command 
arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_dir/main\.cpp'\. \"")
Index: packages/Python/lldbsuite/test/help/TestHelp.py
===
--- packages/Python/lldbsuite/test/help/TestHelp.py
+++ packages/Python/lldbsuite/test/help/TestHelp.py
@@ -134,10 +134,10 @@
 
 @no_debug_info_test
 def test_help_image_du_line_should_work(self):
-"""Command 'help image du line' is not ambiguous and should work."""
+"""Command 'help image du line-table' is not ambiguous and should 
work."""
 # 'image' is an alias for 'target modules'.
 self.expect("help image du line",
-substrs = ['Dump the line table for one or more files'])
+substrs = ['Dump the line table for one or more compilation 
units'])
 
 @no_debug_info_test
 def test_help_target_variable_syntax(self):


Index: tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- tools/lldb-mi/MICmdCmdSymbol.cpp
+++ tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -106,8 +106,8 @@
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
-// ^1=file  ^2=cu^3=module
+"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
+//   ^1=file  ^2=cu^3=module
 
 MIUtilParse::CRegexParser::Match match(4);
 
Index: packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -63,11 +63,11 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 

Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Dawn Perchik via lldb-commits
dawn added a comment.

Amended patch was posted to http://reviews.llvm.org/D15593 - hopefully someone 
who can get to llvm.org will commit.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


[Lldb-commits] [lldb] r256824 - Remove old flaky test rerun logic

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 04:44:36 2016
New Revision: 256824

URL: http://llvm.org/viewvc/llvm-project?rev=256824=rev
Log:
Remove old flaky test rerun logic

Summary:
This removes the old logic for rerunning flaky tests. The new test runners will 
take care of
rerunning failing tests.

Reviewers: tfiala

Subscribers: lldb-commits

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

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=256824=256823=256824=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Tue Jan  5 04:44:36 
2016
@@ -752,14 +752,12 @@ def expectedFailureAndroid(bugnumber=Non
 """
 return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
-# if the test passes on the first try, we're done (success)
-# if the test fails once, then passes on the second try, raise an 
ExpectedFailure
-# if the test fails twice in a row, re-throw the exception from the second 
test run
+# Flakey tests get two chances to run. If they fail the first time round, the 
result formatter
+# makes sure it is run one more time.
 def expectedFlakey(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
 @wraps(func)
 def wrapper(*args, **kwargs):
-from unittest2 import case
 self = args[0]
 if expected_fn(self):
 # Send event marking test as explicitly eligible for rerunning.
@@ -767,25 +765,7 @@ def expectedFlakey(expected_fn, bugnumbe
 # Mark this test as rerunnable.
 configuration.results_formatter_object.handle_event(
 EventBuilder.event_for_mark_test_rerun_eligible(self))
-try:
-func(*args, **kwargs)
-# don't retry if the test case is already decorated with xfail or 
skip
-except (case._ExpectedFailure, case.SkipTest, 
case._UnexpectedSuccess):
-raise
-except Exception:
-if expected_fn(self):
-# before retry, run tearDown for previous run and setup 
for next
-try:
-self.tearDown()
-self.setUp()
-func(*args, **kwargs)
-except Exception:
-# oh snap! two failures in a row, record a 
failure/error
-raise
-# record the expected failure
-raise case._ExpectedFailure(sys.exc_info(), bugnumber)
-else:
-raise
+func(*args, **kwargs)
 return wrapper
 # if bugnumber is not-callable(incluing None), that means decorator 
function is called with optional arguments
 # return decorator in this case, so it will be used to decorating original 
method


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


Re: [Lldb-commits] [PATCH] D15884: [LLDB][MIPS] Make register read/write to set/get the size of register according to abi.

2016-01-05 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

Looks good



Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1391
@@ -1390,3 +1390,3 @@
 if (m_thread.GetProcess()->GetArchitecture(arch))
-value.SetBytes((void *)(((unsigned char *)) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), arch.GetAddressByteSize(), 
arch.GetByteOrder());
+value.SetBytes((void *)(((unsigned char *)) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), 4 + (!(arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32) * 4), arch.GetByteOrder());
 else

(nit): I would prefer to use the following syntax, but don't feel strongly 
about it:

```
(arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32) ? 4 : 8
```


Repository:
  rL LLVM

http://reviews.llvm.org/D15884



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


Re: [Lldb-commits] [PATCH] D15855: Remove old flaky test rerun logic

2016-01-05 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL256824: Remove old flaky test rerun logic (authored by 
labath).

Changed prior to commit:
  http://reviews.llvm.org/D15855?vs=43871=43974#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15855

Files:
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -752,40 +752,20 @@
 """
 return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
-# if the test passes on the first try, we're done (success)
-# if the test fails once, then passes on the second try, raise an 
ExpectedFailure
-# if the test fails twice in a row, re-throw the exception from the second 
test run
+# Flakey tests get two chances to run. If they fail the first time round, the 
result formatter
+# makes sure it is run one more time.
 def expectedFlakey(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
 @wraps(func)
 def wrapper(*args, **kwargs):
-from unittest2 import case
 self = args[0]
 if expected_fn(self):
 # Send event marking test as explicitly eligible for rerunning.
 if configuration.results_formatter_object is not None:
 # Mark this test as rerunnable.
 configuration.results_formatter_object.handle_event(
 EventBuilder.event_for_mark_test_rerun_eligible(self))
-try:
-func(*args, **kwargs)
-# don't retry if the test case is already decorated with xfail or 
skip
-except (case._ExpectedFailure, case.SkipTest, 
case._UnexpectedSuccess):
-raise
-except Exception:
-if expected_fn(self):
-# before retry, run tearDown for previous run and setup 
for next
-try:
-self.tearDown()
-self.setUp()
-func(*args, **kwargs)
-except Exception:
-# oh snap! two failures in a row, record a 
failure/error
-raise
-# record the expected failure
-raise case._ExpectedFailure(sys.exc_info(), bugnumber)
-else:
-raise
+func(*args, **kwargs)
 return wrapper
 # if bugnumber is not-callable(incluing None), that means decorator 
function is called with optional arguments
 # return decorator in this case, so it will be used to decorating original 
method


Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -752,40 +752,20 @@
 """
 return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
-# if the test passes on the first try, we're done (success)
-# if the test fails once, then passes on the second try, raise an ExpectedFailure
-# if the test fails twice in a row, re-throw the exception from the second test run
+# Flakey tests get two chances to run. If they fail the first time round, the result formatter
+# makes sure it is run one more time.
 def expectedFlakey(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
 @wraps(func)
 def wrapper(*args, **kwargs):
-from unittest2 import case
 self = args[0]
 if expected_fn(self):
 # Send event marking test as explicitly eligible for rerunning.
 if configuration.results_formatter_object is not None:
 # Mark this test as rerunnable.
 configuration.results_formatter_object.handle_event(
 EventBuilder.event_for_mark_test_rerun_eligible(self))
-try:
-func(*args, **kwargs)
-# don't retry if the test case is already decorated with xfail or skip
-except (case._ExpectedFailure, case.SkipTest, case._UnexpectedSuccess):
-raise
-except Exception:
-if expected_fn(self):
-# before retry, run tearDown for previous run and setup for next
-try:
-self.tearDown()
-self.setUp()
-func(*args, **kwargs)
-except Exception:
-# oh snap! two failures in a row, record a failure/error
-raise
-# record the expected failure
-raise case._ExpectedFailure(sys.exc_info(), 

Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Dawn Perchik via lldb-commits
dawn added a comment.

I forgot to commit updated changes to the tests:

  MiSymbolTestCase.test_lldbmi_symbol_list_lines_file
  HelpCommandTestCase.test_help_image_du_line_should_work

so they are failing now, but svn at llvm.org appears to be down at the moment.
I'll commit those changes as soon as svn is back up...


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


[Lldb-commits] [lldb] r256833 - Revert r256769

2016-01-05 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Tue Jan  5 07:18:46 2016
New Revision: 256833

URL: http://llvm.org/viewvc/llvm-project?rev=256833=rev
Log:
Revert r256769

Reverts "Use correct format identifiers to print something meaningful."

Original format specifiers were correct.
Instead use void* casts to remove warnings, since this is what the %p specifier 
expects.

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=256833=256832=256833=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 Tue Jan  5 07:18:46 2016
@@ -2231,7 +2231,7 @@ RenderScriptRuntime::SaveAllocation(Stre
 // Write allocation data to file
 num_bytes = static_cast(*alloc->size.get());
 if (log)
-log->Printf("RenderScriptRuntime::SaveAllocation - Writing 0x%" PRIx64 
" bytes from %s", (uint64_t) num_bytes, buffer.get());
+log->Printf("RenderScriptRuntime::SaveAllocation - Writing 0x%" PRIx64 
" bytes from %p", (uint64_t) num_bytes, (void*) buffer.get());
 
 err = file.Write(buffer.get(), num_bytes);
 if (!err.Success())

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp?rev=256833=256832=256833=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp Tue Jan  5 
07:18:46 2016
@@ -69,7 +69,7 @@ NameToDIE::Dump (Stream *s)
 {
 const char *cstr = m_map.GetCStringAtIndex(i);
 const DIERef& die_ref = m_map.GetValueAtIndexUnchecked(i);
-s->Printf("%s: {0x%8.8x/0x%8.8x} \"%s\"\n", cstr, die_ref.cu_offset, 
die_ref.die_offset, cstr);
+s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void*) cstr, 
die_ref.cu_offset, die_ref.die_offset, cstr);
 }
 }
 


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


[Lldb-commits] [lldb] r256877 - Apply missed changes from svn r256863 "Add support for "source info" and use it to fix MI's -symbol-list-lines.".

2016-01-05 Thread Dawn Perchik via lldb-commits
Author: dperchik
Date: Tue Jan  5 18:03:43 2016
New Revision: 256877

URL: http://llvm.org/viewvc/llvm-project?rev=256877=rev
Log:
Apply missed changes from svn r256863 "Add support for "source info" and use it 
to fix MI's -symbol-list-lines.".

Patch is part of Differential Revision: http://reviews.llvm.org/D15593
Differential Revision: http://reviews.llvm.org/D15904

Modified:
lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=256877=256876=256877=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Tue Jan  5 
18:03:43 2016
@@ -134,10 +134,10 @@ class HelpCommandTestCase(TestBase):
 
 @no_debug_info_test
 def test_help_image_du_line_should_work(self):
-"""Command 'help image du line' is not ambiguous and should work."""
+"""Command 'help image du line-table' is not ambiguous and should 
work."""
 # 'image' is an alias for 'target modules'.
 self.expect("help image du line",
-substrs = ['Dump the line table for one or more files'])
+substrs = ['Dump the line table for one or more compilation 
units'])
 
 @no_debug_info_test
 def test_help_target_variable_syntax(self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=256877=256876=256877=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py 
Tue Jan  5 18:03:43 2016
@@ -63,11 +63,11 @@ class MiSymbolTestCase(lldbmi_testcase.M
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_file'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_file'\. \"")
 
 # Test that -symbol-list-lines fails when file is specified using 
relative path
 self.runCmd("-symbol-list-lines ./main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'\./main\.cpp'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'\./main\.cpp'\. \"")
 
 # Test that -symbol-list-lines works when file is specified using 
absolute path
 import os
@@ -77,4 +77,4 @@ class MiSymbolTestCase(lldbmi_testcase.M
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_dir/main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_dir/main\.cpp'\. error: no source filenames matched any command 
arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_dir/main\.cpp'\. \"")

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp?rev=256877=256876=256877=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Tue Jan  5 18:03:43 2016
@@ -106,8 +106,8 @@ ParseLLDBLineAddressHeader(const char *i
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
-// ^1=file  ^2=cu^3=module
+"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
+//   ^1=file  ^2=cu^3=module
 
 MIUtilParse::CRegexParser::Match match(4);
 


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


Re: [Lldb-commits] [PATCH] D15904: Fix tests after svn r256863 - can someone please commit?

2016-01-05 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL256877: Apply missed changes from svn r256863 "Add support 
for "source info" and useā€¦ (authored by dperchik).

Changed prior to commit:
  http://reviews.llvm.org/D15904?vs=44061=44067#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15904

Files:
  lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
  lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp

Index: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -106,8 +106,8 @@
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
-// ^1=file  ^2=cu^3=module
+"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
+//   ^1=file  ^2=cu^3=module
 
 MIUtilParse::CRegexParser::Match match(4);
 
Index: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -63,11 +63,11 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_file'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_file'\. \"")
 
 # Test that -symbol-list-lines fails when file is specified using 
relative path
 self.runCmd("-symbol-list-lines ./main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'\./main\.cpp'\. error: no source filenames matched any command arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'\./main\.cpp'\. \"")
 
 # Test that -symbol-list-lines works when file is specified using 
absolute path
 import os
@@ -77,4 +77,4 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_dir/main.cpp")
-self.expect("\^error,message=\"warning: No source filenames matched 
'unknown_dir/main\.cpp'\. error: no source filenames matched any command 
arguments \"")
+self.expect("\^error,message=\"error: No source filenames matched 
'unknown_dir/main\.cpp'\. \"")
Index: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
@@ -134,10 +134,10 @@
 
 @no_debug_info_test
 def test_help_image_du_line_should_work(self):
-"""Command 'help image du line' is not ambiguous and should work."""
+"""Command 'help image du line-table' is not ambiguous and should 
work."""
 # 'image' is an alias for 'target modules'.
 self.expect("help image du line",
-substrs = ['Dump the line table for one or more files'])
+substrs = ['Dump the line table for one or more compilation 
units'])
 
 @no_debug_info_test
 def test_help_target_variable_syntax(self):


Index: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -106,8 +106,8 @@
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
-// ^1=file  ^2=cu^3=module
+"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
+//   ^1=file  ^2=cu^3=module
 
 MIUtilParse::CRegexParser::Match match(4);
 
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -63,11 +63,11 @@
 
 # Test that -symbol-list-lines fails when file doesn't exist
 self.runCmd("-symbol-list-lines unknown_file")
-self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'\. 

Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Dawn Perchik via lldb-commits
dawn added a comment.

Amended patch was committed in svn r256877 (svn at lldb.org is back up now)


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


[Lldb-commits] [lldb] r256863 - Add support for "source info" and use it to fix MI's -symbol-list-lines.

2016-01-05 Thread Dawn Perchik via lldb-commits
Author: dperchik
Date: Tue Jan  5 13:51:51 2016
New Revision: 256863

URL: http://llvm.org/viewvc/llvm-project?rev=256863=rev
Log:
Add support for "source info" and use it to fix MI's -symbol-list-lines.

This patch adds support the command 'source info' as follows:
(lldb) help source info
 Display source line information (as specified) based on the current 
executable's
 debug info.

Syntax: source info 

Command Options Usage:
  source info [-c ] [-s ] [-f ] [-l ] 
[-e ]
  source info [-c ] [-s ] [-n ]
  source info [-c ] [-a ]

   -a  ( --address  )
Lookup the address and display the source information for the 
corresponding
file and line.

   -c  ( --count  )
The number of line entries to display.

   -e  ( --end-line  )
The line number at which to stop displaying lines.

   -f  ( --file  )
The file from which to display source.

   -l  ( --line  )
The line number at which to start the displaying lines.

   -n  ( --name  )
The name of a function whose source to display.

   -s  ( --shlib  )
Look up the source in the given module or shared library (can 
be specified
more than once).
For example:
(lldb) source info --file x.h
Lines for file x.h in compilation unit x.cpp in `x
[0x00010d00-0x00010d10): /Users/dawn/tmp/./x.h:10
[0x00010d10-0x00010d1b): /Users/dawn/tmp/./x.h:10

The new options are used to fix the MI command:
-symbol-list-lines 
which didn't work for header files because it called:
target modules dump line-table 
which only dumps line tables for a compilation unit.

The patch also fixes a bug in the error reporting when no files were supplied 
to the command. Previously you'd get:
(lldb) target modules dump line-table
error:
Syntax:
error: no source filenames matched any command arguments
Now you get:
error: file option must be specified.

Reviewed by: clayborg, jingham, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15593

Modified:
lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
lldb/trunk/source/Commands/CommandObjectSource.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=256863=256862=256863=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Tue Jan  5 
13:51:51 2016
@@ -137,7 +137,7 @@ class HelpCommandTestCase(TestBase):
 """Command 'help image du line' is not ambiguous and should work."""
 # 'image' is an alias for 'target modules'.
 self.expect("help image du line",
-substrs = ['Dump the line table for one or more compilation 
units'])
+substrs = ['Dump the line table for one or more files'])
 
 @no_debug_info_test
 def test_help_target_variable_syntax(self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=256863=256862=256863=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py 
Tue Jan  5 13:51:51 2016
@@ -48,12 +48,19 @@ class MiSymbolTestCase(lldbmi_testcase.M
 eline = line_number('symbol_list_lines_inline_test2.cpp', '// 
END_gfunc2')
 self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
 
self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*\]"
 % (sline, eline))
-##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due 
to clang bug llvm.org/pr24716
+##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due 
to clang bug llvm.org/pr24716 (fixed in newer versions of clang)
 ##sline = line_number('symbol_list_lines_inline_test.cpp', '// 
FUNC_gfunc')
 ##eline = line_number('symbol_list_lines_inline_test.cpp', '// 
STRUCT_s')
 

[Lldb-commits] [lldb] r256827 - Remove XTIMEOUT from TestEvents on linux

2016-01-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan  5 06:51:26 2016
New Revision: 256827

URL: http://llvm.org/viewvc/llvm-project?rev=256827=rev
Log:
Remove XTIMEOUT from TestEvents on linux

I'm getting rid of the expected timeouts. I'll XFAIL/skip any tests that show 
up as failing after
this (I haven't seen any when running locally, but maybe the buildbot will 
disagree).

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=256827=256826=256827=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Tue Jan  5 06:51:26 2016
@@ -1146,7 +1146,6 @@ def getExpectedTimeouts(platform_name):
 
 if target.startswith("linux"):
 expected_timeout |= {
-"TestEvents.py",
 "TestMultithreaded.py",
 }
 elif target.startswith("android"):


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