[Lldb-commits] [lldb] r246955 - Bug 24457 - X87 FPU Special Purpose Registers

2015-09-07 Thread Abhishek Aggarwal via lldb-commits
Author: abhishek
Date: Mon Sep  7 02:40:16 2015
New Revision: 246955

URL: http://llvm.org/viewvc/llvm-project?rev=246955=rev
Log:
Bug 24457 - X87 FPU Special Purpose Registers

Summary:
  - For 'register read --all' command on x86_64-Linux Platform:

  -- Provide correct values of X87 FPU Special Purpose Registers
  -- Both 32-bit & 64-bit inferiors give correct values on this
 Platform

  - Added a Test Vector:
  -- To verify the expected behaviour of the command

Signed-off-by: Abhishek Aggarwal 

Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg

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

Added:
lldb/trunk/test/functionalities/register/a.cpp   (with props)
Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp   
(contents, props changed)
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
lldb/trunk/test/functionalities/register/Makefile   (contents, props 
changed)
lldb/trunk/test/functionalities/register/TestRegisters.py   (contents, 
props changed)
lldb/trunk/test/functionalities/register/main.cpp   (contents, props 
changed)

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=246955=246954=246955=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Mon Sep  7 02:40:16 2015
@@ -422,6 +422,10 @@ NativeRegisterContextLinux_x86_64::Nativ
 
 // Clear out the FPR state.
 ::memset(_fpr, 0, sizeof(FPR));
+
+// Store byte offset of fctrl (i.e. first register of FPR)
+const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl");
+m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset;
 }
 
 // CONSIDER after local and llgs debugging are merged, register set support can
@@ -559,8 +563,16 @@ NativeRegisterContextLinux_x86_64::ReadR
 }
 
 // Get pointer to m_fpr.xstate.fxsave variable and set the data from it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
+
+// Byte offsets of all registers are calculated wrt 'UserArea' structure.
+// However, ReadFPR() reads fpu registers {using 
ptrace(PTRACE_GETFPREGS,..)}
+// and stores them in 'm_fpr' (of type FPR structure). To extract values 
of fpu
+// registers, m_fpr should be read at byte offsets calculated wrt to FPR 
structure.
+
+// Since, FPR structure is also one of the member of UserArea structure.
+// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - 
byte_offset(fctrl wrt UserArea)
+assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < 
sizeof(m_fpr));
+uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset - 
m_fctrl_offset_in_userarea;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -620,8 +632,16 @@ NativeRegisterContextLinux_x86_64::Write
 else
 {
 // Get pointer to m_fpr.xstate.fxsave variable and set the data to 
it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
+
+// Byte offsets of all registers are calculated wrt 'UserArea' 
structure.
+// However, WriteFPR() takes m_fpr (of type FPR structure) and 
writes only fpu
+// registers using ptrace(PTRACE_SETFPREGS,..) API. Hence fpu 
registers should
+// be written in m_fpr at byte offsets calculated wrt FPR 
structure.
+
+// Since, FPR structure is also one of the member of UserArea 
structure.
+// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - 
byte_offset(fctrl wrt UserArea)
+assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < 
sizeof(m_fpr));
+uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset - 
m_fctrl_offset_in_userarea;
 switch (reg_info->byte_size)
 {
 case 2:

Propchange: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
--
svn:executable = *

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h?rev=246955=246954=246955=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h 
Mon Sep  7 

[Lldb-commits] [PATCH] D12670: [LLDB][MIPS] MIPS load/store instruction emulation for hardware watchpoints

2015-09-07 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad created this revision.
mohit.bhakkad added a reviewer: clayborg.
mohit.bhakkad added subscribers: jaydeep, bhushan, sagar, nitesh.jain, 
lldb-commits.
mohit.bhakkad set the repository for this revision to rL LLVM.

Emulate MIPS32/64 load and store instructions for HW watchpoints.

Repository:
  rL LLVM

http://reviews.llvm.org/D12670

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

Index: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
===
--- source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
+++ source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
@@ -128,13 +128,13 @@
 Emulate_SD (llvm::MCInst& insn);
 
 bool
-Emulate_SW (llvm::MCInst& insn);
+Emulate_LD (llvm::MCInst& insn);
 
 bool
-Emulate_LW (llvm::MCInst& insn);
+Emulate_LDST_Imm (llvm::MCInst& insn);
 
 bool
-Emulate_LD (llvm::MCInst& insn);
+Emulate_LDST_Reg (llvm::MCInst& insn);
 
 bool
 Emulate_BEQ (llvm::MCInst& insn);
Index: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
===
--- source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -486,8 +486,65 @@
 { "SD", ::Emulate_SD,  "SD rt,offset(rs)"  },
 { "LD", ::Emulate_LD,  "LD rt,offset(base)"},
 
-{ "SW", ::Emulate_SW,  "SW rt,offset(rs)"  },
-{ "LW", ::Emulate_LW,  "LW rt,offset(rs)"  },
+
+
+
+//--
+// Load/Store  instructions
+//--
+/* Following list of emulated instructions are required by implementation of hardware watchpoint
+   for MIPS in lldb. As we just need the address accessed by instructions, we have generalised 
+   all these instructions in 2 functions depending on their addressing modes */
+
+{ "LB", ::Emulate_LDST_Imm,  "LBrt, offset(base)" },
+{ "LBE",::Emulate_LDST_Imm,  "LBE   rt, offset(base)" },
+{ "LBU",::Emulate_LDST_Imm,  "LBU   rt, offset(base)" },
+{ "LBUE",   ::Emulate_LDST_Imm,  "LBUE  rt, offset(base)" },
+{ "LDC1",   ::Emulate_LDST_Imm,  "LDC1  ft, offset(base)" },
+{ "LDL",::Emulate_LDST_Imm,  "LDL   rt, offset(base)" },
+{ "LDR",::Emulate_LDST_Imm,  "LDR   rt, offset(base)" },
+{ "LLD",::Emulate_LDST_Imm,  "LLD   rt, offset(base)" },
+{ "LDC2",   ::Emulate_LDST_Imm,  "LDC2  rt, offset(base)" },
+{ "LDXC1",  ::Emulate_LDST_Reg,  "LDXC1 fd, index (base)" },
+{ "LH", ::Emulate_LDST_Imm,  "LHrt, offset(base)" },
+{ "LHE",::Emulate_LDST_Imm,  "LHE   rt, offset(base)" },
+{ "LHU",::Emulate_LDST_Imm,  "LHU   rt, offset(base)" },
+{ "LHUE",   ::Emulate_LDST_Imm,  "LHUE  rt, offset(base)" },
+{ "LL", ::Emulate_LDST_Imm,  "LLrt, offset(base)" },
+{ "LLE",::Emulate_LDST_Imm,  "LLE   rt, offset(base)" },
+{ "LUXC1",  ::Emulate_LDST_Reg,  "LUXC1 fd, index (base)" },
+{ "LW", ::Emulate_LDST_Imm,  "LWrt, offset(rs)"   },
+{ "LWC1",   ::Emulate_LDST_Imm,  "LWC1  ft, offset(base)" },
+{ "LWC2",   ::Emulate_LDST_Imm,  "LWC2  rt, offset(base)" },
+{ "LWE",::Emulate_LDST_Imm,  "LWE   rt, offset(base)" },
+{ "LWL",::Emulate_LDST_Imm,  "LWL   rt, offset(base)" },
+{ "LWLE",   ::Emulate_LDST_Imm,  "LWLE  rt, offset(base)" },
+{ "LWR",::Emulate_LDST_Imm,  "LWR   rt, offset(base)" },
+{ "LWRE",   ::Emulate_LDST_Imm,  "LWRE  rt, offset(base)" },
+{ "LWXC1",  ::Emulate_LDST_Reg,  "LWXC1 fd, index (base)" },
+
+{ "SB", ::Emulate_LDST_Imm,  "SBrt, offset(base)" },
+{ "SBE",::Emulate_LDST_Imm,  "SBE   rt, offset(base)" },
+{ "SC", ::Emulate_LDST_Imm,  "SCrt, offset(base)" },
+{ "SCE",::Emulate_LDST_Imm,  "SCE   rt, offset(base)" },
+{ "SCD",::Emulate_LDST_Imm,  "SCD   rt, offset(base)" },
+{ "SDL",::Emulate_LDST_Imm,  "SDL   rt, 

[Lldb-commits] [lldb] r246956 - Extend the XFAIL for TestMiBreak

2015-09-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Sep  7 02:58:29 2015
New Revision: 246956

URL: http://llvm.org/viewvc/llvm-project?rev=246956=rev
Log:
Extend the XFAIL for TestMiBreak

the test is occasionally failing on linux for all tested scenarios.

Modified:
lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py

Modified: lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=246956=246955=246956=diff
==
--- lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py (original)
+++ lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py Mon Sep  7 02:58:29 
2015
@@ -13,7 +13,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 @lldbmi_test
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
-@expectedFailureAll("llvm.org/pr24717", oslist=["linux"], 
compiler="clang", archs=["i386"])
+@expectedFailureAll("llvm.org/pr24717", oslist=["linux"])
 def test_lldbmi_break_insert_function_pending(self):
 """Test that 'lldb-mi --interpreter' works for pending function 
breakpoints."""
 


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


Re: [Lldb-commits] [PATCH] D12661: NetBSD doesn't provide struct statfs, make use of struct statvfs

2015-09-07 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.
labath added a comment.

In http://reviews.llvm.org/D12661#240625, @joerg wrote:

> One good question is whether using statvfs(3) shouldn't be the default as it 
> is the POSIX interface.


Unfortunately, that will not work as linux does not define the MNT_LOCAL flag 
and struct statvfs does not contain the f_type magic field.


Repository:
  rL LLVM

http://reviews.llvm.org/D12661



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


[Lldb-commits] [lldb] r246957 - Fixup TestRegisters after r246955

2015-09-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Sep  7 03:54:34 2015
New Revision: 246957

URL: http://llvm.org/viewvc/llvm-project?rev=246957=rev
Log:
Fixup TestRegisters after r246955

- clang is picky about inline assembly: add the correct instruction size suffix
- mark the new test as expectedFailureClang: the test fails as the breakpoint 
is set in the wrong
  place

Modified:
lldb/trunk/test/functionalities/register/TestRegisters.py
lldb/trunk/test/functionalities/register/a.cpp

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=246957=246956=246957=diff
==
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Mon Sep  7 
03:54:34 2015
@@ -35,6 +35,7 @@ class RegisterCommandsTestCase(TestBase)
 self.buildDefault()
 self.fp_register_write()
 
+@expectedFailureClang("llvm.org/pr24733")
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:

Modified: lldb/trunk/test/functionalities/register/a.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/a.cpp?rev=246957=246956=246957=diff
==
--- lldb/trunk/test/functionalities/register/a.cpp (original)
+++ lldb/trunk/test/functionalities/register/a.cpp Mon Sep  7 03:54:34 2015
@@ -11,30 +11,31 @@
 long double
 return_long_double (long double value)
 {
-  float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
-__asm__ ( "fld %1 ;"
-   "fld %2 ;"
-   "fld %3 ;"
-   "fld %4 ;"
-   "fld %5 ;"
-   "fld %6 ;"
-   "fld %7 ;"
-   "fadd ;" : "=g" (add) : "g" (a), "g" (b), "g" (c), "g" (d), "g" (e), 
"g" (f), "g" (k), "g" (l) );  // Set break point at this line.
-  return value;
+float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
+__asm__ (
+"flds %1 ;"
+"flds %2 ;"
+"flds %3 ;"
+"flds %4 ;"
+"flds %5 ;"
+"flds %6 ;"
+"flds %7 ;"
+"faddp ;" : "=g" (add) : "g" (a), "g" (b), "g" (c), "g" (d), "g" (e), 
"g" (f), "g" (k), "g" (l) );  // Set break point at this line.
+return value;
 }
 
 long double
 outer_return_long_double (long double value)
 {
-  long double val = return_long_double(value);
-  val *= 2 ;
-  return val;
+long double val = return_long_double(value);
+val *= 2 ;
+return val;
 }
 
 long double
 outermost_return_long_double (long double value)
 {
-  long double val = outer_return_long_double(value);
-  val *= 2 ;
-  return val;
+long double val = outer_return_long_double(value);
+val *= 2 ;
+return val;
 }


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


Re: [Lldb-commits] [lldb] r246955 - Bug 24457 - X87 FPU Special Purpose Registers

2015-09-07 Thread Pavel Labath via lldb-commits
Hi,

this new test fails when the inferior is compiled with clang, as the
produced line tables are not what you expect. I have marked it as
XFAIL to get the bots green, but it would be great if we could write
it in a way that works on clang as well.

pl


On 7 September 2015 at 08:40, Abhishek Aggarwal via lldb-commits
 wrote:
> Author: abhishek
> Date: Mon Sep  7 02:40:16 2015
> New Revision: 246955
>
> URL: http://llvm.org/viewvc/llvm-project?rev=246955=rev
> Log:
> Bug 24457 - X87 FPU Special Purpose Registers
>
> Summary:
>   - For 'register read --all' command on x86_64-Linux Platform:
>
>   -- Provide correct values of X87 FPU Special Purpose Registers
>   -- Both 32-bit & 64-bit inferiors give correct values on this
>  Platform
>
>   - Added a Test Vector:
>   -- To verify the expected behaviour of the command
>
> Signed-off-by: Abhishek Aggarwal 
>
> Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg
>
> Differential Revision: http://reviews.llvm.org/D12592
>
> Added:
> lldb/trunk/test/functionalities/register/a.cpp   (with props)
> Modified:
> 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
>   (contents, props changed)
> 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
> lldb/trunk/test/functionalities/register/Makefile   (contents, props 
> changed)
> lldb/trunk/test/functionalities/register/TestRegisters.py   (contents, 
> props changed)
> lldb/trunk/test/functionalities/register/main.cpp   (contents, props 
> changed)
>
> Modified: 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=246955=246954=246955=diff
> ==
> --- 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
> (original)
> +++ 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
> Mon Sep  7 02:40:16 2015
> @@ -422,6 +422,10 @@ NativeRegisterContextLinux_x86_64::Nativ
>
>  // Clear out the FPR state.
>  ::memset(_fpr, 0, sizeof(FPR));
> +
> +// Store byte offset of fctrl (i.e. first register of FPR)
> +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl");
> +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset;
>  }
>
>  // CONSIDER after local and llgs debugging are merged, register set support 
> can
> @@ -559,8 +563,16 @@ NativeRegisterContextLinux_x86_64::ReadR
>  }
>
>  // Get pointer to m_fpr.xstate.fxsave variable and set the data from it.
> -assert (reg_info->byte_offset < sizeof(m_fpr));
> -uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
> +
> +// Byte offsets of all registers are calculated wrt 'UserArea' structure.
> +// However, ReadFPR() reads fpu registers {using 
> ptrace(PTRACE_GETFPREGS,..)}
> +// and stores them in 'm_fpr' (of type FPR structure). To extract values 
> of fpu
> +// registers, m_fpr should be read at byte offsets calculated wrt to FPR 
> structure.
> +
> +// Since, FPR structure is also one of the member of UserArea structure.
> +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - 
> byte_offset(fctrl wrt UserArea)
> +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < 
> sizeof(m_fpr));
> +uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset - 
> m_fctrl_offset_in_userarea;
>  switch (reg_info->byte_size)
>  {
>  case 2:
> @@ -620,8 +632,16 @@ NativeRegisterContextLinux_x86_64::Write
>  else
>  {
>  // Get pointer to m_fpr.xstate.fxsave variable and set the data 
> to it.
> -assert (reg_info->byte_offset < sizeof(m_fpr));
> -uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
> +
> +// Byte offsets of all registers are calculated wrt 'UserArea' 
> structure.
> +// However, WriteFPR() takes m_fpr (of type FPR structure) and 
> writes only fpu
> +// registers using ptrace(PTRACE_SETFPREGS,..) API. Hence fpu 
> registers should
> +// be written in m_fpr at byte offsets calculated wrt FPR 
> structure.
> +
> +// Since, FPR structure is also one of the member of UserArea 
> structure.
> +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - 
> byte_offset(fctrl wrt UserArea)
> +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < 
> sizeof(m_fpr));
> +uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset - 
> m_fctrl_offset_in_userarea;
>  switch (reg_info->byte_size)
>  {
>  case 2:
>
> Propchange: 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> 

[Lldb-commits] [lldb] r246969 - [www] Typo fixes.

2015-09-07 Thread Bruce Mitchener via lldb-commits
Author: brucem
Date: Mon Sep  7 08:03:07 2015
New Revision: 246969

URL: http://llvm.org/viewvc/llvm-project?rev=246969=rev
Log:
[www] Typo fixes.

Reviewers: clayborg, ki.stfu

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

Modified:
lldb/trunk/www/build.html
lldb/trunk/www/index.html
lldb/trunk/www/test.html
lldb/trunk/www/varformats.html

Modified: lldb/trunk/www/build.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/build.html?rev=246969=246968=246969=diff
==
--- lldb/trunk/www/build.html (original)
+++ lldb/trunk/www/build.html Mon Sep  7 08:03:07 2015
@@ -16,7 +16,7 @@
   
 
   
-Continuous Integraton
+Continuous Integration
 
   
 The following LLVM buildbots build and test LLDB trunk:
@@ -362,7 +362,7 @@
   In order to debug remote targets running different architectures 
than your host, you
   will need to compile LLDB (or at least the server component) for 
the target. While
   the easiest solution is to just compile it locally on the 
target, this is often not
-  feasable, and in these cases you will need to cross-compile LLDB 
on your host.
+  feasible, and in these cases you will need to cross-compile LLDB 
on your host.
 
 
 
@@ -453,7 +453,7 @@
 
 
   Ubuntu already provides the packages necessary to cross-compile 
LLDB for arm64. It
-  is sufficient to install pacakges gcc-aarch64-linux-gnu, 
g++-aarch64-linux-gnu,
+  is sufficient to install packages gcc-aarch64-linux-gnu, 
g++-aarch64-linux-gnu,
   binutils-aarch64-linux-gnu. Then it is possible to prepare the 
cmake build with the
   following parameters:
 
@@ -485,7 +485,7 @@
 
   If you wanted to build a full version of LLDB and avoid passing
   -DLLDB_DISABLE_PYTHON and other options, you would need to 
obtain the target
-  versions of the respective libraries. The easiest way to achive 
this is to use the
+  versions of the respective libraries. The easiest way to achieve 
this is to use the
   qemu-debootstrap utility, which can prepare a 
system image using qemu
   and chroot to simulate the target environment. Then you can 
install the necessary
   packages in this environment (python-dev, libedit-dev, etc.) and 
point your
@@ -524,7 +524,7 @@
 
 
 
-  Note that the full LLVM build is not functional on android yet, 
so simply runing
+  Note that the full LLVM build is not functional on android yet, 
so simply running
   ninja will not work. You will need to manually 
specify the target you
   want to build: lldb, lldb-server, etc.
 

Modified: lldb/trunk/www/index.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/index.html?rev=246969=246968=246969=diff
==
--- lldb/trunk/www/index.html (original)
+++ lldb/trunk/www/index.html Mon Sep  7 08:03:07 2015
@@ -61,7 +61,7 @@

Up to date language support 
for C, C++, Objective C
Multi-line expressions that 
can declare local variables and types
-   Utilitize the JIT for 
expressions when supported
+   Utilize the JIT for 
expressions when supported
Evaluate expression 
Intermediate Representation (IR) when JIT can't be used



Modified: lldb/trunk/www/test.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/test.html?rev=246969=246968=246969=diff
==
--- lldb/trunk/www/test.html (original)
+++ lldb/trunk/www/test.html Mon Sep  7 08:03:07 2015
@@ -81,7 +81,7 @@
   additional --test-subdir SUBDIR arg.  When
   specified, SUBDIR is relative to the root test directory
   and will limit all parallel test running to that
-  sudirectory's tree of tests.
+  subdirectory's tree of tests.
 
 
   The parallel test runner will run all tests within a
@@ -117,7 +117,7 @@
 
   Currently, running the remote test suite is supported only with
   dotest.py (or dosep.py with a single 
thread), but we
-  expect this issue to be adressed in the near future.
+  expect this issue to be 

[Lldb-commits] [lldb] r246958 - Use eAddressClassCode for address lookup for opcodes for stack frames

2015-09-07 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Sep  7 04:58:09 2015
New Revision: 246958

URL: http://llvm.org/viewvc/llvm-project?rev=246958=rev
Log:
Use eAddressClassCode for address lookup for opcodes for stack frames

It is required because of the following edge case on arm:

bxNon-tail call in a no return function
[data-pool] Marked with $d mapping symbol

The return address of the function call will point to the data pool but
we have to treat it as code so the StackFrame can calculate the symbols
correctly.

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

Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=246958=246957=246958=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Mon Sep  7 04:58:09 2015
@@ -326,7 +326,8 @@ public:
 /// not loaded.
 //--
 lldb::addr_t
-GetOpcodeLoadAddress (Target *target) const;
+GetOpcodeLoadAddress (Target *target,
+  lldb::AddressClass addr_class = 
lldb::eAddressClassInvalid) const;
 
 //--
 /// Get the section relative offset value.
@@ -425,7 +426,9 @@ public:
 SetLoadAddress (lldb::addr_t load_addr, Target *target);
 
 bool
-SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target);
+SetOpcodeLoadAddress (lldb::addr_t load_addr,
+  Target *target,
+  lldb::AddressClass addr_class = 
lldb::eAddressClassInvalid);
 
 bool
 SetCallableLoadAddress (lldb::addr_t load_addr, Target *target);

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=246958=246957=246958=diff
==
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Mon Sep  7 04:58:09 2015
@@ -484,7 +484,7 @@ SBFrame::GetPC () const
 frame = exe_ctx.GetFramePtr();
 if (frame)
 {
-addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress 
(target);
+addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress 
(target, eAddressClassCode);
 }
 else
 {

Modified: lldb/trunk/source/Core/Address.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=246958=246957=246958=diff
==
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Mon Sep  7 04:58:09 2015
@@ -367,21 +367,29 @@ Address::SetCallableLoadAddress (lldb::a
 }
 
 addr_t
-Address::GetOpcodeLoadAddress (Target *target) const
+Address::GetOpcodeLoadAddress (Target *target, AddressClass addr_class) const
 {
 addr_t code_addr = GetLoadAddress (target);
 if (code_addr != LLDB_INVALID_ADDRESS)
-code_addr = target->GetOpcodeLoadAddress (code_addr, 
GetAddressClass());
+{
+if (addr_class == eAddressClassInvalid)
+addr_class = GetAddressClass();
+code_addr = target->GetOpcodeLoadAddress (code_addr, addr_class);
+}
 return code_addr;
 }
 
 bool
-Address::SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target)
+Address::SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target, 
AddressClass addr_class)
 {
 if (SetLoadAddress (load_addr, target))
 {
 if (target)
-m_offset = target->GetOpcodeLoadAddress (m_offset, 
GetAddressClass());
+{
+if (addr_class == eAddressClassInvalid)
+addr_class = GetAddressClass();
+m_offset = target->GetOpcodeLoadAddress (m_offset, addr_class);
+}
 return true;
 }
 return false;

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=246958=246957=246958=diff
==
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Mon Sep  7 04:58:09 2015
@@ -259,7 +259,7 @@ StackFrame::GetFrameCodeAddress()
 TargetSP target_sp (thread_sp->CalculateTarget());
 if (target_sp)
 {
-if (m_frame_code_addr.SetOpcodeLoadAddress 
(m_frame_code_addr.GetOffset(), target_sp.get()))
+if (m_frame_code_addr.SetOpcodeLoadAddress 

[Lldb-commits] [lldb] r246966 - Mark TestCreateDuringInstructionStep as flaky on android arm

2015-09-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Sep  7 07:15:27 2015
New Revision: 246966

URL: http://llvm.org/viewvc/llvm-project?rev=246966=rev
Log:
Mark TestCreateDuringInstructionStep as flaky on android arm

Modified:

lldb/trunk/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
lldb/trunk/test/lldbtest.py

Modified: 
lldb/trunk/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py?rev=246966=246965=246966=diff
==
--- 
lldb/trunk/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
 (original)
+++ 
lldb/trunk/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
 Mon Sep  7 07:15:27 2015
@@ -18,6 +18,7 @@ class CreateDuringInstructionStepTestCas
 TestBase.setUp(self)
 
 @skipUnlessPlatform(['linux'])
+@expectedFlakeyAndroid('llvm.org/pr24737', archs=['arm'])
 @dwarf_test
 def test_step_inst_with_dwarf(self):
 self.buildDwarf(dictionary=self.getBuildFlags())

Modified: lldb/trunk/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=246966=246965=246966=diff
==
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Sep  7 07:15:27 2015
@@ -789,6 +789,9 @@ def expectedFlakeyClang(bugnumber=None,
 def expectedFlakeyGcc(bugnumber=None, compiler_version=None):
 return expectedFlakeyCompiler('gcc', compiler_version, bugnumber)
 
+def expectedFlakeyAndroid(bugnumber=None, api_levels=None, archs=None):
+return expectedFlakey(matchAndroid(api_levels, archs), bugnumber)
+
 def skipIfRemote(func):
 """Decorate the item to skip tests if testing remotely."""
 if isinstance(func, type) and issubclass(func, unittest2.TestCase):


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


Re: [Lldb-commits] [PATCH] D12636: Fix the handling of FPR offsets in Linux arm/aarch64 register contexts

2015-09-07 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL246959: Fix the handling of FPR offsets in Linux arm/aarch64 
register contexts (authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D12636?vs=34034=34138#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12636

Files:
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp

Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
@@ -21,7 +21,7 @@
 #define GPR_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::GPR, reg))
 
 #define FPU_OFFSET(idx) ((idx) * 16 + sizeof (RegisterContextLinux_arm64::GPR))
-#define FPU_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::FPU, reg))
+#define FPU_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::FPU, reg) + sizeof (RegisterContextLinux_arm64::GPR))
 
 #define EXC_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::EXC, reg) + sizeof (RegisterContextLinux_arm64::GPR) + sizeof (RegisterContextLinux_arm64::FPU))
 #define DBG_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::DBG, reg) + sizeof (RegisterContextLinux_arm64::GPR) + sizeof (RegisterContextLinux_arm64::FPU) + sizeof (RegisterContextLinux_arm64::EXC))
Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -249,8 +249,9 @@
 }
 
 // Get pointer to m_fpr variable and set the data from it.
-assert (reg_info->byte_offset < sizeof m_fpr);
-uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *src = (uint8_t *)_fpr + fpr_offset;
 reg_value.SetFromMemoryData(reg_info, src, reg_info->byte_size, eByteOrderLittle, error);
 
 return error;
@@ -272,8 +273,9 @@
 if (IsFPR(reg_index))
 {
 // Get pointer to m_fpr variable and set the data to it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *dst = (uint8_t *)_fpr + fpr_offset;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -980,4 +982,10 @@
 return NativeProcessLinux::PtraceWrapper(PTRACE_SETREGSET, m_thread.GetID(), , , buf_size);
 }
 
+uint32_t
+NativeRegisterContextLinux_arm64::CalculateFprOffset(const RegisterInfo* reg_info) const
+{
+return reg_info->byte_offset - GetRegisterInfoAtIndex(m_reg_info.first_fpr)->byte_offset;
+}
+
 #endif // defined (__arm64__) || defined (__aarch64__)
Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -161,6 +161,9 @@
 
 Error
 WriteHardwareDebugRegs(int hwbType, int hwb_index);
+
+uint32_t
+CalculateFprOffset(const RegisterInfo* reg_info) const;
 };
 
 } // namespace process_linux
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
@@ -229,8 +229,9 @@
 }
 
 // Get pointer to m_fpr variable and set the data from it.
-assert (reg_info->byte_offset < sizeof m_fpr);
-uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *src = (uint8_t *)_fpr + fpr_offset;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -267,8 +268,9 @@
 if (IsFPR(reg_index))
 {
 // Get pointer to m_fpr variable and set the data to it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
+

[Lldb-commits] [lldb] r246965 - Fix -data-evaluate-expression for array.

2015-09-07 Thread Hafiz Abid Qadeer via lldb-commits
Author: abidh
Date: Mon Sep  7 07:00:51 2015
New Revision: 246965

URL: http://llvm.org/viewvc/llvm-project?rev=246965=rev
Log:
Fix -data-evaluate-expression for array.

Summary:
For an array declared like "blk[2][3]", this command was showing:
-data-evaluate-expression blk
^done,value="{[0] = [3], [1] = [3]}"

After this fix, it shows:
-data-evaluate-expression blk
^done,value="{[0] = {[0] = 1, [1] = 2, [2] = 3}, [1] = {[0] = 4, [1] = 5, [2] = 
6}}"

The code to do the right thing was already available and used by other commands.
So I have just used that and removed the half-baked previous implementation.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

Modified:
lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
lldb/trunk/test/tools/lldb-mi/data/main.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdData.h

Modified: lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/data/TestMiData.py?rev=246965=246964=246965=diff
==
--- lldb/trunk/test/tools/lldb-mi/data/TestMiData.py (original)
+++ lldb/trunk/test/tools/lldb-mi/data/TestMiData.py Mon Sep  7 07:00:51 2015
@@ -312,5 +312,28 @@ class MiDataTestCase(lldbmi_testcase.MiT
 self.runCmd("-data-info-line main.cpp:0")
 self.expect("\^error,msg=\"error: zero is an invalid line number")
 
+@lldbmi_test
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread 
races
+def test_lldbmi_data_evaluate_expression(self):
+"""Test that 'lldb-mi --interpreter' works for 
-data-evaluate-expression."""
+
+self.spawnLldbMi(args = None)
+
+# Load executable
+self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+self.expect("\^done")
+
+line = line_number('main.cpp', '// BP_local_2d_array_test')
+self.runCmd('-break-insert main.cpp:%d' % line)
+self.expect("\^done,bkpt={number=\"1\"")
+self.runCmd("-exec-run")
+self.expect("\^running")
+self.expect("\*stopped,reason=\"breakpoint-hit\"")
+
+# Check 2d array 
+self.runCmd("-data-evaluate-expression array2d")
+self.expect("\^done,value=\"\{\[0\] = \{\[0\] = 1, \[1\] = 2, \[2\] = 
3\}, \[1\] = \{\[0\] = 4, \[1\] = 5, \[2\] = 6\}\}\"")
+
 if __name__ == '__main__':
 unittest2.main()

Modified: lldb/trunk/test/tools/lldb-mi/data/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/data/main.cpp?rev=246965=246964=246965=diff
==
--- lldb/trunk/test/tools/lldb-mi/data/main.cpp (original)
+++ lldb/trunk/test/tools/lldb-mi/data/main.cpp Mon Sep  7 07:00:51 2015
@@ -31,6 +31,19 @@ local_array_test()
 }
 
 void
+local_2d_array_test()
+{
+int array2d[2][3];
+array2d[0][0] = 1;
+array2d[0][1] = 2;
+array2d[0][2] = 3;
+array2d[1][0] = 4;
+array2d[1][1] = 5;
+array2d[1][2] = 6;
+return; // BP_local_2d_array_test
+}
+
+void
 hello_world()
 {
 printf("Hello, World!\n"); // BP_hello_world
@@ -41,5 +54,6 @@ main(int argc, char const *argv[])
 { // FUNC_main
 local_array_test();
 hello_world();
+local_2d_array_test();
 return 0;
 }

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp?rev=246965=246964=246965=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp Mon Sep  7 07:00:51 2015
@@ -54,7 +54,6 @@ CMICmdCmdDataEvaluateExpression::CMICmdC
 : m_bExpressionValid(true)
 , m_bEvaluatedExpression(true)
 , m_strValue("??")
-, m_bCompositeVarType(false)
 , m_bFoundInvalidChar(false)
 , m_cExpressionInvalidChar(0x00)
 , m_constStrArgThread("thread")
@@ -145,41 +144,7 @@ CMICmdCmdDataEvaluateExpression::Execute
 m_strValue = rExpression.Trim('\"');
 return MIstatus::success;
 }
-
-MIuint64 nNumber = 0;
-if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(value, nNumber) == 
MIstatus::success)
-{
-const lldb::ValueType eValueType = value.GetValueType();
-MIunused(eValueType);
-m_strValue = utilValue.GetValue().Escape().AddSlashes();
-return MIstatus::success;
-}
-
-// Composite type i.e. struct
-m_bCompositeVarType = true;
-const MIuint nChild = value.GetNumChildren();
-for (MIuint i = 0; i < nChild; i++)
-{
-lldb::SBValue member = value.GetChildAtIndex(i);
-const bool bValid = member.IsValid();
-CMIUtilString strType(MIRSRC(IDS_WORD_UNKNOWNTYPE_BRKTS));
-if (bValid)
-   

Re: [Lldb-commits] [PATCH] D12671: [LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.

2015-09-07 Thread Nitesh Jain via lldb-commits
nitesh.jain updated the summary for this revision.
nitesh.jain updated this revision to Diff 34146.
nitesh.jain added a comment.

Added include/lldb/Core/ArchSpec.h diff


Repository:
  rL LLVM

http://reviews.llvm.org/D12671

Files:
  include/lldb/Core/ArchSpec.h
  source/Core/ArchSpec.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1517,8 +1517,8 @@
  I != section_headers.end(); ++I)
 {
 static ConstString g_sect_name_gnu_debuglink (".gnu_debuglink");
-const ELFSectionHeaderInfo  = *I;
-const uint64_t section_size = header.sh_type == SHT_NOBITS ? 0 : header.sh_size;
+const ELFSectionHeaderInfo  = *I;
+const uint64_t section_size = sheader.sh_type == SHT_NOBITS ? 0 : sheader.sh_size;
 ConstString name(shstr_data.PeekCStr(I->sh_name));
 
 I->section_name = name;
@@ -1526,23 +1526,33 @@
 if (arch_spec.GetMachine() == llvm::Triple::mips || arch_spec.GetMachine() == llvm::Triple::mipsel
 || arch_spec.GetMachine() == llvm::Triple::mips64 || arch_spec.GetMachine() == llvm::Triple::mips64el)
 {
-if (header.sh_type == SHT_MIPS_ABIFLAGS)
+uint32_t arch_flags = arch_spec.GetFlags ();
+DataExtractor data;
+if (sheader.sh_type == SHT_MIPS_ABIFLAGS)
 {
-DataExtractor data;
-if (section_size && (data.SetData (object_data, header.sh_offset, section_size) == section_size))
+
+if (section_size && (data.SetData (object_data, sheader.sh_offset, section_size) == section_size))
 {
 lldb::offset_t ase_offset = 12; // MIPS ABI Flags Version: 0
-uint32_t arch_flags = arch_spec.GetFlags ();
 arch_flags |= data.GetU32 (_offset);
-arch_spec.SetFlags (arch_flags);
 }
 }
+// Settings appropriate ArchSpec ABI Flags
+if (header.e_flags & llvm::ELF::EF_MIPS_ABI2)
+{   
+arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
+}
+else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32)
+{
+ arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;   
+}
+arch_spec.SetFlags (arch_flags);
 }
 
 if (name == g_sect_name_gnu_debuglink)
 {
 DataExtractor data;
-if (section_size && (data.SetData (object_data, header.sh_offset, section_size) == section_size))
+if (section_size && (data.SetData (object_data, sheader.sh_offset, section_size) == section_size))
 {
 lldb::offset_t gnu_debuglink_offset = 0;
 gnu_debuglink_file = data.GetCStr (_debuglink_offset);
@@ -1552,7 +1562,7 @@
 }
 
 // Process ELF note section entries.
-bool is_note_header = (header.sh_type == SHT_NOTE);
+bool is_note_header = (sheader.sh_type == SHT_NOTE);
 
 // The section header ".note.android.ident" is stored as a
 // PROGBITS type header but it is actually a note header.
@@ -1564,7 +1574,7 @@
 {
 // Allow notes to refine module info.
 DataExtractor data;
-if (section_size && (data.SetData (object_data, header.sh_offset, section_size) == section_size))
+if (section_size && (data.SetData (object_data, sheader.sh_offset, section_size) == section_size))
 {
 Error error = RefineModuleDetailsFromNote (data, arch_spec, uuid);
 if (error.Fail ())
Index: source/Core/ArchSpec.cpp
===
--- source/Core/ArchSpec.cpp
+++ source/Core/ArchSpec.cpp
@@ -602,7 +602,15 @@
 {
 const CoreDefinition *core_def = FindCoreDefinition (m_core);
 if (core_def)
-return core_def->addr_byte_size;
+{ 
+   if (core_def->machine == llvm::Triple::mips64 || core_def->machine == llvm::Triple::mips64el)
+   {  
+  // For N32/O32 applications Address size is 4 bytes.
+  if (m_flags & (eMIPSABI_N32 | eMIPSABI_O32))
+  return 4;
+   }
+   return core_def->addr_byte_size;
+

[Lldb-commits] [lldb] r246964 - Skip RegisterCommandsTestCase.test_fp_register_write on Android i386

2015-09-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Sep  7 06:59:01 2015
New Revision: 246964

URL: http://llvm.org/viewvc/llvm-project?rev=246964=rev
Log:
Skip RegisterCommandsTestCase.test_fp_register_write on Android i386

it appears a kernel bug is preventing us from writing into the register.

Modified:
lldb/trunk/test/functionalities/register/TestRegisters.py

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=246964=246963=246964=diff
==
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Mon Sep  7 
06:59:01 2015
@@ -28,6 +28,7 @@ class RegisterCommandsTestCase(TestBase)
 self.buildDefault()
 self.register_commands()
 
+@skipIfTargetAndroid(archs=["i386"]) # Writing of mxcsr register fails, 
presumably due to a kernel/hardware problem
 def test_fp_register_write(self):
 """Test commands that write to registers, in particular floating-point 
registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:


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


Re: [Lldb-commits] [PATCH] D12634: Fix -data-evaluate-expression for array.

2015-09-07 Thread Hafiz Abid Qadeer via lldb-commits
abidh updated this revision to Diff 34136.
abidh added a comment.

Handle review comments.
Moved the test to data directory and put it in a separate function.


http://reviews.llvm.org/D12634

Files:
  test/tools/lldb-mi/data/TestMiData.py
  test/tools/lldb-mi/data/main.cpp
  tools/lldb-mi/MICmdCmdData.cpp
  tools/lldb-mi/MICmdCmdData.h

Index: tools/lldb-mi/MICmdCmdData.h
===
--- tools/lldb-mi/MICmdCmdData.h
+++ tools/lldb-mi/MICmdCmdData.h
@@ -73,7 +73,6 @@
 bool m_bEvaluatedExpression; // True = yes is expression evaluated, false = failed
 CMIUtilString m_strValue;
 CMICmnMIValueTuple m_miValueTuple;
-bool m_bCompositeVarType; // True = yes composite type, false = internal type
 bool m_bFoundInvalidChar; // True = yes found unexpected character in the expression, false = all ok
 char m_cExpressionInvalidChar;
 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
Index: tools/lldb-mi/MICmdCmdData.cpp
===
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -54,7 +54,6 @@
 : m_bExpressionValid(true)
 , m_bEvaluatedExpression(true)
 , m_strValue("??")
-, m_bCompositeVarType(false)
 , m_bFoundInvalidChar(false)
 , m_cExpressionInvalidChar(0x00)
 , m_constStrArgThread("thread")
@@ -145,41 +144,7 @@
 m_strValue = rExpression.Trim('\"');
 return MIstatus::success;
 }
-
-MIuint64 nNumber = 0;
-if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(value, nNumber) == MIstatus::success)
-{
-const lldb::ValueType eValueType = value.GetValueType();
-MIunused(eValueType);
-m_strValue = utilValue.GetValue().Escape().AddSlashes();
-return MIstatus::success;
-}
-
-// Composite type i.e. struct
-m_bCompositeVarType = true;
-const MIuint nChild = value.GetNumChildren();
-for (MIuint i = 0; i < nChild; i++)
-{
-lldb::SBValue member = value.GetChildAtIndex(i);
-const bool bValid = member.IsValid();
-CMIUtilString strType(MIRSRC(IDS_WORD_UNKNOWNTYPE_BRKTS));
-if (bValid)
-{
-const CMIUtilString strValue(
-CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(member, CMICmnLLDBDebugSessionInfoVarObj::eVarFormat_Natural));
-const char *pTypeName = member.GetName();
-if (pTypeName != nullptr)
-strType = pTypeName;
-
-// MI print "{variable = 1, variable2 = 3, variable3 = 5}"
-const bool bNoQuotes = true;
-const CMICmnMIValueConst miValueConst(strValue, bNoQuotes);
-const bool bUseSpaces = true;
-const CMICmnMIValueResult miValueResult(strType, miValueConst, bUseSpaces);
-m_miValueTuple.Add(miValueResult, bUseSpaces);
-}
-}
-
+m_strValue = utilValue.GetValue(true).Escape().AddSlashes();
 return MIstatus::success;
 }
 
@@ -199,15 +164,6 @@
 {
 if (m_bEvaluatedExpression)
 {
-if (m_bCompositeVarType)
-{
-const CMICmnMIValueConst miValueConst(m_miValueTuple.GetString());
-const CMICmnMIValueResult miValueResult("value", miValueConst);
-const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
-m_miResultRecord = miRecordResult;
-return MIstatus::success;
-}
-
 if (m_bFoundInvalidChar)
 {
 const CMICmnMIValueConst miValueConst(
Index: test/tools/lldb-mi/data/main.cpp
===
--- test/tools/lldb-mi/data/main.cpp
+++ test/tools/lldb-mi/data/main.cpp
@@ -31,6 +31,19 @@
 }
 
 void
+local_2d_array_test()
+{
+int array2d[2][3];
+array2d[0][0] = 1;
+array2d[0][1] = 2;
+array2d[0][2] = 3;
+array2d[1][0] = 4;
+array2d[1][1] = 5;
+array2d[1][2] = 6;
+return; // BP_local_2d_array_test
+}
+
+void
 hello_world()
 {
 printf("Hello, World!\n"); // BP_hello_world
@@ -41,5 +54,6 @@
 { // FUNC_main
 local_array_test();
 hello_world();
+local_2d_array_test();
 return 0;
 }
Index: test/tools/lldb-mi/data/TestMiData.py
===
--- test/tools/lldb-mi/data/TestMiData.py
+++ test/tools/lldb-mi/data/TestMiData.py
@@ -312,5 +312,28 @@
 self.runCmd("-data-info-line main.cpp:0")
 self.expect("\^error,msg=\"error: zero is an invalid line number")
 
+@lldbmi_test
+@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+def test_lldbmi_data_evaluate_expression(self):
+

Re: [Lldb-commits] [lldb] r246955 - Bug 24457 - X87 FPU Special Purpose Registers

2015-09-07 Thread Aggarwal, Abhishek A via lldb-commits
Hi 

Thanks a lot for pointing out. There was a problem with the compilation of the 
inferior with clang and hence, the absence of the inferior's executable was 
causing the failure of the test for clang compiler. I fixed it and will soon 
upstream the change. 

Thanks & Regards
Abhishek Aggarwal

-Original Message-
From: Pavel Labath [mailto:lab...@google.com] 
Sent: Monday, September 7, 2015 10:58 AM
To: Aggarwal, Abhishek A
Cc: lldb-commits@lists.llvm.org
Subject: Re: [Lldb-commits] [lldb] r246955 - Bug 24457 - X87 FPU Special 
Purpose Registers

Hi,

this new test fails when the inferior is compiled with clang, as the produced 
line tables are not what you expect. I have marked it as XFAIL to get the bots 
green, but it would be great if we could write it in a way that works on clang 
as well.

pl


On 7 September 2015 at 08:40, Abhishek Aggarwal via lldb-commits 
 wrote:
> Author: abhishek
> Date: Mon Sep  7 02:40:16 2015
> New Revision: 246955
>
> URL: http://llvm.org/viewvc/llvm-project?rev=246955=rev
> Log:
> Bug 24457 - X87 FPU Special Purpose Registers
>
> Summary:
>   - For 'register read --all' command on x86_64-Linux Platform:
>
>   -- Provide correct values of X87 FPU Special Purpose Registers
>   -- Both 32-bit & 64-bit inferiors give correct values on this
>  Platform
>
>   - Added a Test Vector:
>   -- To verify the expected behaviour of the command
>
> Signed-off-by: Abhishek Aggarwal 
>
> Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg
>
> Differential Revision: http://reviews.llvm.org/D12592
>
> Added:
> lldb/trunk/test/functionalities/register/a.cpp   (with props)
> Modified:
> 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
>   (contents, props changed)
> 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
> lldb/trunk/test/functionalities/register/Makefile   (contents, props 
> changed)
> lldb/trunk/test/functionalities/register/TestRegisters.py   (contents, 
> props changed)
> lldb/trunk/test/functionalities/register/main.cpp   (contents, props 
> changed)
>
> Modified: 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86
> _64.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/
> Linux/NativeRegisterContextLinux_x86_64.cpp?rev=246955=246954=24
> 6955=diff 
> ==
> 
> --- 
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86
> _64.cpp (original)
> +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux
> +++ _x86_64.cpp Mon Sep  7 02:40:16 2015
> @@ -422,6 +422,10 @@ NativeRegisterContextLinux_x86_64::Nativ
>
>  // Clear out the FPR state.
>  ::memset(_fpr, 0, sizeof(FPR));
> +
> +// Store byte offset of fctrl (i.e. first register of FPR)
> +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl");
> +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset;
>  }
>
>  // CONSIDER after local and llgs debugging are merged, register set 
> support can @@ -559,8 +563,16 @@ NativeRegisterContextLinux_x86_64::ReadR
>  }
>
>  // Get pointer to m_fpr.xstate.fxsave variable and set the data from it.
> -assert (reg_info->byte_offset < sizeof(m_fpr));
> -uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
> +
> +// Byte offsets of all registers are calculated wrt 'UserArea' structure.
> +// However, ReadFPR() reads fpu registers {using 
> ptrace(PTRACE_GETFPREGS,..)}
> +// and stores them in 'm_fpr' (of type FPR structure). To extract values 
> of fpu
> +// registers, m_fpr should be read at byte offsets calculated wrt to FPR 
> structure.
> +
> +// Since, FPR structure is also one of the member of UserArea structure.
> +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - 
> byte_offset(fctrl wrt UserArea)
> +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < 
> sizeof(m_fpr));
> +uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset - 
> + m_fctrl_offset_in_userarea;
>  switch (reg_info->byte_size)
>  {
>  case 2:
> @@ -620,8 +632,16 @@ NativeRegisterContextLinux_x86_64::Write
>  else
>  {
>  // Get pointer to m_fpr.xstate.fxsave variable and set the data 
> to it.
> -assert (reg_info->byte_offset < sizeof(m_fpr));
> -uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
> +
> +// Byte offsets of all registers are calculated wrt 'UserArea' 
> structure.
> +// However, WriteFPR() takes m_fpr (of type FPR structure) and 
> writes only fpu
> +// registers using ptrace(PTRACE_SETFPREGS,..) API. Hence fpu 
> registers should
> +// be written in m_fpr at byte offsets calculated wrt FPR 
> structure.
> +
> +// Since, 

Re: [Lldb-commits] [PATCH] D12636: Fix the handling of FPR offsets in Linux arm/aarch64 register contexts

2015-09-07 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

I prefer to keep it this way because there is no canonical register layout we 
can rely on so putting them just next to each other would be just an arbitrary 
layout what might break in the future. If we want the offsets to make sense, 
then on arm/aarch64 the best approach would be to store the offset from the 
beginning of the given register set because it will make sense on its own and 
with the data returned by ptrace.


http://reviews.llvm.org/D12636



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


[Lldb-commits] [lldb] r246959 - Fix the handling of FPR offsets in Linux arm/aarch64 register contexts

2015-09-07 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Sep  7 05:11:23 2015
New Revision: 246959

URL: http://llvm.org/viewvc/llvm-project?rev=246959=rev
Log:
Fix the handling of FPR offsets in Linux arm/aarch64 register contexts

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

Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.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=246959=246958=246959=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
Mon Sep  7 05:11:23 2015
@@ -229,8 +229,9 @@ NativeRegisterContextLinux_arm::ReadRegi
 }
 
 // Get pointer to m_fpr variable and set the data from it.
-assert (reg_info->byte_offset < sizeof m_fpr);
-uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *src = (uint8_t *)_fpr + fpr_offset;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -267,8 +268,9 @@ NativeRegisterContextLinux_arm::WriteReg
 if (IsFPR(reg_index))
 {
 // Get pointer to m_fpr variable and set the data to it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *dst = (uint8_t *)_fpr + fpr_offset;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -844,4 +846,11 @@ NativeRegisterContextLinux_arm::WriteHar
 
 return error;
 }
+
+uint32_t
+NativeRegisterContextLinux_arm::CalculateFprOffset(const RegisterInfo* 
reg_info) const
+{
+return reg_info->byte_offset - 
GetRegisterInfoAtIndex(m_reg_info.first_fpr)->byte_offset;
+}
+
 #endif // defined(__arm__)

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h?rev=246959=246958=246959=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h 
Mon Sep  7 05:11:23 2015
@@ -161,6 +161,9 @@ namespace process_linux {
 
 Error
 WriteHardwareDebugRegs(int hwbType, int hwb_index);
+
+uint32_t
+CalculateFprOffset(const RegisterInfo* reg_info) const;
 };
 
 } // namespace process_linux

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp?rev=246959=246958=246959=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp 
Mon Sep  7 05:11:23 2015
@@ -249,8 +249,9 @@ NativeRegisterContextLinux_arm64::ReadRe
 }
 
 // Get pointer to m_fpr variable and set the data from it.
-assert (reg_info->byte_offset < sizeof m_fpr);
-uint8_t *src = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *src = (uint8_t *)_fpr + fpr_offset;
 reg_value.SetFromMemoryData(reg_info, src, reg_info->byte_size, 
eByteOrderLittle, error);
 
 return error;
@@ -272,8 +273,9 @@ NativeRegisterContextLinux_arm64::WriteR
 if (IsFPR(reg_index))
 {
 // Get pointer to m_fpr variable and set the data to it.
-assert (reg_info->byte_offset < sizeof(m_fpr));
-uint8_t *dst = (uint8_t *)_fpr + reg_info->byte_offset;
+uint32_t fpr_offset = CalculateFprOffset(reg_info);
+assert (fpr_offset < sizeof m_fpr);
+uint8_t *dst = (uint8_t *)_fpr + fpr_offset;
 switch (reg_info->byte_size)
 {
 case 2:
@@ -980,4 +982,10 @@ NativeRegisterContextLinux_arm64::DoWrit
 return NativeProcessLinux::PtraceWrapper(PTRACE_SETREGSET, 
m_thread.GetID(), , , buf_size);
 }
 
+uint32_t
+NativeRegisterContextLinux_arm64::CalculateFprOffset(const 

Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

2015-09-07 Thread Pavel Labath via lldb-commits
labath added a subscriber: lldb-commits.


Comment at: test/functionalities/register/TestRegisters.py:195
@@ +194,3 @@
+for x in range(0,16):
+self.runCmd ("si", RUN_SUCCEEDED)
+

First I would like to applaud for writing a test case for such a delicate 
issue. I know it's not easy given the current test infrastructure.

However, this change seems very fragile and likely to break due to random 
changes in clang implementation and/or command line flags. Even the gcc path 
can break if the gcc happens to produce slightly different output. I would like 
to avoid relying on hardcoded instruction counts.

How about we try something like this:
- in the inline assembly, we prepend the code you want to test with "int3"
- run the inferior normally. it should hit the debugger trap and stop (you can 
verify that the stop reason is indeed sigtrap)
- the next instruction should point precisely at the code you want to test, 
without relying on any debug info or instruction counts
- proceed with the test normally

what do you think?


http://reviews.llvm.org/D12677



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


[Lldb-commits] [lldb] r246972 - XFAIL single_step_only_steps_one_instruction related tests on arm/aarch64

2015-09-07 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Sep  7 11:01:26 2015
New Revision: 246972

URL: http://llvm.org/viewvc/llvm-project?rev=246972=rev
Log:
XFAIL single_step_only_steps_one_instruction related tests on arm/aarch64

Modified:
lldb/trunk/test/tools/lldb-server/TestGdbRemoteSingleStep.py
lldb/trunk/test/tools/lldb-server/TestGdbRemote_vCont.py

Modified: lldb/trunk/test/tools/lldb-server/TestGdbRemoteSingleStep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestGdbRemoteSingleStep.py?rev=246972=246971=246972=diff
==
--- lldb/trunk/test/tools/lldb-server/TestGdbRemoteSingleStep.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestGdbRemoteSingleStep.py Mon Sep  7 
11:01:26 2015
@@ -17,6 +17,7 @@ class TestGdbRemoteSingleStep(gdbremote_
 
 @llgs_test
 @dwarf_test
+@expectedFailureAndroid(bugnumber="llvm.com/pr24739", archs=["arm", 
"aarch64"])
 def test_single_step_only_steps_one_instruction_with_s_llgs_dwarf(self):
 self.init_llgs_test()
 self.buildDwarf()

Modified: lldb/trunk/test/tools/lldb-server/TestGdbRemote_vCont.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestGdbRemote_vCont.py?rev=246972=246971=246972=diff
==
--- lldb/trunk/test/tools/lldb-server/TestGdbRemote_vCont.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestGdbRemote_vCont.py Mon Sep  7 
11:01:26 2015
@@ -100,6 +100,7 @@ class TestGdbRemote_vCont(gdbremote_test
 
 @llgs_test
 @dwarf_test
+@expectedFailureAndroid(bugnumber="llvm.com/pr24739", archs=["arm", 
"aarch64"])
 def 
test_single_step_only_steps_one_instruction_with_Hc_vCont_s_llgs_dwarf(self):
 self.init_llgs_test()
 self.buildDwarf()
@@ -116,6 +117,7 @@ class TestGdbRemote_vCont(gdbremote_test
 
 @llgs_test
 @dwarf_test
+@expectedFailureAndroid(bugnumber="llvm.com/pr24739", archs=["arm", 
"aarch64"])
 def 
test_single_step_only_steps_one_instruction_with_vCont_s_thread_llgs_dwarf(self):
 self.init_llgs_test()
 self.buildDwarf()


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


Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

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

looks good. please also close the relevant bug after submission.


http://reviews.llvm.org/D12677



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


[Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-07 Thread Jeremi Piotrowski via lldb-commits
jeremi.piotrowski created this revision.
jeremi.piotrowski added a subscriber: lldb-commits.

Ncurses related symbols can either all be found in libnurses or split between
libncurses and libtinfo. The main LLVM cmake scripts look for the setupterm
symbol and stores the library that has it in TERMINFO_LIBS. This covers the
split and unified ncurses case. LLDB uses symbols that can end up in libtinfo so
this library should be pulled in if it is found.

There is still an exotic case left where LLDB is configured with
-DLLDB_DISABLE_CURSES=NO and LLVM with -DLLVM_ENABLE_TERMINFO=NO but
misconfigurations will always be possible. Possibly a diagnostic could be added
for that.

This fixes bug 24693 (https://llvm.org/bugs/show_bug.cgi?id=24693).

http://reviews.llvm.org/D12672

Files:
  cmake/LLDBDependencies.cmake

Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,6 +146,11 @@
   endif()
   if (NOT LLDB_DISABLE_CURSES)
 list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+if(LLVM_ENABLE_TERMINFO)
+  if(HAVE_TERMINFO)
+ list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
+  endif(HAVE_TERMINFO)
+endif(LLVM_ENABLE_TERMINFO)
   endif()
 endif()
 # On FreeBSD backtrace() is provided by libexecinfo, not libc.


Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,6 +146,11 @@
   endif()
   if (NOT LLDB_DISABLE_CURSES)
 list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+if(LLVM_ENABLE_TERMINFO)
+  if(HAVE_TERMINFO)
+ list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
+  endif(HAVE_TERMINFO)
+endif(LLVM_ENABLE_TERMINFO)
   endif()
 endif()
 # On FreeBSD backtrace() is provided by libexecinfo, not libc.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12291: Add split dwarf support to SymbolFileDWARF

2015-09-07 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Plugins/SymbolFile/DWARF/DIERef.cpp:34-44
@@ +33,13 @@
+
+DIERef::DIERef(const DWARFFormValue& form_value) :
+cu_offset(DW_INVALID_OFFSET),
+die_offset(DW_INVALID_OFFSET)
+{
+if (form_value.IsValid())
+{
+if (form_value.GetCompileUnit())
+cu_offset = form_value.GetCompileUnit()->GetOffset();
+die_offset = form_value.Reference();
+}
+}
+

clayborg wrote:
> For DWO files, won't every compile unit have offset 0x000b? Or do you use 
> the actual compile unit DIE from the main executable?
> 
> I have doubts this will work for DWARF in .o files. We used to encode the 
> compile unit index in the upper 32 bits because all of our compile units have 
> a dw_offset_t that is 0xb..
The concept of DIERef is to contain the offset of the compile unit in the main 
object file so based on a DIERef and a SymbolFileDWARF fro the main object file 
we can find the compile unit and the DIE. In case of dsym it changes a bit with 
storing the symbol file index in the cu_offset filed instead.

I fixed the implementation to set it up properly in case of dwo files


Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1025-1036
@@ +1024,14 @@
+{
+if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value) 
||
+GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, 
form_value))
+{
+DWARFDIE die = 
const_cast(cu)->GetDIE(form_value.Reference());
+if (die)
+return die.GetDIE()->GetAttributeValue(die.GetDWARF(),
+   die.GetCU(),
+   attr,
+   form_value,
+   end_attr_offset_ptr,
+   false);
+}
+}

clayborg wrote:
> This will fail if a DIE can have both a DW_AT_specification and a 
> DW_AT_abstract_origin. Not sure if that can happen. If it can, we will need 
> to check each one individually. Probably best to just check both individually.
We haven't checked both of it previously either and I don't think we will ever 
have both a DW_AT_specification and a DW_AT_abstract_origin, but changed it to 
check both for just in case.


Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1039-1055
@@ -985,1 +1038,19 @@
+
+if (!dwo_symbol_file)
+return 0;
+
+DWARFCompileUnit* dwo_cu = dwo_symbol_file->GetCompileUnit();
+if (!dwo_cu)
+return 0;
+
+DWARFDIE dwo_cu_die = dwo_cu->GetCompileUnitDIEOnly();
+if (!dwo_cu_die.IsValid())
+return 0;
+
+return dwo_cu_die.GetDIE()->GetAttributeValue(dwo_symbol_file,
+  dwo_cu,
+  attr,
+  form_value,
+  end_attr_offset_ptr,
+  
check_specification_or_abstract_origin);
 }

clayborg wrote:
> Don't you want to only do all of this code if:
> ```
> if (Tag() == DW_TAG_compile_unit)
> ```
Yes I do.

The beginning of the function (line 987-995) handles the case for non 
DW_TAG_compile_unit with forwarding the query to the right compile unit and 
this part of the code is to handle the case when some data about the compile 
unit is in the main object file and some data is in the dwo file. This can't 
happen for any other DIE.


http://reviews.llvm.org/D12291



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


Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

2015-09-07 Thread Abhishek via lldb-commits
abhishek.aggarwal added inline comments.


Comment at: test/functionalities/register/TestRegisters.py:195
@@ +194,3 @@
+for x in range(0,16):
+self.runCmd ("si", RUN_SUCCEEDED)
+

labath wrote:
> First I would like to applaud for writing a test case for such a delicate 
> issue. I know it's not easy given the current test infrastructure.
> 
> However, this change seems very fragile and likely to break due to random 
> changes in clang implementation and/or command line flags. Even the gcc path 
> can break if the gcc happens to produce slightly different output. I would 
> like to avoid relying on hardcoded instruction counts.
> 
> How about we try something like this:
> - in the inline assembly, we prepend the code you want to test with "int3"
> - run the inferior normally. it should hit the debugger trap and stop (you 
> can verify that the stop reason is indeed sigtrap)
> - the next instruction should point precisely at the code you want to test, 
> without relying on any debug info or instruction counts
> - proceed with the test normally
> 
> what do you think?
Thanks for suggesting a nice way to fix it. I agree with you. I will make the 
changes.


http://reviews.llvm.org/D12677



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


Re: [Lldb-commits] [PATCH] D12677: Bug 24733: TestRegisters.py for Clang inferiors

2015-09-07 Thread Abhishek via lldb-commits
abhishek.aggarwal updated this revision to Diff 34161.
abhishek.aggarwal added a comment.

Clang/GCC generate different assembly for same inferior.

Changed a.cpp to remove dependency of TestRegisters.py on assembly
instructions generated by Clang/GCC.

Changed TestRegisters.py to write a generic test vector for testing
Bug 24457.


http://reviews.llvm.org/D12677

Files:
  test/functionalities/register/TestRegisters.py
  test/functionalities/register/a.cpp

Index: test/functionalities/register/a.cpp
===
--- test/functionalities/register/a.cpp
+++ test/functionalities/register/a.cpp
@@ -13,6 +13,7 @@
 {
 float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
 __asm__ (
+"int3 ;"
 "flds %1 ;"
 "flds %2 ;"
 "flds %3 ;"
Index: test/functionalities/register/TestRegisters.py
===
--- test/functionalities/register/TestRegisters.py
+++ test/functionalities/register/TestRegisters.py
@@ -36,7 +36,6 @@
 self.buildDefault()
 self.fp_register_write()
 
-@expectedFailureClang("llvm.org/pr24733")
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
@@ -168,15 +167,14 @@
 target = self.dbg.CreateTarget(exe)
 self.assertTrue(target, VALID_TARGET)
 
-# Find the line number to break inside a.cpp.
-self.line = line_number('a.cpp', '// Set break point at this line.')
-
-# Set breakpoint
-lldbutil.run_break_set_by_file_and_line (self, "a.cpp", self.line, 
num_expected_locations=1, loc_exact=True)
-
 # Launch the process, and do not stop at the entry point.
 self.runCmd ("run", RUN_SUCCEEDED)
 
+# Check stop reason; Should be SIGTRAP
+stop_reason = 'stop reason = signal SIGTRAP'
+self.expect("thread list", STOPPED_DUE_TO_SIGNAL,
+  substrs = ['stopped', stop_reason])
+
 process = target.GetProcess()
 self.assertTrue(process.GetState() == lldb.eStateStopped,
 PROCESS_STOPPED)


Index: test/functionalities/register/a.cpp
===
--- test/functionalities/register/a.cpp
+++ test/functionalities/register/a.cpp
@@ -13,6 +13,7 @@
 {
 float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0;
 __asm__ (
+"int3 ;"
 "flds %1 ;"
 "flds %2 ;"
 "flds %3 ;"
Index: test/functionalities/register/TestRegisters.py
===
--- test/functionalities/register/TestRegisters.py
+++ test/functionalities/register/TestRegisters.py
@@ -36,7 +36,6 @@
 self.buildDefault()
 self.fp_register_write()
 
-@expectedFailureClang("llvm.org/pr24733")
 def test_fp_special_purpose_register_read(self):
 """Test commands that read fpu special purpose registers."""
 if not self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
@@ -168,15 +167,14 @@
 target = self.dbg.CreateTarget(exe)
 self.assertTrue(target, VALID_TARGET)
 
-# Find the line number to break inside a.cpp.
-self.line = line_number('a.cpp', '// Set break point at this line.')
-
-# Set breakpoint
-lldbutil.run_break_set_by_file_and_line (self, "a.cpp", self.line, num_expected_locations=1, loc_exact=True)
-
 # Launch the process, and do not stop at the entry point.
 self.runCmd ("run", RUN_SUCCEEDED)
 
+# Check stop reason; Should be SIGTRAP
+stop_reason = 'stop reason = signal SIGTRAP'
+self.expect("thread list", STOPPED_DUE_TO_SIGNAL,
+  substrs = ['stopped', stop_reason])
+
 process = target.GetProcess()
 self.assertTrue(process.GetState() == lldb.eStateStopped,
 PROCESS_STOPPED)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-07 Thread Zachary Turner via lldb-commits
Adrian, can you verify this in the morning?  Basically just trying to
ensure that ninja check-lldb still works as it did before.  There's a
chance I'm going to be OOO tomorrow (or at the very best late) due to
something unexpected.

On Mon, Sep 7, 2015 at 9:38 PM Todd Fiala  wrote:

> tfiala added a comment.
>
> @zturner, at this point you should be able to run this and see no change
> on Windows (assuming I did the os check correctly).  The Windows test
> runner is set to be the previous multithreading-pool strategy.  For
> everyone else, they'll get the multithreading strategy by default that
> supports Ctrl-C.
>
> You can also check the threading-pool and the threading strategy to see if
> you get any speedup on Windows.  The only speed difference I saw was that
> the -pool versions were slower than the non-pool versions, but otherwise no
> wall-clock difference in the threading vs. multiprocessing versions.  I saw
> a slight (~1.4%) reduction in system time on the threading vs.
> multiprocessing, but that didn't translate to an overall speedup.  Also, it
> is more difficult to get the Ctrl-C behavior correct in the threading vs.
> multiprocessing scenario.  So unless there was a specific reason to want to
> use threading over multiprocessing (or the perf difference was measurable
> on some other OS), I'd stick with multiprocessing-based.
>
> On OS X there was at least one test that would hang each run, so I didn't
> get any kind of real timing numbers there since everything was always maxed
> out by the hanging test.  We'll definitely stick with multiprocessing there
> until we have some data that suggests a worthy reason for changing.
>
> I'd like to get this in as soon as this is working on your end, Zachary,
> as I have other changes backed up behind it.
>
> Thanks!
>
>
> http://reviews.llvm.org/D12651
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-07 Thread Zachary Turner via lldb-commits
zturner added a comment.

Adrian, can you verify this in the morning?  Basically just trying to
ensure that ninja check-lldb still works as it did before.  There's a
chance I'm going to be OOO tomorrow (or at the very best late) due to
something unexpected.


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12667: [cmake] Remove LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION.

2015-09-07 Thread Bruce Mitchener via lldb-commits
brucem added a comment.

zturner, was that an approval to land this?


http://reviews.llvm.org/D12667



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


Re: [Lldb-commits] [PATCH] D12667: [cmake] Remove LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION.

2015-09-07 Thread Zachary Turner via lldb-commits
Yes

On Mon, Sep 7, 2015 at 9:58 PM Bruce Mitchener 
wrote:

> brucem added a comment.
>
> zturner, was that an approval to land this?
>
>
> http://reviews.llvm.org/D12667
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

2015-09-07 Thread Todd Fiala via lldb-commits
tfiala added inline comments.


Comment at: source/Core/Debugger.cpp:426
@@ +425,3 @@
+for (const auto& debugger: debuggers)
+debugger->Clear();
+

ovyalov wrote:
> tfiala wrote:
> > Wouldn't Clear() be considered a mutating function?  So a const debugger 
> > ref seems like maybe it should be non-const?
> > 
> > i.e.
> > for (auto& debugger: debuggers) {
> >  debugger->Clear();
> > }
> > 
> Clear is mutable, but debugger has DebuggerSP type here - so, const is 
> applicable only to shared_ptr, not to Debugger instance itself.
Ah gotcha.


http://reviews.llvm.org/D12683



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


Re: [Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

2015-09-07 Thread Zachary Turner via lldb-commits
What were the symptoms of this?  How'd you find it?

On Mon, Sep 7, 2015 at 6:47 PM Oleksiy Vyalov via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> ovyalov created this revision.
> ovyalov added a reviewer: clayborg.
> ovyalov added a subscriber: lldb-commits.
>
> Python locks in memory a few global objects like
> lldb.debugger,lldb.target,...  - as a consequence, ~Debugger isn't called
> upon shutdown.
> Calling Debugger::Clear ensures that ScriptInterpreterPython::Clear is
> called to clean up Python global variables.
>
> http://reviews.llvm.org/D12683
>
> Files:
>   source/Core/Debugger.cpp
>
> Index: source/Core/Debugger.cpp
> ===
> --- source/Core/Debugger.cpp
> +++ source/Core/Debugger.cpp
> @@ -421,7 +421,11 @@
>
>  // Clear our master list of debugger objects
>  Mutex::Locker locker (GetDebuggerListMutex ());
> -GetDebuggerList().clear();
> +auto& debuggers = GetDebuggerList();
> +for (const auto& debugger: debuggers)
> +debugger->Clear();
> +
> +debuggers.clear();
>  }
>
>  void
>
>
> ___
> 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] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-07 Thread Todd Fiala via lldb-commits
tfiala added a comment.

@zturner, at this point you should be able to run this and see no change on 
Windows (assuming I did the os check correctly).  The Windows test runner is 
set to be the previous multithreading-pool strategy.  For everyone else, 
they'll get the multithreading strategy by default that supports Ctrl-C.

You can also check the threading-pool and the threading strategy to see if you 
get any speedup on Windows.  The only speed difference I saw was that the -pool 
versions were slower than the non-pool versions, but otherwise no wall-clock 
difference in the threading vs. multiprocessing versions.  I saw a slight 
(~1.4%) reduction in system time on the threading vs. multiprocessing, but that 
didn't translate to an overall speedup.  Also, it is more difficult to get the 
Ctrl-C behavior correct in the threading vs. multiprocessing scenario.  So 
unless there was a specific reason to want to use threading over 
multiprocessing (or the perf difference was measurable on some other OS), I'd 
stick with multiprocessing-based.

On OS X there was at least one test that would hang each run, so I didn't get 
any kind of real timing numbers there since everything was always maxed out by 
the hanging test.  We'll definitely stick with multiprocessing there until we 
have some data that suggests a worthy reason for changing.

I'd like to get this in as soon as this is working on your end, Zachary, as I 
have other changes backed up behind it.

Thanks!


http://reviews.llvm.org/D12651



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


Re: [Lldb-commits] [PATCH] D12651: Add ctrl-c support to parallel dotest.py.

2015-09-07 Thread Todd Fiala via lldb-commits
tfiala updated this revision to Diff 34186.
tfiala added a comment.

Adds "threading" test-runner strategy, which mirrors the "multithreading" 
runner in terms of supporting Ctrl-C and hand-rolling the worker model.  Like 
multiprocessing over multiprocessing-pool, threading outperforms threading-pool.

Both threading and multiprocessing operate at roughly the same speed (within 
10s of ms) on a 24 core Linux box.  Both these two test runners are 
substantially faster than the versions that use the Pool class --- the 
Pool-class versions are 20-25% slower than the hand-rolled worker pool 
versions, likely due to the more even on-demand scheduling and coarse grain and 
uneven nature of our tasks being run.


http://reviews.llvm.org/D12651

Files:
  test/dosep.py
  test/dotest.py
  test/dotest_args.py

Index: test/dotest_args.py
===
--- test/dotest_args.py
+++ test/dotest_args.py
@@ -128,11 +128,17 @@
 dest='num_threads',
 help=('The number of threads/processes to use when running tests '
   'separately, defaults to the number of CPU cores available'))
-parser.add_argument(
+group.add_argument(
 '--test-subdir',
 action='store',
 help='Specify a test subdirectory to use relative to the test root dir'
 )
+group.add_argument(
+'--test-runner-name',
+action='store',
+help=('Specify a test runner strategy.  Valid values: multiprocessing,'
+  ' multiprocessing-pool, serial, threading, threading-pool')
+)
 
 # Remove the reference to our helper function
 del X
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -249,6 +249,7 @@
 num_threads = None
 output_on_success = False
 no_multiprocess_test_runner = False
+test_runner_name = None
 
 def usage(parser):
 parser.print_help()
@@ -495,6 +496,7 @@
 global num_threads
 global output_on_success
 global no_multiprocess_test_runner
+global test_runner_name
 
 do_help = False
 
@@ -756,7 +758,8 @@
 if args.inferior:
 is_inferior_test_runner = True
 
-if args.output_on_success:
+# Turn on output_on_sucess if either explicitly added or -v specified.
+if args.output_on_success or args.v:
 output_on_success = True
 
 if args.num_threads:
@@ -765,6 +768,9 @@
 if args.test_subdir:
 multiprocess_test_subdir = args.test_subdir
 
+if args.test_runner_name:
+test_runner_name = args.test_runner_name
+
 if args.lldb_platform_name:
 lldb_platform_name = args.lldb_platform_name
 if args.lldb_platform_url:
@@ -1278,8 +1284,9 @@
 # multiprocess test runner here.
 if isMultiprocessTestRunner():
 import dosep
-dosep.main(output_on_success, num_threads, multiprocess_test_subdir)
-raise "should never get here"
+dosep.main(output_on_success, num_threads, multiprocess_test_subdir,
+   test_runner_name)
+raise Exception("should never get here")
 
 setupSysPath()
 setupCrashInfoHook()
Index: test/dosep.py
===
--- test/dosep.py
+++ test/dosep.py
@@ -32,14 +32,19 @@
 echo core.%p | sudo tee /proc/sys/kernel/core_pattern
 """
 
+import fnmatch
 import multiprocessing
+import multiprocessing.pool
 import os
-import fnmatch
 import platform
+import Queue
 import re
-import dotest_args
+import signal
 import subprocess
 import sys
+import threading
+
+import dotest_args
 
 from optparse import OptionParser
 
@@ -142,7 +147,7 @@
 return passes, failures, unexpected_successes
 
 
-def call_with_timeout(command, timeout, name):
+def call_with_timeout(command, timeout, name, inferior_pid_events):
 """Run command with a timeout if possible."""
 """-s QUIT will create a coredump if they are enabled on your system"""
 process = None
@@ -161,8 +166,14 @@
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+inferior_pid = process.pid
+if inferior_pid_events:
+inferior_pid_events.put_nowait(('created', inferior_pid))
 output = process.communicate()
 exit_status = process.returncode
+if inferior_pid_events:
+inferior_pid_events.put_nowait(('destroyed', inferior_pid))
+
 passes, failures, unexpected_successes = parse_test_results(output)
 if exit_status == 0:
 # stdout does not have any useful information from 'dotest.py',
@@ -173,7 +184,7 @@
 return name, exit_status, passes, failures, unexpected_successes
 
 
-def process_dir(root, files, test_root, dotest_argv):
+def process_dir(root, files, test_root, dotest_argv, inferior_pid_events):
 """Examine a directory for tests, and invoke any found within it."""
 results = []

[Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

2015-09-07 Thread Oleksiy Vyalov via lldb-commits
ovyalov created this revision.
ovyalov added a reviewer: clayborg.
ovyalov added a subscriber: lldb-commits.

Python locks in memory a few global objects like lldb.debugger,lldb.target,...  
- as a consequence, ~Debugger isn't called upon shutdown.
Calling Debugger::Clear ensures that ScriptInterpreterPython::Clear is called 
to clean up Python global variables. 

http://reviews.llvm.org/D12683

Files:
  source/Core/Debugger.cpp

Index: source/Core/Debugger.cpp
===
--- source/Core/Debugger.cpp
+++ source/Core/Debugger.cpp
@@ -421,7 +421,11 @@
 
 // Clear our master list of debugger objects
 Mutex::Locker locker (GetDebuggerListMutex ());
-GetDebuggerList().clear();
+auto& debuggers = GetDebuggerList();
+for (const auto& debugger: debuggers)
+debugger->Clear();
+
+debuggers.clear();
 }
 
 void


Index: source/Core/Debugger.cpp
===
--- source/Core/Debugger.cpp
+++ source/Core/Debugger.cpp
@@ -421,7 +421,11 @@
 
 // Clear our master list of debugger objects
 Mutex::Locker locker (GetDebuggerListMutex ());
-GetDebuggerList().clear();
+auto& debuggers = GetDebuggerList();
+for (const auto& debugger: debuggers)
+debugger->Clear();
+
+debuggers.clear();
 }
 
 void
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12683: Fix debugger shutdown when Python interpreter is loaded

2015-09-07 Thread Oleksiy Vyalov via lldb-commits
ovyalov added inline comments.


Comment at: source/Core/Debugger.cpp:426
@@ +425,3 @@
+for (const auto& debugger: debuggers)
+debugger->Clear();
+

tfiala wrote:
> Wouldn't Clear() be considered a mutating function?  So a const debugger ref 
> seems like maybe it should be non-const?
> 
> i.e.
> for (auto& debugger: debuggers) {
>  debugger->Clear();
> }
> 
Clear is mutable, but debugger has DebuggerSP type here - so, const is 
applicable only to shared_ptr, not to Debugger instance itself.


http://reviews.llvm.org/D12683



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


Re: [Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-07 Thread Zachary Turner via lldb-commits
zturner added a comment.

Looks fine, do you have commit access?  If so feel free to commit
whenever.  Otherwise I can do it for you tomorrow


http://reviews.llvm.org/D12672



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


Re: [Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-07 Thread Zachary Turner via lldb-commits
Looks fine, do you have commit access?  If so feel free to commit
whenever.  Otherwise I can do it for you tomorrow

On Mon, Sep 7, 2015 at 1:15 PM Jeremi Piotrowski <
jeremi.piotrow...@gmail.com> wrote:

> jeremi.piotrowski updated this revision to Diff 34169.
> jeremi.piotrowski added a comment.
>
> - combine nested if conditions with `and` as suggested by zturner
>
>   and remove condtition from `endif` as that seems to be the convention.
>
>
> http://reviews.llvm.org/D12672
>
> Files:
>   cmake/LLDBDependencies.cmake
>
> Index: cmake/LLDBDependencies.cmake
> ===
> --- cmake/LLDBDependencies.cmake
> +++ cmake/LLDBDependencies.cmake
> @@ -146,6 +146,9 @@
>endif()
>if (NOT LLDB_DISABLE_CURSES)
>  list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
> +if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
> +  list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
> +endif()
>endif()
>  endif()
>  # On FreeBSD backtrace() is provided by libexecinfo, not libc.
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-07 Thread Jeremi Piotrowski via lldb-commits
jeremi.piotrowski updated this revision to Diff 34169.
jeremi.piotrowski added a comment.

- combine nested if conditions with `and` as suggested by zturner

  and remove condtition from `endif` as that seems to be the convention.


http://reviews.llvm.org/D12672

Files:
  cmake/LLDBDependencies.cmake

Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,6 +146,9 @@
   endif()
   if (NOT LLDB_DISABLE_CURSES)
 list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
+  list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
+endif()
   endif()
 endif()
 # On FreeBSD backtrace() is provided by libexecinfo, not libc.


Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,6 +146,9 @@
   endif()
   if (NOT LLDB_DISABLE_CURSES)
 list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
+  list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
+endif()
   endif()
 endif()
 # On FreeBSD backtrace() is provided by libexecinfo, not libc.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12671: [LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.

2015-09-07 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, ovyalov.
nitesh.jain added subscribers: jaydeep, bhushan, sagar, mohit.bhakkad, 
lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D12671

Files:
  source/Core/ArchSpec.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1517,8 +1517,8 @@
  I != section_headers.end(); ++I)
 {
 static ConstString g_sect_name_gnu_debuglink 
(".gnu_debuglink");
-const ELFSectionHeaderInfo  = *I;
-const uint64_t section_size = header.sh_type == SHT_NOBITS ? 0 
: header.sh_size;
+const ELFSectionHeaderInfo  = *I;
+const uint64_t section_size = sheader.sh_type == SHT_NOBITS ? 
0 : sheader.sh_size;
 ConstString name(shstr_data.PeekCStr(I->sh_name));
 
 I->section_name = name;
@@ -1526,23 +1526,33 @@
 if (arch_spec.GetMachine() == llvm::Triple::mips || 
arch_spec.GetMachine() == llvm::Triple::mipsel
 || arch_spec.GetMachine() == llvm::Triple::mips64 || 
arch_spec.GetMachine() == llvm::Triple::mips64el)
 {
-if (header.sh_type == SHT_MIPS_ABIFLAGS)
+uint32_t arch_flags = arch_spec.GetFlags ();
+DataExtractor data;
+if (sheader.sh_type == SHT_MIPS_ABIFLAGS)
 {
-DataExtractor data;
-if (section_size && (data.SetData (object_data, 
header.sh_offset, section_size) == section_size))
+
+if (section_size && (data.SetData (object_data, 
sheader.sh_offset, section_size) == section_size))
 {
 lldb::offset_t ase_offset = 12; // MIPS ABI Flags 
Version: 0
-uint32_t arch_flags = arch_spec.GetFlags ();
 arch_flags |= data.GetU32 (_offset);
-arch_spec.SetFlags (arch_flags);
 }
 }
+// Settings appropriate ArchSpec ABI Flags
+if (header.e_flags & llvm::ELF::EF_MIPS_ABI2)
+{   
+arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
+}
+else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32)
+{
+ arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;   

+}
+arch_spec.SetFlags (arch_flags);
 }
 
 if (name == g_sect_name_gnu_debuglink)
 {
 DataExtractor data;
-if (section_size && (data.SetData (object_data, 
header.sh_offset, section_size) == section_size))
+if (section_size && (data.SetData (object_data, 
sheader.sh_offset, section_size) == section_size))
 {
 lldb::offset_t gnu_debuglink_offset = 0;
 gnu_debuglink_file = data.GetCStr 
(_debuglink_offset);
@@ -1552,7 +1562,7 @@
 }
 
 // Process ELF note section entries.
-bool is_note_header = (header.sh_type == SHT_NOTE);
+bool is_note_header = (sheader.sh_type == SHT_NOTE);
 
 // The section header ".note.android.ident" is stored as a
 // PROGBITS type header but it is actually a note header.
@@ -1564,7 +1574,7 @@
 {
 // Allow notes to refine module info.
 DataExtractor data;
-if (section_size && (data.SetData (object_data, 
header.sh_offset, section_size) == section_size))
+if (section_size && (data.SetData (object_data, 
sheader.sh_offset, section_size) == section_size))
 {
 Error error = RefineModuleDetailsFromNote (data, 
arch_spec, uuid);
 if (error.Fail ())
Index: source/Core/ArchSpec.cpp
===
--- source/Core/ArchSpec.cpp
+++ source/Core/ArchSpec.cpp
@@ -602,7 +602,15 @@
 {
 const CoreDefinition *core_def = FindCoreDefinition (m_core);
 if (core_def)
-return core_def->addr_byte_size;
+{ 
+   if (core_def->machine == llvm::Triple::mips64 || core_def->machine == 
llvm::Triple::mips64el)
+   {  
+  // For N32/O32 applications Address size is 4 bytes.
+  if (m_flags & (eMIPSABI_N32 | eMIPSABI_O32))
+  return 4;
+   }
+ 

Re: [Lldb-commits] [PATCH] D12672: add a dependency on terminfo library if llvm uses it

2015-09-07 Thread Zachary Turner via lldb-commits
zturner added a subscriber: zturner.
zturner added a comment.

Looks fine to me, but as a nitpick, I would suggest combining the nested if
into a single if with an AND clause.


http://reviews.llvm.org/D12672



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