[Lldb-commits] [PATCH] D16046: [LLDB][MIPS] Handle PIC calling convention for MIPS64

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

The PIC calling convention for MIPS requires that on entry to a function, 
register r25 (t9) holds the address of the function’s entry point.
This patch sets up register r25 with the address of function to be called in 
PrepareTrivialCall().

Repository:
  rL LLVM

http://reviews.llvm.org/D16046

Files:
  source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp

Index: source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
===
--- source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
+++ source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
@@ -206,6 +206,7 @@
 const RegisterInfo *pc_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
 const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
 const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
+const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
 
 if (log)
 log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
@@ -228,6 +229,13 @@
 if (!reg_ctx->WriteRegisterFromUnsigned (pc_reg_info, func_addr))
 return false;
 
+if (log)
+log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
+
+// All callers of position independent functions must place the address of 
the called function in t9 (r25)
+if (!reg_ctx->WriteRegisterFromUnsigned (r25_info, func_addr))
+return false;
+
 return true;
 }
 


Index: source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
===
--- source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
+++ source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
@@ -206,6 +206,7 @@
 const RegisterInfo *pc_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
 const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
 const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
+const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
 
 if (log)
 log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
@@ -228,6 +229,13 @@
 if (!reg_ctx->WriteRegisterFromUnsigned (pc_reg_info, func_addr))
 return false;
 
+if (log)
+log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
+
+// All callers of position independent functions must place the address of the called function in t9 (r25)
+if (!reg_ctx->WriteRegisterFromUnsigned (r25_info, func_addr))
+return false;
+
 return true;
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

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

Repository:
  rL LLVM

http://reviews.llvm.org/D16049

Files:
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2442,18 +2442,18 @@
 SymbolContext sc;
 uint32_t resolve_scope = eSymbolContextFunction | 
eSymbolContextSymbol;
 temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, 
resolve_scope, sc);
+Address sym_addr;
 if (sc.function)
-{
-function_start = 
sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
-if (function_start == LLDB_INVALID_ADDRESS)
-function_start = 
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
-}
+sym_addr = sc.function->GetAddressRange().GetBaseAddress();
 else if (sc.symbol)
-{
-Address sym_addr = sc.symbol->GetAddress();
+sym_addr = sc.symbol->GetAddress();
+
+function_start = sym_addr.GetLoadAddress(this);
+if (function_start == LLDB_INVALID_ADDRESS)
 function_start = sym_addr.GetFileAddress();
-}
-current_offset = addr - function_start;
+
+if (function_start)
+current_offset = addr - function_start;
 }
 
 // If breakpoint address is start of function then we dont have to do 
anything.


Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2442,18 +2442,18 @@
 SymbolContext sc;
 uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
 temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc);
+Address sym_addr;
 if (sc.function)
-{
-function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
-if (function_start == LLDB_INVALID_ADDRESS)
-function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
-}
+sym_addr = sc.function->GetAddressRange().GetBaseAddress();
 else if (sc.symbol)
-{
-Address sym_addr = sc.symbol->GetAddress();
+sym_addr = sc.symbol->GetAddress();
+
+function_start = sym_addr.GetLoadAddress(this);
+if (function_start == LLDB_INVALID_ADDRESS)
 function_start = sym_addr.GetFileAddress();
-}
-current_offset = addr - function_start;
+
+if (function_start)
+current_offset = addr - function_start;
 }
 
 // If breakpoint address is start of function then we dont have to do anything.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-01-11 Thread Bhushan Attarde via lldb-commits
bhushan added a comment.

Summary:

Get the load address for the address given by 'symbol' and 'function'.
Earlier, this was done for 'function' only, this patch does it for 'symbol' too.


Repository:
  rL LLVM

http://reviews.llvm.org/D16049



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


[Lldb-commits] [PATCH] D16051: [LLDB][MIPS] Merge emulation of similar instructions for MIPS64

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

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

Repository:
  rL LLVM

http://reviews.llvm.org/D16051

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

Re: [Lldb-commits] [PATCH] D15533: Make the aarch64 lldb-server capable of debugging arm32 applications

2016-01-11 Thread Muhammad Omair Javaid via lldb-commits
omjavaid added a subscriber: omjavaid.
omjavaid added a comment.

LGTM.

I think we should submit this patch as tberghammer explained.


http://reviews.llvm.org/D15533



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


Re: [Lldb-commits] [PATCH] D15992: Centralize the handling of attach permissions on linux in tests

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

Good idea. I'll do that.


http://reviews.llvm.org/D15992



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


Re: [Lldb-commits] [PATCH] D15992: Centralize the handling of attach permissions on linux in tests

2016-01-11 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257319: Centralize the handling of attach permissions on 
linux in tests (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D15992?vs=44316&id=44453#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15992

Files:
  lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
  lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/main.cpp
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/main.c
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/main.cpp
  lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
  lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp

Index: lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
===
--- lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
+++ lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
@@ -157,3 +157,10 @@
  then use SBInterpreter::HandleCommand to run the command.  You get the full result text 
  from the command in the command return object, and all the part where you are driving the 
  debugger to the point you want to test will be more robust.
+
+o Attaching in test cases:
+
+ If you need to attach to inferiors in your tests, you must make sure the inferior calls
+ lldb_enable_attach(), before the debugger attempts to attach. This function performs any
+ platform-specific processing needed to enable attaching to this process (e.g., on Linux, we
+ execute prctl(PR_SET_TRACER) syscall to disable protections present in some Linux systems).
Index: lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
===
--- lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
+++ lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
@@ -17,3 +17,28 @@
 // declared.  This may not be necessary after MSVC 12.
 #include 
 #endif
+
+
+// On some systems (e.g., some versions of linux) it is not possible to attach to a process
+// without it giving us special permissions. This defines the lldb_enable_attach macro, which
+// should perform any such actions, if needed by the platform. This is a macro instead of a
+// function to avoid the need for complex linking of the test programs.
+#if defined(__linux__)
+#include 
+
+#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
+// For now we execute on best effort basis.  If this fails for some reason, so be it.
+#define lldb_enable_attach()  \
+do\
+{ \
+const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);  \
+(void)prctl_result;   \
+} while (0)
+
+#endif
+
+#else // not linux
+
+#define lldb_enable_attach()
+
+#endif
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/main.c
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/main.c
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/main.c
@@ -2,10 +2,6 @@
 #include 
 #include 
 
-#if defined(__linux__)
-#include 
-#endif
-
 volatile int release_child_flag = 0;
 
 int main(int argc, char const *argv[])
@@ -61,18 +57,7 @@
 }
 else
 { // child
-#if defined(__linux__)
-// Immediately enable any ptracer so that we can allow the stub attach
-// operation to succeed.  Some Linux kernels are locked down so that
-// only an ancestor process can be a ptracer of a process.  This disables that
-// restriction.  Without it, attach-related stub tests will fail.
-#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
-// For now we execute on best effort basis.  If this fails for
-// some reason, so be it.
-const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
-(void) prctl_result;
-#endif
-#endif
+lldb_enable_attach();
 
 while (! release_child_flag) // Wait for debugger to attach
 sleep(1);
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resum

[Lldb-commits] [lldb] r257319 - Centralize the handling of attach permissions on linux in tests

2016-01-11 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 11 04:24:50 2016
New Revision: 257319

URL: http://llvm.org/viewvc/llvm-project?rev=257319&view=rev
Log:
Centralize the handling of attach permissions on linux in tests

Summary:
On linux we need the process to give us special permissions before we can 
attach to it.
Previously, the code for this was copied into every file that needed it. This 
moves the code to a
central place to reduce code duplication.

Reviewers: clayborg

Subscribers: lldb-commits

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/main.c
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/main.cpp
lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite?rev=257319&r1=257318&r2=257319&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite Mon Jan 11 
04:24:50 2016
@@ -157,3 +157,10 @@ o Writing test cases:
  then use SBInterpreter::HandleCommand to run the command.  You get the full 
result text 
  from the command in the command return object, and all the part where you are 
driving the 
  debugger to the point you want to test will be more robust.
+
+o Attaching in test cases:
+
+ If you need to attach to inferiors in your tests, you must make sure the 
inferior calls
+ lldb_enable_attach(), before the debugger attempts to attach. This function 
performs any
+ platform-specific processing needed to enable attaching to this process 
(e.g., on Linux, we
+ execute prctl(PR_SET_TRACER) syscall to disable protections present in some 
Linux systems).

Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c?rev=257319&r1=257318&r2=257319&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c Mon Jan 
11 04:24:50 2016
@@ -2,25 +2,10 @@
 #include 
 #include 
 
-#if defined(__linux__)
-#include 
-#endif
-
 int 
 main (int argc, char **argv)
 {
-#if defined(__linux__)
-// Immediately enable any ptracer so that we can allow the stub attach
-// operation to succeed.  Some Linux kernels are locked down so that
-// only an ancestor process can be a ptracer of a process.  This 
disables that
-// restriction.  Without it, attach-related stub tests will fail.
-#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
-// For now we execute on best effort basis.  If this fails for
-// some reason, so be it.
-const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 
0, 0);
-(void) prctl_result;
-#endif
-#endif
+lldb_enable_attach();
 
 int do_crash = 0;
 int do_wait = 0;

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp?rev=257319&r1=257318&r2=257319&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp
 Mon Jan 11 04:24:50 2016
@@ -4,10 +4,6 @@
 #include 
 #include 
 
-#if defined(__linux__)
-#include 
-#endif
-
 volatile bool debugger_flag = true; // The debugger will flip this to false
 
 void *start(void *data)
@@ -25,18 +21,7 @@ void *start(void *data)
 
 int main(int argc, char const *argv[])
 {
-#if defined(__linux__)
-// Immediately enable any ptracer so that we can allow the stub attach
-// operation to succeed.  Some Linux kernels are locked down so that
-// only an ancestor process can be a ptracer of a process.  This disables 
that
-// restriction.  Without it, attach-related stub tests will fail.
-#if defined(PR_SET_PTRACE

[Lldb-commits] [lldb] r257321 - Remove CRLF line endings from test_common.h

2016-01-11 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 11 04:27:31 2016
New Revision: 257321

URL: http://llvm.org/viewvc/llvm-project?rev=257321&view=rev
Log:
Remove CRLF line endings from test_common.h

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h?rev=257321&r1=257320&r2=257321&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h Mon Jan 11 
04:27:31 2016
@@ -1,44 +1,44 @@
-// This header is included in all the test programs (C and C++) and provides a
-// hook for dealing with platform-specifics.
-#if defined(_WIN32) || defined(_WIN64)
-#ifdef COMPILING_LLDB_TEST_DLL
-#define LLDB_TEST_API __declspec(dllexport)
-#else
-#define LLDB_TEST_API __declspec(dllimport)
-#endif
-#else
-#define LLDB_TEST_API
-#endif
-
-#if defined(__cplusplus) && defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
-// Compiling MSVC libraries with _HAS_EXCEPTIONS=0, eliminates most but not all
-// calls to __uncaught_exception.  Unfortunately, it does seem to eliminate
-// the delcaration of __uncaught_excpeiton.  Including  ensures that it 
is
-// declared.  This may not be necessary after MSVC 12.
-#include 
-#endif
-
-
-// On some systems (e.g., some versions of linux) it is not possible to attach 
to a process
-// without it giving us special permissions. This defines the 
lldb_enable_attach macro, which
-// should perform any such actions, if needed by the platform. This is a macro 
instead of a
-// function to avoid the need for complex linking of the test programs.
-#if defined(__linux__)
-#include 
-
-#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
-// For now we execute on best effort basis.  If this fails for some reason, so 
be it.
-#define lldb_enable_attach()   
   \
-do 
   \
-{  
   \
-const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 
0, 0);  \
-(void)prctl_result;
   \
-} while (0)
-
-#endif
-
-#else // not linux
-
-#define lldb_enable_attach()
-
-#endif
+// This header is included in all the test programs (C and C++) and provides a
+// hook for dealing with platform-specifics.
+#if defined(_WIN32) || defined(_WIN64)
+#ifdef COMPILING_LLDB_TEST_DLL
+#define LLDB_TEST_API __declspec(dllexport)
+#else
+#define LLDB_TEST_API __declspec(dllimport)
+#endif
+#else
+#define LLDB_TEST_API
+#endif
+
+#if defined(__cplusplus) && defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
+// Compiling MSVC libraries with _HAS_EXCEPTIONS=0, eliminates most but not all
+// calls to __uncaught_exception.  Unfortunately, it does seem to eliminate
+// the delcaration of __uncaught_excpeiton.  Including  ensures that it 
is
+// declared.  This may not be necessary after MSVC 12.
+#include 
+#endif
+
+
+// On some systems (e.g., some versions of linux) it is not possible to attach 
to a process
+// without it giving us special permissions. This defines the 
lldb_enable_attach macro, which
+// should perform any such actions, if needed by the platform. This is a macro 
instead of a
+// function to avoid the need for complex linking of the test programs.
+#if defined(__linux__)
+#include 
+
+#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
+// For now we execute on best effort basis.  If this fails for some reason, so 
be it.
+#define lldb_enable_attach()   
   \
+do 
   \
+{  
   \
+const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 
0, 0);  \
+(void)prctl_result;
   \
+} while (0)
+
+#endif
+
+#else // not linux
+
+#define lldb_enable_attach()
+
+#endif


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


[Lldb-commits] [lldb] r257322 - Make the aarch64 lldb-server capable of debugging arm32 applications

2016-01-11 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jan 11 04:39:09 2016
New Revision: 257322

URL: http://llvm.org/viewvc/llvm-project?rev=257322&view=rev
Log:
Make the aarch64 lldb-server capable of debugging arm32 applications

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

Modified:
lldb/trunk/source/Host/common/HostInfoBase.cpp
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

Modified: lldb/trunk/source/Host/common/HostInfoBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostInfoBase.cpp?rev=257322&r1=257321&r2=257322&view=diff
==
--- lldb/trunk/source/Host/common/HostInfoBase.cpp (original)
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp Mon Jan 11 04:39:09 2016
@@ -409,13 +409,13 @@ HostInfoBase::ComputeHostArchitectureSup
 arch_32.SetTriple(triple);
 break;
 
+case llvm::Triple::aarch64:
 case llvm::Triple::ppc64:
 case llvm::Triple::x86_64:
 arch_64.SetTriple(triple);
 arch_32.SetTriple(triple.get32BitArchVariant());
 break;
 
-case llvm::Triple::aarch64:
 case llvm::Triple::mips64:
 case llvm::Triple::mips64el:
 case llvm::Triple::sparcv9:

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=257322&r1=257321&r2=257322&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
Mon Jan 11 04:39:09 2016
@@ -7,7 +7,7 @@
 //
 
//===--===//
 
-#if defined(__arm__)
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
 
 #include "NativeRegisterContextLinux_arm.h"
 
@@ -16,8 +16,12 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/RegisterValue.h"
 
+#include "Plugins/Process/Linux/Procfs.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_arm.h"
 
+#include 
+#include 
+
 #define REG_CONTEXT_SIZE (GetGPRSize() + sizeof (m_fpr))
 
 #ifndef PTRACE_GETVFPREGS
@@ -169,6 +173,8 @@ g_reg_sets_arm[k_num_register_sets] =
 { "Floating Point Registers",   "fpu", k_num_fpr_registers_arm, 
g_fpu_regnums_arm }
 };
 
+#if defined(__arm__)
+
 NativeRegisterContextLinux*
 NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const 
ArchSpec& target_arch,
  
NativeThreadProtocol &native_thread,
@@ -177,6 +183,8 @@ NativeRegisterContextLinux::CreateHostNa
 return new NativeRegisterContextLinux_arm(target_arch, native_thread, 
concrete_frame_idx);
 }
 
+#endif // defined(__arm__)
+
 NativeRegisterContextLinux_arm::NativeRegisterContextLinux_arm (const 
ArchSpec& target_arch,
 
NativeThreadProtocol &native_thread,
 uint32_t 
concrete_frame_idx) :
@@ -919,14 +927,14 @@ NativeRegisterContextLinux_arm::WriteHar
 ctrl_buf = &m_hwp_regs[hwb_index].control;
 
 error = NativeProcessLinux::PtraceWrapper(PTRACE_SETHBPREGS,
-m_thread.GetID(), (PTRACE_TYPE_ARG3) -((hwb_index << 1) + 1),
+m_thread.GetID(), (PTRACE_TYPE_ARG3)(intptr_t) -((hwb_index << 
1) + 1),
 addr_buf, sizeof(unsigned int));
 
 if (error.Fail())
 return error;
 
 error = NativeProcessLinux::PtraceWrapper(PTRACE_SETHBPREGS,
-m_thread.GetID(), (PTRACE_TYPE_ARG3) -((hwb_index << 1) + 2),
+m_thread.GetID(), (PTRACE_TYPE_ARG3)(intptr_t) -((hwb_index << 
1) + 2),
 ctrl_buf, sizeof(unsigned int));
 }
 else
@@ -935,14 +943,14 @@ NativeRegisterContextLinux_arm::WriteHar
 ctrl_buf = &m_hwp_regs[hwb_index].control;
 
 error = NativeProcessLinux::PtraceWrapper(PTRACE_SETHBPREGS,
-m_thread.GetID(), (PTRACE_TYPE_ARG3) ((hwb_index << 1) + 1),
+m_thread.GetID(), (PTRACE_TYPE_ARG3)(intptr_t) ((hwb_index << 
1) + 1),
 addr_buf, sizeof(unsigned int));
 
 if (error.Fail())
 return error;
 
 error = NativeProcessLinux::PtraceWrapper(PTRACE_SETHBPREGS,
-m_thread.GetID(), (PTRACE_TYPE_ARG3) ((hwb_index << 1) + 2),
+m_thread.GetID(), (PTRACE_TYPE_ARG3)(intptr_t) ((hwb_index << 
1) + 2),
 ctrl_buf, sizeof(unsigned int));
 
 }
@@ -957,11 +965,33 @@ NativeRegist

Re: [Lldb-commits] [PATCH] D15533: Make the aarch64 lldb-server capable of debugging arm32 applications

2016-01-11 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257322: Make the aarch64 lldb-server capable of debugging 
arm32 applications (authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D15533?vs=42987&id=44454#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15533

Files:
  lldb/trunk/source/Host/common/HostInfoBase.cpp
  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

Index: lldb/trunk/source/Host/common/HostInfoBase.cpp
===
--- lldb/trunk/source/Host/common/HostInfoBase.cpp
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp
@@ -409,13 +409,13 @@
 arch_32.SetTriple(triple);
 break;
 
+case llvm::Triple::aarch64:
 case llvm::Triple::ppc64:
 case llvm::Triple::x86_64:
 arch_64.SetTriple(triple);
 arch_32.SetTriple(triple.get32BitArchVariant());
 break;
 
-case llvm::Triple::aarch64:
 case llvm::Triple::mips64:
 case llvm::Triple::mips64el:
 case llvm::Triple::sparcv9:
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
@@ -9,6 +9,7 @@
 
 #if defined (__arm64__) || defined (__aarch64__)
 
+#include "NativeRegisterContextLinux_arm.h"
 #include "NativeRegisterContextLinux_arm64.h"
 
 // C Includes
@@ -23,6 +24,7 @@
 
 #include "Plugins/Process/Linux/NativeProcessLinux.h"
 #include "Plugins/Process/Linux/Procfs.h"
+#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_arm64.h"
 
 // System includes - They have to be included after framework includes because they define some
@@ -142,7 +144,19 @@
  NativeThreadProtocol &native_thread,
  uint32_t concrete_frame_idx)
 {
-return new NativeRegisterContextLinux_arm64(target_arch, native_thread, concrete_frame_idx);
+Log *log  = ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_REGISTERS);
+switch (target_arch.GetMachine())
+{
+case llvm::Triple::arm:
+return new NativeRegisterContextLinux_arm(target_arch, native_thread, concrete_frame_idx);
+case llvm::Triple::aarch64:
+return new NativeRegisterContextLinux_arm64(target_arch, native_thread, concrete_frame_idx);
+default:
+if (log)
+log->Printf("NativeRegisterContextLinux::%s() have no register context for architecture: %s\n", __FUNCTION__,
+target_arch.GetTriple().getArchName().str().c_str());
+return nullptr;
+}
 }
 
 NativeRegisterContextLinux_arm64::NativeRegisterContextLinux_arm64 (const ArchSpec& target_arch,
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
@@ -7,7 +7,7 @@
 //
 //===--===//
 
-#if defined(__arm__) // arm register context only needed on arm devices
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
 
 #ifndef lldb_NativeRegisterContextLinux_arm_h
 #define lldb_NativeRegisterContextLinux_arm_h
@@ -91,11 +91,23 @@
 
 protected:
 Error
+DoReadRegisterValue(uint32_t offset,
+const char* reg_name,
+uint32_t size,
+RegisterValue &value) override;
+
+Error
 DoWriteRegisterValue(uint32_t offset,
  const char* reg_name,
  const RegisterValue &value) override;
 
 Error
+DoReadGPR(void *buf, size_t buf_size) override;
+
+Error
+DoWriteGPR(void *buf, size_t buf_size) override;
+
+Error
 DoReadFPR(void *buf, size_t buf_size) override;
 
 Error
@@ -182,4 +194,4 @@
 
 #endif // #ifndef lldb_NativeRegisterContextLinux_arm_h
 
-#endif // defined(__arm__)
+#endif // defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ lldb/tr

[Lldb-commits] [PATCH] D16055: Add clang::Type::Pipe to ClangASTContext

2016-01-11 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added a reviewer: clayborg.
labath added a subscriber: lldb-commits.

Clang recently added support for an OpenCL pipe type. Adding the new type to 
relevant switches to
avoid warnings.

http://reviews.llvm.org/D16055

Files:
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -4158,6 +4158,7 @@
 case clang::Type::Decltype: break;
 case clang::Type::TemplateSpecialization:   break;
 case clang::Type::Atomic:   break;
+case clang::Type::Pipe: break;
 
 // pointer type decayed from an array or function type.
 case clang::Type::Decayed:  break;
@@ -4891,6 +4892,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
@@ -5008,6 +5010,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.


Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -4158,6 +4158,7 @@
 case clang::Type::Decltype: break;
 case clang::Type::TemplateSpecialization:   break;
 case clang::Type::Atomic:   break;
+case clang::Type::Pipe: break;
 
 // pointer type decayed from an array or function type.
 case clang::Type::Decayed:  break;
@@ -4891,6 +4892,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
@@ -5008,6 +5010,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257323 - Skip TestEvents on linux completely

2016-01-11 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 11 04:55:57 2016
New Revision: 257323

URL: http://llvm.org/viewvc/llvm-project?rev=257323&view=rev
Log:
Skip TestEvents on linux completely

The test hangs/crashes/fails because it does not use the listener API in a way 
that LLDB expects.
I don't really know if this is the fault of LLDB of the test...

Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=257323&r1=257322&r2=257323&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Mon Jan 11 04:55:57 2016
@@ -13,6 +13,7 @@ import lldbsuite.test.lldbutil as lldbut
 from lldbsuite.test.lldbtest import *
 
 @skipIfDarwin  # llvm.org/pr25924, sometimes generating SIGSEGV
+@skipIfLinux   # llvm.org/pr25924, sometimes generating SIGSEGV
 class EventAPITestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
@@ -25,7 +26,6 @@ class EventAPITestCase(TestBase):
 
 @add_test_categories(['pyapi'])
 @expectedFailureLinux("llvm.org/pr23730") # Flaky, fails ~1/10 cases
-@skipIfLinux # skip to avoid crashes
 def test_listen_for_and_print_event(self):
 """Exercise SBEvent API."""
 self.build()


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


[Lldb-commits] [lldb] r257329 - Mark TestChangeValueAPI as flaky on linux (pr25652)

2016-01-11 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 11 05:59:38 2016
New Revision: 257329

URL: http://llvm.org/viewvc/llvm-project?rev=257329&view=rev
Log:
Mark TestChangeValueAPI as flaky on linux (pr25652)

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py?rev=257329&r1=257328&r2=257329&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
 Mon Jan 11 05:59:38 2016
@@ -28,6 +28,7 @@ class ChangeValueAPITestCase(TestBase):
 
 @expectedFailureWindows("llvm.org/pr24772")
 @add_test_categories(['pyapi'])
+@expectedFlakeyLinux("llvm.org/pr25652")
 def test_change_value(self):
 """Exercise the SBValue::SetValueFromCString API."""
 d = {'EXE': self.exe_name}


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


Re: [Lldb-commits] [PATCH] D15046: Fix for TestNoreturnUnwind.py on i386

2016-01-11 Thread Ravitheja Addepally via lldb-commits
ravitheja added a comment.

Hello, Any updates on this differential ?


http://reviews.llvm.org/D15046



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


[Lldb-commits] [lldb] r257335 - Don't try to parse the line table when it isn't specified

2016-01-11 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jan 11 08:56:05 2016
New Revision: 257335

URL: http://llvm.org/viewvc/llvm-project?rev=257335&view=rev
Log:
Don't try to parse the line table when it isn't specified

Previously we tried to parse the line table even if a compile unit
had no DW_AT_stmt_list atribute. The problem happens when a compiler
generates debug info for a compile unit but doesn't generate any line
info.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=257335&r1=257334&r2=257335&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jan 11 
08:56:05 2016
@@ -1065,12 +1065,17 @@ SymbolFileDWARF::ParseCompileUnitSupport
 const char * cu_comp_dir = 
resolveCompDir(cu_die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr));
 
 const dw_offset_t stmt_list = 
cu_die.GetAttributeValueAsUnsigned(DW_AT_stmt_list, DW_INVALID_OFFSET);
-
-// All file indexes in DWARF are one based and a file of index 
zero is
-// supposed to be the compile unit itself.
-support_files.Append (*sc.comp_unit);
-
-return 
DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), 
get_debug_line_data(), cu_comp_dir, stmt_list, support_files);
+if (stmt_list != DW_INVALID_OFFSET)
+{
+// All file indexes in DWARF are one based and a file of index 
zero is
+// supposed to be the compile unit itself.
+support_files.Append (*sc.comp_unit);
+return 
DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(),
+ get_debug_line_data(),
+ cu_comp_dir,
+ stmt_list,
+ support_files);
+}
 }
 }
 return false;


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


Re: [Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3

2016-01-11 Thread Adrian McCarthy via lldb-commits
amccarth added a comment.

In http://reviews.llvm.org/D16017#322830, @zturner wrote:

> What's the extra frame?  Why does Python have an effect on the number of
>  frames seen by the minidump?  Something seems wrong about that.


Sorry, I misspoke.  It has nothing to do with the version of Python.  There's a 
new frame showing below main:

> - thread #1: tid = 0x0454, 0x0004a00c a.out`int bar(x=3) + 12 at main.cpp:6, 
> stop reason = breakpoint 1.1

>   - frame #0: 0x0004a00c a.out`int bar(x=3) + 12 at main.cpp:6 frame #1: 
> 0x0004a048 a.out`int foo(x=3) + 24 at main.cpp:13 frame #2: 0x0004a081 
> a.out`main + 33 at main.cpp:20 frame #3: 0x0004a49c a.out`$LN27 + 224


I suppose this might be from a change to the linker or the generation of debug 
info.  Originally, the deepest frame that showed was main.


http://reviews.llvm.org/D16017



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


Re: [Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3

2016-01-11 Thread Zachary Turner via lldb-commits
zturner accepted this revision.
zturner added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D16017#323550, @amccarth wrote:

> In http://reviews.llvm.org/D16017#322830, @zturner wrote:
>
> > What's the extra frame?  Why does Python have an effect on the number of
> >  frames seen by the minidump?  Something seems wrong about that.
>
>
> Sorry, I misspoke.  It has nothing to do with the version of Python.  There's 
> a new frame showing below main:
>
> > - thread #1: tid = 0x0454, 0x0004a00c a.out`int bar(x=3) + 12 at 
> > main.cpp:6, stop reason = breakpoint 1.1
>
> >   - frame #0: 0x0004a00c a.out`int bar(x=3) + 12 at main.cpp:6 frame #1: 
> > 0x0004a048 a.out`int foo(x=3) + 24 at main.cpp:13 frame #2: 0x0004a081 
> > a.out`main + 33 at main.cpp:20 frame #3: 0x0004a49c a.out`$LN27 + 224
>
>
> I suppose this might be from a change to the linker or the generation of 
> debug info.  Originally, the deepest frame that showed was main.


Meh.  This reminds me of why I wanted to check in the dump file.  We're seeing 
different call stacks with different compilers.  But I guess this is fine.


http://reviews.llvm.org/D16017



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


Re: [Lldb-commits] [PATCH] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-01-11 Thread Zachary Turner via lldb-commits
There's no test here.

On Mon, Jan 11, 2016 at 1:22 AM Bhushan Attarde via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> bhushan added a comment.
>
> Summary:
>
> Get the load address for the address given by 'symbol' and 'function'.
> Earlier, this was done for 'function' only, this patch does it for
> 'symbol' too.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D16049
>
>
>
> ___
> 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] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-01-11 Thread Zachary Turner via lldb-commits
zturner added a subscriber: zturner.
zturner added a comment.

There's no test here.


Repository:
  rL LLVM

http://reviews.llvm.org/D16049



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


[Lldb-commits] [lldb] r257342 - Fix TestMiniDump.py for Python 2/3 (and for a change to debug info)

2016-01-11 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Mon Jan 11 10:35:30 2016
New Revision: 257342

URL: http://llvm.org/viewvc/llvm-project?rev=257342&view=rev
Log:
Fix TestMiniDump.py for Python 2/3 (and for a change to debug info)

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py?rev=257342&r1=257341&r2=257342&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
 Mon Jan 11 10:35:30 2016
@@ -3,7 +3,7 @@ Test basics of mini dump debugging.
 """
 
 from __future__ import print_function
-
+from six import iteritems
 
 
 import lldb
@@ -83,8 +83,8 @@ class MiniDumpTestCase(TestBase):
 thread = process.GetThreadAtIndex(0)
 
 expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' }
-self.assertEqual(thread.GetNumFrames(), len(expected_stack))
-for index, name in expected_stack.iteritems():
+self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack))
+for index, name in iteritems(expected_stack):
 frame = thread.GetFrameAtIndex(index)
 self.assertTrue(frame.IsValid())
 function_name = frame.GetFunctionName()


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


Re: [Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3

2016-01-11 Thread Adrian McCarthy via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257342: Fix TestMiniDump.py for Python 2/3 (and for a change 
to debug info) (authored by amccarth).

Changed prior to commit:
  http://reviews.llvm.org/D16017?vs=44385&id=44518#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16017

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py

Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -3,7 +3,7 @@
 """
 
 from __future__ import print_function
-
+from six import iteritems
 
 
 import lldb
@@ -83,8 +83,8 @@
 thread = process.GetThreadAtIndex(0)
 
 expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' }
-self.assertEqual(thread.GetNumFrames(), len(expected_stack))
-for index, name in expected_stack.iteritems():
+self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack))
+for index, name in iteritems(expected_stack):
 frame = thread.GetFrameAtIndex(index)
 self.assertTrue(frame.IsValid())
 function_name = frame.GetFunctionName()


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -3,7 +3,7 @@
 """
 
 from __future__ import print_function
-
+from six import iteritems
 
 
 import lldb
@@ -83,8 +83,8 @@
 thread = process.GetThreadAtIndex(0)
 
 expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' }
-self.assertEqual(thread.GetNumFrames(), len(expected_stack))
-for index, name in expected_stack.iteritems():
+self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack))
+for index, name in iteritems(expected_stack):
 frame = thread.GetFrameAtIndex(index)
 self.assertTrue(frame.IsValid())
 function_name = frame.GetFunctionName()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16027: Replace accidental DOS (and mixed) line endings in a few text files

2016-01-11 Thread Dimitry Andric via lldb-commits
dim updated this revision to Diff 44525.
dim added a comment.

Updating for upstream changes.


http://reviews.llvm.org/D16027

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
  source/Commands/CommandObjectLanguage.cpp
  source/Plugins/Process/Windows/Live/IDebugDelegate.h
  www/lldb-coding-conventions.html
  www/source.html

Index: www/source.html
===
--- www/source.html
+++ www/source.html
@@ -29,53 +29,53 @@
   
 For non-Mac platforms, and for MacOSX building with CMake (not Xcode), you should check out your sources to adhere to
 the following directory structure:
-  
-  llvm
-  |
-  `-- tools
-  |
-  +-- clang
-  |
-  `-- lldb
-
+  
+  llvm
+  |
+  `-- tools
+  |
+  +-- clang
+  |
+  `-- lldb
+
   
-  
-For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
-automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
-platforms / build systems, it will use the following directory structure.
-  
-  lldb
-  |
-  `-- llvm
-  |
-  +-- tools
-  |
-  `-- clang
-
-
-So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
-  
-  
-Refer to the Build Instructions for more detailed instructions on how to build for a particular
-platform / build system combination.
+  
+For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
+automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
+platforms / build systems, it will use the following directory structure.
+  
+  lldb
+  |
+  `-- llvm
+  |
+  +-- tools
+  |
+  `-- clang
+
+
+So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
+  
+  
+Refer to the Build Instructions for more detailed instructions on how to build for a particular
+platform / build system combination.
   
 
 			
 			
 Contributing to LLDB
 
-  
-Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
-for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
-the following respects.
-
-  Coding conventions.  Refer to LLDB Coding Conventions.
-  
-Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
-system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
-  
-
-For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
+  
+Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
+for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
+the following respects.
+
+  Coding conventions.  Refer to LLDB Coding Conventions.
+  
+Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
+system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
+  
+
+For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
   
 
 
Index: www/lldb-coding-conventions.html
===
--- www/lldb-coding-conventions.html
+++ www/lldb-coding-conventions.html
@@ -22,20 +22,20 @@
 
   The LLDB coding conventions differ in a few important respects from LLVM.
   
-  
-Note that http://clang.llvm.org/docs/ClangFormat.html";>clang-format will deal with
-most of t

[Lldb-commits] [lldb] r257361 - Replace accidental DOS (and mixed) line endings in a few text files

2016-01-11 Thread Dimitry Andric via lldb-commits
Author: dim
Date: Mon Jan 11 12:07:47 2016
New Revision: 257361

URL: http://llvm.org/viewvc/llvm-project?rev=257361&view=rev
Log:
Replace accidental DOS (and mixed) line endings in a few text files

Summary:
Similar to rL256704 and rL256707, fix a few text files which were
accidentally checked in with DOS line endings, or mixed line endings.

Reviewers: jingham, emaste

Subscribers: lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
lldb/trunk/source/Commands/CommandObjectLanguage.cpp
lldb/trunk/source/Plugins/Process/Windows/Live/IDebugDelegate.h
lldb/trunk/www/lldb-coding-conventions.html
lldb/trunk/www/source.html

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp?rev=257361&r1=257360&r2=257361&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
 Mon Jan 11 12:07:47 2016
@@ -1,31 +1,31 @@
-// A sample program for getting minidumps on Windows.
-
-#include 
-
-bool
-fizz(int x)
-{
-return x % 3 == 0;
-}
-
-bool
-buzz(int x)
-{
-return x % 5 == 0;
-}
-
-int
-main()
-{
-int *buggy = 0;
-
-for (int i = 1; i <= 100; ++i)
-{
-if (fizz(i)) std::cout << "fizz";
-if (buzz(i)) std::cout << "buzz";
-if (!fizz(i) && !buzz(i)) std::cout << i;
-std::cout << '\n';
-}
-
-return *buggy;
-}
+// A sample program for getting minidumps on Windows.
+
+#include 
+
+bool
+fizz(int x)
+{
+return x % 3 == 0;
+}
+
+bool
+buzz(int x)
+{
+return x % 5 == 0;
+}
+
+int
+main()
+{
+int *buggy = 0;
+
+for (int i = 1; i <= 100; ++i)
+{
+if (fizz(i)) std::cout << "fizz";
+if (buzz(i)) std::cout << "buzz";
+if (!fizz(i) && !buzz(i)) std::cout << i;
+std::cout << '\n';
+}
+
+return *buggy;
+}

Modified: lldb/trunk/source/Commands/CommandObjectLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLanguage.cpp?rev=257361&r1=257360&r2=257361&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectLanguage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectLanguage.cpp Mon Jan 11 12:07:47 
2016
@@ -1,41 +1,41 @@
-//===-- CommandObjectLanguage.cpp ---*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "CommandObjectLanguage.h"
-
-#include "lldb/Host/Host.h"
-
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-
-#include "lldb/Target/Language.h"
-#include "lldb/Target/LanguageRuntime.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) 
:
-CommandObjectMultiword (interpreter,
-"language",
-"A set of commands for managing language-specific 
functionality.'.",
-"language   
[]"
-)
-{
-//Let the LanguageRuntime populates this command with subcommands
-LanguageRuntime::InitializeCommands(this);
-}
-
-void
-CommandObjectLanguage::GenerateHelpText (Stream &output_stream) {
-CommandObjectMultiword::GenerateHelpText(output_stream);
-}
-
-CommandObjectLanguage::~CommandObjectLanguage ()
-{
-}
+//===-- CommandObjectLanguage.cpp ---*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "CommandObjectLanguage.h"
+
+#include "lldb/Host/Host.h"
+
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+
+#include "lldb/Target/Language.h"
+#include "lldb/Target/LanguageRuntime.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) 
:
+CommandObjectMultiword (interpreter,
+"language",
+"A set of commands for managing language-specific 
functionality.'.",
+"language   
[]"
+

Re: [Lldb-commits] [PATCH] D16046: [LLDB][MIPS] Handle PIC calling convention for MIPS64

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

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D16046



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


Re: [Lldb-commits] [PATCH] D16051: [LLDB][MIPS] Merge emulation of similar instructions for MIPS64

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

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D16051



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


[Lldb-commits] [lldb] r257363 - Don't run dwo tests for windows targets.

2016-01-11 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Jan 11 12:49:30 2016
New Revision: 257363

URL: http://llvm.org/viewvc/llvm-project?rev=257363&view=rev
Log:
Don't run dwo tests for windows targets.

-gsplit-dwarf is not implemented by clang on Windows.  As such,
all the dwo tests are having the -gsplit-dwarf command line option
completely ignored, and the result is you get regular dwarf debug
information, and it's just running the exact same tests twice,
doubling the length of the test suite for no good reason.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=257363&r1=257362&r2=257363&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Mon Jan 11 
12:49:30 2016
@@ -44,7 +44,8 @@ def unique_string_match(yourentry, list)
 
 def is_supported_on_platform(category, platform):
 if category == "dwo":
-return platform in ["linux", "freebsd", "windows"]
+# -gsplit-dwarf is not implemented by clang on Windows.
+return platform in ["linux", "freebsd"]
 elif category == "dsym":
 return platform in ["darwin", "macosx", "ios"]
 return True


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


Re: [Lldb-commits] [PATCH] D16049: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

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

Actually, can you add a test?


Repository:
  rL LLVM

http://reviews.llvm.org/D16049



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


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

2016-01-11 Thread Oleksiy Vyalov via lldb-commits
ovyalov accepted this revision.


Comment at: 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py:29
@@ +28,3 @@
+elif re.match("mips",arch):
+ target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "mips")
+ raw_bytes = bytearray([0x03,0xa0, 0xf0, 0x21])

indentation


Comment at: 
packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py:48
@@ +47,3 @@
+else:
+ self.assertTrue (inst.GetMnemonic(target) == "movq")
+ self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' 
+ "rbp")

ditto


Repository:
  rL LLVM

http://reviews.llvm.org/D15915



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


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

2016-01-11 Thread Muhammad Omair Javaid via lldb-commits
omjavaid updated this revision to Diff 44550.
omjavaid added a comment.

Removed expectedFailureArmLinux and updated expectedFailureLinux decorator to 
reflect architecture if needed.

Marked some triaged failures as xfails on arm with updated expectedFailureLinux 
decorator.

LGTM?


http://reviews.llvm.org/D15893

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

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -696,10 +696,11 @@
 def expectedFailurex86_64(bugnumber=None):
 return expectedFailureArch('x86_64', bugnumber)
 
-def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None):
+def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None, 
archs=None):
 def fn(self):
 return (self.getPlatform() in oslist and
 self.expectedCompiler(compilers) and
+(archs is None or self.getArchitecture() in archs) and
 (debug_info is None or self.debug_info in debug_info))
 return expectedFailure(fn, bugnumber)
 
@@ -716,8 +717,8 @@
 def expectedFailureFreeBSD(bugnumber=None, compilers=None, debug_info=None):
 return expectedFailureOS(['freebsd'], bugnumber, compilers, 
debug_info=debug_info)
 
-def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None):
-return expectedFailureOS(['linux'], bugnumber, compilers, 
debug_info=debug_info)
+def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None, 
archs=None):
+return expectedFailureOS(['linux'], bugnumber, compilers, 
debug_info=debug_info, archs=archs)
 
 def expectedFailureNetBSD(bugnumber=None, compilers=None, debug_info=None):
 return expectedFailureOS(['netbsd'], bugnumber, compilers, 
debug_info=debug_info)
Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -27,6 +27,7 @@
 # Build dictionary to have unique executable names for each test 
method.
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureLinux(bugnumber="llvm.org/pr26031", archs=['arm'])
 @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_watchlocation_using_watchpoint_set(self):
 """Test watching a location with 'watchpoint set expression -w write 
-s size' option."""
Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -17,6 +17,7 @@
 return ['basic_process']
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureLinux(bugnumber="llvm.org/pr26031", archs=['arm'])
 @expectedFailureWindows("llvm.org/pr24446")
 def test(self):
 """Test stepping over watchpoints."""
Index: 
packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
===
--- 
packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ 
packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -16,6 +16,7 @@
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting(self):
 """Test that lldb reliably catches the inferior asserting (command)."""
 self.build()
@@ -30,6 +31,7 @@
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting_disassemble(self):
 """Test that lldb reliably disassembles frames a

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

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

Looks good.


http://reviews.llvm.org/D15893



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


[Lldb-commits] [lldb] r257397 - Introduce a PythonBytes class into PythonDataObjects.

2016-01-11 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Jan 11 16:16:12 2016
New Revision: 257397

URL: http://llvm.org/viewvc/llvm-project?rev=257397&view=rev
Log:
Introduce a PythonBytes class into PythonDataObjects.

This class behaves the same as PythonString on Python2, but differently
on Python3.  Unittests are added as well.

Modified:
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp?rev=257397&r1=257396&r2=257397&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 
Mon Jan 11 16:16:12 2016
@@ -77,6 +77,10 @@ PythonObject::GetObjectType() const
 return PyObjectType::Dictionary;
 if (PythonString::Check(m_py_obj))
 return PyObjectType::String;
+#if PY_MAJOR_VERSION >= 3
+if (PythonBytes::Check(m_py_obj))
+return PyObjectType::Bytes;
+#endif
 if (PythonInteger::Check(m_py_obj))
 return PyObjectType::Integer;
 if (PythonFile::Check(m_py_obj))
@@ -210,6 +214,8 @@ PythonObject::CreateStructuredObject() c
 return PythonList(PyRefType::Borrowed, 
m_py_obj).CreateStructuredArray();
 case PyObjectType::String:
 return PythonString(PyRefType::Borrowed, 
m_py_obj).CreateStructuredString();
+case PyObjectType::Bytes:
+return PythonBytes(PyRefType::Borrowed, 
m_py_obj).CreateStructuredString();
 case PyObjectType::None:
 return StructuredData::ObjectSP();
 default:
@@ -218,6 +224,104 @@ PythonObject::CreateStructuredObject() c
 }
 
 //--
+// PythonString
+//--
+PythonBytes::PythonBytes() : PythonObject()
+{
+}
+
+PythonBytes::PythonBytes(llvm::ArrayRef bytes) : PythonObject()
+{
+SetBytes(bytes);
+}
+
+PythonBytes::PythonBytes(const uint8_t *bytes, size_t length) : PythonObject()
+{
+SetBytes(llvm::ArrayRef(bytes, length));
+}
+
+PythonBytes::PythonBytes(PyRefType type, PyObject *py_obj) : PythonObject()
+{
+Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string
+}
+
+PythonBytes::PythonBytes(const PythonBytes &object) : PythonObject(object)
+{
+}
+
+PythonBytes::~PythonBytes()
+{
+}
+
+bool
+PythonBytes::Check(PyObject *py_obj)
+{
+if (!py_obj)
+return false;
+if (PyBytes_Check(py_obj))
+return true;
+return false;
+}
+
+void
+PythonBytes::Reset(PyRefType type, PyObject *py_obj)
+{
+// Grab the desired reference type so that if we end up rejecting
+// `py_obj` it still gets decremented if necessary.
+PythonObject result(type, py_obj);
+
+if (!PythonBytes::Check(py_obj))
+{
+PythonObject::Reset();
+return;
+}
+
+// Calling PythonObject::Reset(const PythonObject&) will lead to stack 
overflow since it calls
+// back into the virtual implementation.
+PythonObject::Reset(PyRefType::Borrowed, result.get());
+}
+
+llvm::ArrayRef
+PythonBytes::GetBytes() const
+{
+if (!IsValid())
+return llvm::ArrayRef();
+
+Py_ssize_t size;
+char *c;
+
+PyBytes_AsStringAndSize(m_py_obj, &c, &size);
+return llvm::ArrayRef(reinterpret_cast(c), size);
+}
+
+size_t
+PythonBytes::GetSize() const
+{
+if (!IsValid())
+return 0;
+return PyBytes_Size(m_py_obj);
+}
+
+void
+PythonBytes::SetBytes(llvm::ArrayRef bytes)
+{
+const char *data = reinterpret_cast(bytes.data());
+PyObject *py_bytes = PyBytes_FromStringAndSize(data, bytes.size());
+PythonObject::Reset(PyRefType::Owned, py_bytes);
+}
+
+StructuredData::StringSP
+PythonBytes::CreateStructuredString() const
+{
+StructuredData::StringSP result(new StructuredData::String);
+Py_ssize_t size;
+char *c;
+PyBytes_AsStringAndSize(m_py_obj, &c, &size);
+result->SetValue(std::string(c, size));
+return result;
+}
+
+//--
 // PythonString
 //--
 

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h?rev=257397&r1=257396&r2=257397&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h 
(original)
+++ lldb/trunk/source/Plugins/ScriptInt

[Lldb-commits] [lldb] r257398 - Fix Python 3 issues related to OS plugins.

2016-01-11 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Jan 11 16:16:17 2016
New Revision: 257398

URL: http://llvm.org/viewvc/llvm-project?rev=257398&view=rev
Log:
Fix Python 3 issues related to OS plugins.

* lldb::tid_t was being converted incorrectly, so this is updated to use
PythonInteger instead of manual Python Native API calls.
* OSPlugin_RegisterContextData was assuming that the result of
  get_register_data was a string, when in fact it is a bytes.  So this
  method is updated to use PythonBytes to do the work.

Modified:
lldb/trunk/scripts/Python/python-typemaps.swig

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

Modified: lldb/trunk/scripts/Python/python-typemaps.swig
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-typemaps.swig?rev=257398&r1=257397&r2=257398&view=diff
==
--- lldb/trunk/scripts/Python/python-typemaps.swig (original)
+++ lldb/trunk/scripts/Python/python-typemaps.swig Mon Jan 11 16:16:17 2016
@@ -26,15 +26,17 @@
 }
 
 %typemap(in) lldb::tid_t {
-if (PyInt_Check($input))
-$1 = PyInt_AsLong($input);
-else if (PyLong_Check($input))
-$1 = PyLong_AsLongLong($input);
-else
-{
-PyErr_SetString(PyExc_ValueError, "Expecting an integer");
-return NULL;
-}
+  using namespace lldb_private;
+  if (PythonInteger::Check($input))
+  {
+PythonInteger py_int(PyRefType::Borrowed, $input);
+$1 = static_cast(py_int.GetInteger());
+  }
+  else
+  {
+PyErr_SetString(PyExc_ValueError, "Expecting an integer");
+return nullptr;
+  }
 }
 
 %typemap(typecheck) char ** {

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=257398&r1=257397&r2=257398&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Mon Jan 11 16:16:17 2016
@@ -1692,10 +1692,10 @@ ScriptInterpreterPython::OSPlugin_Regist
 PyErr_Clear();
 }
 
-assert(PythonString::Check(py_return.get()) && "get_register_data returned 
unknown object type!");
+assert(PythonBytes::Check(py_return.get()) && "get_register_data returned 
unknown object type!");
 
-PythonString result_string(PyRefType::Borrowed, py_return.get());
-return result_string.CreateStructuredString();
+PythonBytes result(PyRefType::Borrowed, py_return.get());
+return result.CreateStructuredString();
 }
 
 StructuredData::DictionarySP


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


[Lldb-commits] [lldb] r257405 - Xfail some Arm-Linux specific failures

2016-01-11 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Mon Jan 11 16:52:18 2016
New Revision: 257405

URL: http://llvm.org/viewvc/llvm-project?rev=257405&view=rev
Log:
Xfail some Arm-Linux specific failures

Updated expectedFailureLinux decorator to reflect architecture

Marked some triaged failures as xfails on arm with updated expectedFailureLinux 
decorator

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


Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py?rev=257405&r1=257404&r2=257405&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
 Mon Jan 11 16:52:18 2016
@@ -16,6 +16,7 @@ class AssertingInferiorTestCase(TestBase
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting(self):
 """Test that lldb reliably catches the inferior asserting (command)."""
 self.build()
@@ -30,6 +31,7 @@ class AssertingInferiorTestCase(TestBase
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting_disassemble(self):
 """Test that lldb reliably disassembles frames after asserting 
(command)."""
 self.build()
@@ -44,6 +46,7 @@ class AssertingInferiorTestCase(TestBase
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting_expr(self):
 """Test that the lldb expression interpreter can read from the 
inferior after asserting (command)."""
 self.build()
@@ -51,6 +54,7 @@ class AssertingInferiorTestCase(TestBase
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting_step(self):
 """Test that lldb functions correctly after stepping through a call to 
assert()."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py?rev=257405&r1=257404&r2=257405&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
 Mon Jan 11 16:52:18 2016
@@ -17,6 +17,7 @@ class TestStepOverWatchpoint(TestBase):
 return ['basic_process']
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureLinux(bugnumber="llvm.org/pr26031", archs=['arm'])
 @expectedFailureWindows("llvm.org/pr24446")
 def test(self):
 """Test stepping over watchpoints."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py?rev=257405&r1=257404&r2=257405&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
 Mon

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

2016-01-11 Thread Muhammad Omair Javaid via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257405: Xfail some Arm-Linux specific failures (authored by 
omjavaid).

Changed prior to commit:
  http://reviews.llvm.org/D15893?vs=44550&id=44563#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15893

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -696,10 +696,11 @@
 def expectedFailurex86_64(bugnumber=None):
 return expectedFailureArch('x86_64', bugnumber)
 
-def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None):
+def expectedFailureOS(oslist, bugnumber=None, compilers=None, debug_info=None, 
archs=None):
 def fn(self):
 return (self.getPlatform() in oslist and
 self.expectedCompiler(compilers) and
+(archs is None or self.getArchitecture() in archs) and
 (debug_info is None or self.debug_info in debug_info))
 return expectedFailure(fn, bugnumber)
 
@@ -716,8 +717,8 @@
 def expectedFailureFreeBSD(bugnumber=None, compilers=None, debug_info=None):
 return expectedFailureOS(['freebsd'], bugnumber, compilers, 
debug_info=debug_info)
 
-def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None):
-return expectedFailureOS(['linux'], bugnumber, compilers, 
debug_info=debug_info)
+def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None, 
archs=None):
+return expectedFailureOS(['linux'], bugnumber, compilers, 
debug_info=debug_info, archs=archs)
 
 def expectedFailureNetBSD(bugnumber=None, compilers=None, debug_info=None):
 return expectedFailureOS(['netbsd'], bugnumber, compilers, 
debug_info=debug_info)
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -27,6 +27,7 @@
 # Build dictionary to have unique executable names for each test 
method.
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureLinux(bugnumber="llvm.org/pr26031", archs=['arm'])
 @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - 
Watchpoints not supported on Windows
 def test_watchlocation_using_watchpoint_set(self):
 """Test watching a location with 'watchpoint set expression -w write 
-s size' option."""
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -17,6 +17,7 @@
 return ['basic_process']
 
 @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not 
supported
+@expectedFailureLinux(bugnumber="llvm.org/pr26031", archs=['arm'])
 @expectedFailureWindows("llvm.org/pr24446")
 def test(self):
 """Test stepping over watchpoints."""
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -16,6 +16,7 @@
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailureLinux("llvm.org/pr25338", archs=['arm', 'i386'])
 def test_inferior_asserting(self):
 """Test that lldb reliably catches the inferior asserting (command)."""
 self.build()
@@ -30,6 +31,7 @@
 
 @expectedFailureWindows("llvm.org/pr21793: need to implement support for 
detecting assertion / abort on Windows")
 @expectedFailurei386("llvm.org/pr25338")
+@expectedFailu

[Lldb-commits] [lldb] r257409 - Don't define Bytes and String to be the same number on Py2.

2016-01-11 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Jan 11 17:10:32 2016
New Revision: 257409

URL: http://llvm.org/viewvc/llvm-project?rev=257409&view=rev
Log:
Don't define Bytes and String to be the same number on Py2.

This is causing issues with case labels having the same value.

Modified:
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h?rev=257409&r1=257408&r2=257409&view=diff
==
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h 
(original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h Mon 
Jan 11 17:10:32 2016
@@ -74,11 +74,7 @@ enum class PyObjectType
 Dictionary,
 List,
 String,
-#if PY_MAJOR_VERSION >= 3
 Bytes,
-#else
-Bytes = String,
-#endif
 Module,
 Callable,
 Tuple,


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


[Lldb-commits] Buildbot numbers for week of 1/03/2016 - 1/09/2016

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

Below are some buildbot numbers for the last week of 1/03/2016 - 01/09/2016.

Thanks

Galina



Number of commits by project:

 project   |   commits
---+---
 llvm  |   266
 cfe   |97
 lld   |62
 lldb  |58
 compiler-rt   |29
 libcxx| 8
 polly | 6
 clang-tools-extra | 5
 openmp| 2
---+---
   533


Number of completed builds, failed builds and average build time for
successful builds per active builder:

 buildername   | completed  |
failed | time
---+++
 clang-aarch64-lnt | 54
|  2 | 02:36:37
 clang-atom-d525-fedora| 17
|  1 | 09:03:38
 clang-atom-d525-fedora-rel| 79
|  3 | 01:37:57
 clang-bpf-build   |300
| 21 | 00:02:48
 clang-cmake-aarch64-42vma |266
| 31 | 00:17:00
 clang-cmake-aarch64-full  | 41
|  6 | 03:43:23
 clang-cmake-aarch64-quick |204
|  6 | 00:25:57
 clang-cmake-armv7-a15 |195
| 13 | 00:27:16
 clang-cmake-armv7-a15-full|155
|  7 | 00:43:02
 clang-cmake-armv7-a15-selfhost| 36
|  2 | 04:08:42
 clang-cmake-armv7-a15-selfhost-neon   | 27
|  3 | 05:16:31
 clang-cmake-mips  | 99
|  9 | 01:18:31
 clang-cmake-mipsel|  5
|  1 | 08:20:58
 clang-cmake-thumbv7-a15   |211
|  9 | 00:22:11
 clang-cmake-thumbv7-a15-full-sh   | 23
|  2 | 06:24:30
 clang-hexagon-elf |247
| 13 | 00:15:42
 clang-native-aarch64-full | 14
|  3 | 08:49:58
 clang-native-arm-lnt  | 79
|  1 | 01:09:54
 clang-native-arm-lnt-perf | 16
|  2 | 10:00:51
 clang-ppc64-elf-linux | 96
| 13 | 01:20:07
 clang-ppc64-elf-linux2|198
| 26 | 00:27:25
 clang-sphinx-docs |119
|  2 | 00:00:25
 clang-x64-ninja-win7  |264
|262 | 00:34:37
 clang-x86-win2008-selfhost|222
|220 | 01:10:17
 clang-x86_64-darwin13-cross-arm   |233
|  1 | 00:19:58
 clang-x86_64-darwin13-cross-mingw32   |222
|  2 | 00:23:31
 clang-x86_64-debian-fast  |150
|  4 | 00:11:57
 clang-x86_64-linux-abi-test   |304
|  2 | 00:09:50
 clang-x86_64-linux-selfhost-modules   |287
|194 | 00:15:44
 clang-x86_64-ubuntu-gdb-75|142
|  9 | 00:43:18
 libcxx-libcxxabi-arm-linux|  7
|  1 | 01:09:27
 libcxx-libcxxabi-singlethreaded-x86_64-linux-debian   |  5
|| 00:09:48
 libcxx-libcxxabi-x86_64-linux-debian  |  5
|  2 | 00:10:36
 libcxx-libcxxabi-x86_64-linux-debian-noexceptions |  6
|  1 | 00:10:12
 libcxx-libcxxabi-x86_64-linux-ubuntu-asan |  8
|  7 |
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03|  6
|| 00:06:51
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11|  8
|| 00:06:46
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14|  8
|| 00:07:14
 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z|  8
|| 00:07:29
 libcxx-libcxxabi-x86_64-linux-ubuntu-msan |  7
|  7 |
 libcxx-libcxxabi-x86_64-linux-ubuntu-tsan |  7
|| 00:14:27
 libcxx-libcxxabi-x86_64-linux-ubuntu-unstable-abi |  7
|| 00:08:28
 libcxx-sphinx-docs|  7
|| 00:00:16
 libomp-clang-x86_64-linux-debian  |  2
|  2 |
 libomp-gcc-x86_64-linux

[Lldb-commits] [PATCH] D16099: Get rid of ARM_ELF_SYM_IS_THUMB flag.

2016-01-11 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added reviewers: tberghammer, clayborg.
sas added subscribers: lldb-commits, fjricci.
Herald added subscribers: rengolin, aemerson.

This was used with the old ARM vs. Thumb detection code but is not
required anymore.

http://reviews.llvm.org/D16099

Files:
  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
@@ -954,9 +954,6 @@
 return m_data.GetAddressByteSize();
 }
 
-// Top 16 bits of the `Symbol` flags are available.
-#define ARM_ELF_SYM_IS_THUMB(1 << 16)
-
 AddressClass
 ObjectFileELF::GetAddressClass (addr_t file_addr)
 {
@@ -2190,7 +2187,6 @@
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
-additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = 
eAddressClassCodeAlternateISA;
 }
 else


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -954,9 +954,6 @@
 return m_data.GetAddressByteSize();
 }
 
-// Top 16 bits of the `Symbol` flags are available.
-#define ARM_ELF_SYM_IS_THUMB(1 << 16)
-
 AddressClass
 ObjectFileELF::GetAddressClass (addr_t file_addr)
 {
@@ -2190,7 +2187,6 @@
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
-additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = eAddressClassCodeAlternateISA;
 }
 else
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14507: Make sure we use symbol flags to detect thumbness.

2016-01-11 Thread Stephane Sezer via lldb-commits
sas abandoned this revision.
sas added a comment.

Not required anymore.


http://reviews.llvm.org/D14507



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


[Lldb-commits] [lldb] r257429 - Get rid of ARM_ELF_SYM_IS_THUMB flag.

2016-01-11 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Mon Jan 11 19:12:10 2016
New Revision: 257429

URL: http://llvm.org/viewvc/llvm-project?rev=257429&view=rev
Log:
Get rid of ARM_ELF_SYM_IS_THUMB flag.

Summary:
This was used with the old ARM vs. Thumb detection code but is not
required anymore.

Reviewers: tberghammer, clayborg

Subscribers: fjricci, aemerson, lldb-commits, rengolin

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

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=257429&r1=257428&r2=257429&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jan 11 
19:12:10 2016
@@ -954,9 +954,6 @@ ObjectFileELF::GetAddressByteSize() cons
 return m_data.GetAddressByteSize();
 }
 
-// Top 16 bits of the `Symbol` flags are available.
-#define ARM_ELF_SYM_IS_THUMB(1 << 16)
-
 AddressClass
 ObjectFileELF::GetAddressClass (addr_t file_addr)
 {
@@ -2190,7 +2187,6 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
-additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = 
eAddressClassCodeAlternateISA;
 }
 else


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


Re: [Lldb-commits] [PATCH] D16099: Get rid of ARM_ELF_SYM_IS_THUMB flag.

2016-01-11 Thread Stephane Sezer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257429: Get rid of ARM_ELF_SYM_IS_THUMB flag. (authored by 
sas).

Changed prior to commit:
  http://reviews.llvm.org/D16099?vs=44583&id=44588#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16099

Files:
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -954,9 +954,6 @@
 return m_data.GetAddressByteSize();
 }
 
-// Top 16 bits of the `Symbol` flags are available.
-#define ARM_ELF_SYM_IS_THUMB(1 << 16)
-
 AddressClass
 ObjectFileELF::GetAddressClass (addr_t file_addr)
 {
@@ -2190,7 +2187,6 @@
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
-additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = 
eAddressClassCodeAlternateISA;
 }
 else


Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -954,9 +954,6 @@
 return m_data.GetAddressByteSize();
 }
 
-// Top 16 bits of the `Symbol` flags are available.
-#define ARM_ELF_SYM_IS_THUMB(1 << 16)
-
 AddressClass
 ObjectFileELF::GetAddressClass (addr_t file_addr)
 {
@@ -2190,7 +2187,6 @@
 // symbol.st_value to produce the final symbol_value
 // that we store in the symtab.
 symbol_value_offset = -1;
-additional_flags = ARM_ELF_SYM_IS_THUMB;
 m_address_class_map[symbol.st_value^1] = eAddressClassCodeAlternateISA;
 }
 else
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257441 - [LLDB][MIPS] Handle PIC calling convention for MIPS64

2016-01-11 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Mon Jan 11 21:48:43 2016
New Revision: 257441

URL: http://llvm.org/viewvc/llvm-project?rev=257441&view=rev
Log:
[LLDB][MIPS] Handle PIC calling convention for MIPS64

SUMMARY:
This patch sets up register r25 with the address of function to be called 
in PrepareTrivialCall().
This is required as per MIPS PIC calling convention.

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

Modified:
lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=257441&r1=257440&r2=257441&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Mon Jan 11 
21:48:43 2016
@@ -206,6 +206,7 @@ ABISysV_mips64::PrepareTrivialCall (Thre
 const RegisterInfo *pc_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
 const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
 const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo 
(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
+const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
 
 if (log)
 log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
@@ -228,6 +229,13 @@ ABISysV_mips64::PrepareTrivialCall (Thre
 if (!reg_ctx->WriteRegisterFromUnsigned (pc_reg_info, func_addr))
 return false;
 
+if (log)
+log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
+
+// All callers of position independent functions must place the address of 
the called function in t9 (r25)
+if (!reg_ctx->WriteRegisterFromUnsigned (r25_info, func_addr))
+return false;
+
 return true;
 }
 


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


[Lldb-commits] [lldb] r257442 - [LLDB][MIPS] Merge emulation of similar instructions for MIPS64

2016-01-11 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Mon Jan 11 21:56:58 2016
New Revision: 257442

URL: http://llvm.org/viewvc/llvm-project?rev=257442&view=rev
Log:
[LLDB][MIPS] Merge emulation of similar instructions for MIPS64

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

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

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h

Modified: 
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=257442&r1=257441&r2=257442&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp 
Mon Jan 11 21:56:58 2016
@@ -549,45 +549,45 @@ EmulateInstructionMIPS64::GetOpcodeForIn
 
//--
 // Branch instructions
 
//--
-{ "BEQ",&EmulateInstructionMIPS64::Emulate_BEQ, "BEQ 
rs,rt,offset"  },
-{ "BNE",&EmulateInstructionMIPS64::Emulate_BNE, "BNE 
rs,rt,offset"  },
-{ "BEQL",   &EmulateInstructionMIPS64::Emulate_BEQL,"BEQL 
rs,rt,offset" },
-{ "BNEL",   &EmulateInstructionMIPS64::Emulate_BNEL,"BNEL 
rs,rt,offset" },
-{ "BGEZALL",&EmulateInstructionMIPS64::Emulate_BGEZALL, 
"BGEZALL rt,offset" },
+{ "BEQ",&EmulateInstructionMIPS64::Emulate_BXX_3ops,"BEQ 
rs,rt,offset"  },
+{ "BNE",&EmulateInstructionMIPS64::Emulate_BXX_3ops,"BNE 
rs,rt,offset"  },
+{ "BEQL",   &EmulateInstructionMIPS64::Emulate_BXX_3ops,"BEQL 
rs,rt,offset" },
+{ "BNEL",   &EmulateInstructionMIPS64::Emulate_BXX_3ops,"BNEL 
rs,rt,offset" },
+{ "BGEZALL",&EmulateInstructionMIPS64::Emulate_Bcond_Link,  
"BGEZALL rt,offset" },
 { "BAL",&EmulateInstructionMIPS64::Emulate_BAL, "BAL 
offset"},
-{ "BGEZAL", &EmulateInstructionMIPS64::Emulate_BGEZAL,  
"BGEZAL rs,offset"  },
+{ "BGEZAL", &EmulateInstructionMIPS64::Emulate_Bcond_Link,  
"BGEZAL rs,offset"  },
 { "BALC",   &EmulateInstructionMIPS64::Emulate_BALC,"BALC 
offset"   },
 { "BC", &EmulateInstructionMIPS64::Emulate_BC,  "BC 
offset" },
-{ "BGEZ",   &EmulateInstructionMIPS64::Emulate_BGEZ,"BGEZ 
rs,offset"},
-{ "BLEZALC",&EmulateInstructionMIPS64::Emulate_BLEZALC, 
"BLEZALC rs,offset" },
-{ "BGEZALC",&EmulateInstructionMIPS64::Emulate_BGEZALC, 
"BGEZALC rs,offset" },
-{ "BLTZALC",&EmulateInstructionMIPS64::Emulate_BLTZALC, 
"BLTZALC rs,offset" },
-{ "BGTZALC",&EmulateInstructionMIPS64::Emulate_BGTZALC, 
"BGTZALC rs,offset" },
-{ "BEQZALC",&EmulateInstructionMIPS64::Emulate_BEQZALC, 
"BEQZALC rs,offset" },
-{ "BNEZALC",&EmulateInstructionMIPS64::Emulate_BNEZALC, 
"BNEZALC rs,offset" },
-{ "BEQC",   &EmulateInstructionMIPS64::Emulate_BEQC,"BEQC 
rs,rt,offset" },
-{ "BNEC",   &EmulateInstructionMIPS64::Emulate_BNEC,"BNEC 
rs,rt,offset" },
-{ "BLTC",   &EmulateInstructionMIPS64::Emulate_BLTC,"BLTC 
rs,rt,offset" },
-{ "BGEC",   &EmulateInstructionMIPS64::Emulate_BGEC,"BGEC 
rs,rt,offset" },
-{ "BLTUC",  &EmulateInstructionMIPS64::Emulate_BLTUC,   "BLTUC 
rs,rt,offset"},
-{ "BGEUC",  &EmulateInstructionMIPS64::Emulate_BGEUC,   "BGEUC 
rs,rt,offset"},
-{ "BLTZC",  &EmulateInstructionMIPS64::Emulate_BLTZC,   "BLTZC 
rt,offset"   },
-{ "BLEZC",  &EmulateInstructionMIPS64::Emulate_BLEZC,   "BLEZC 
rt,offset"   },
-{ "BGEZC",  &EmulateInstructionMIPS64::Emulate_BGEZC,   "BGEZC 
rt,offset"   },
-{ "BGTZC",  &EmulateInstructionMIPS64::Emulate_BGTZC,   "BGTZC 
rt,offset"   },
-{ "BEQZC",  &EmulateInstructionMIPS64::Emulate_BEQZC,   "BEQZC 
rt,offset"   },
-{ "BNEZC",  &EmulateInstructionMIPS64::Emulate_BNEZC,   "BNEZC 
rt,offset"

Re: [Lldb-commits] [PATCH] D15046: Fix for TestNoreturnUnwind.py on i386

2016-01-11 Thread Jason Molenda via lldb-commits
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Hi Ravi, sorry for taking so long to get back to you on this.  It looks like a 
reasonable change - let's give it a try.  Sometimes with the unwinder, it can 
be hard to foresee problems across all the different architectures/environments 
that we work.  I'm sure it won't cause problems, but I still get a little 
nervous every time we add another trick to get an unwind to work. :)


http://reviews.llvm.org/D15046



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


[Lldb-commits] [lldb] r257447 - [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size regardless of ABI

2016-01-11 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Mon Jan 11 23:55:03 2016
New Revision: 257447

URL: http://llvm.org/viewvc/llvm-project?rev=257447&view=rev
Log:
[LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size 
regardless of ABI

Reviewers: clayborg, tberghammer.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16060

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=257447&r1=257446&r2=257447&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
Mon Jan 11 23:55:03 2016
@@ -1388,7 +1388,15 @@ NativeRegisterContextLinux_mips64::DoRea
 {
 lldb_private::ArchSpec arch;
 if (m_thread.GetProcess()->GetArchitecture(arch))
-value.SetBytes((void *)(((unsigned char *)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8, arch.GetByteOrder());
+{
+void* target_address = ((uint8_t*)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips;
+uint32_t target_size;
+if ((::strcmp(reg_name, "sr") == 0) || (::strcmp(reg_name, 
"cause") == 0) || (::strcmp(reg_name, "config5") == 0))
+target_size = 4;
+else
+target_size = arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8;
+value.SetBytes(target_address, target_size, arch.GetByteOrder());
+}
 else
 error.SetErrorString("failed to get architecture");
 }


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


Re: [Lldb-commits] [PATCH] D16060: [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size regardless of ABI

2016-01-11 Thread Mohit Bhakkad via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257447: [LLDB][MIPS] Fix ReadRegisterValue for registers 
with constant 32 bit size… (authored by mohit.bhakkad).

Changed prior to commit:
  http://reviews.llvm.org/D16060?vs=44504&id=44603#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16060

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

Index: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
===
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -1388,7 +1388,15 @@
 {
 lldb_private::ArchSpec arch;
 if (m_thread.GetProcess()->GetArchitecture(arch))
-value.SetBytes((void *)(((unsigned char *)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips)), arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8, arch.GetByteOrder());
+{
+void* target_address = ((uint8_t*)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips;
+uint32_t target_size;
+if ((::strcmp(reg_name, "sr") == 0) || (::strcmp(reg_name, 
"cause") == 0) || (::strcmp(reg_name, "config5") == 0))
+target_size = 4;
+else
+target_size = arch.GetFlags() & 
lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8;
+value.SetBytes(target_address, target_size, arch.GetByteOrder());
+}
 else
 error.SetErrorString("failed to get architecture");
 }


Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -1388,7 +1388,15 @@
 {
 lldb_private::ArchSpec arch;
 if (m_thread.GetProcess()->GetArchitecture(arch))
-value.SetBytes((void *)(((unsigned char *)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips)), arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8, arch.GetByteOrder());
+{
+void* target_address = ((uint8_t*)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips;
+uint32_t target_size;
+if ((::strcmp(reg_name, "sr") == 0) || (::strcmp(reg_name, "cause") == 0) || (::strcmp(reg_name, "config5") == 0))
+target_size = 4;
+else
+target_size = arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8;
+value.SetBytes(target_address, target_size, arch.GetByteOrder());
+}
 else
 error.SetErrorString("failed to get architecture");
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257448 - [LLDB][MIPS] Fix rL255619: mips 3, 4 and 5 are 64 bit archs

2016-01-11 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Tue Jan 12 00:03:01 2016
New Revision: 257448

URL: http://llvm.org/viewvc/llvm-project?rev=257448&view=rev
Log:
[LLDB][MIPS] Fix rL255619: mips 3, 4 and 5 are 64 bit archs

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=257448&r1=257447&r2=257448&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Jan 12 
00:03:01 2016
@@ -330,15 +330,15 @@ mipsVariantFromElfFlags(const elf::elf_w
 {
 case llvm::ELF::EF_MIPS_ARCH_1:
 case llvm::ELF::EF_MIPS_ARCH_2:
-case llvm::ELF::EF_MIPS_ARCH_3:
-case llvm::ELF::EF_MIPS_ARCH_4:
-case llvm::ELF::EF_MIPS_ARCH_5:
 case llvm::ELF::EF_MIPS_ARCH_32:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32el : 
ArchSpec::eMIPSSubType_mips32;
 case llvm::ELF::EF_MIPS_ARCH_32R2:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32r2el 
: ArchSpec::eMIPSSubType_mips32r2;
 case llvm::ELF::EF_MIPS_ARCH_32R6:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips32r6el 
: ArchSpec::eMIPSSubType_mips32r6;
+case llvm::ELF::EF_MIPS_ARCH_3:
+case llvm::ELF::EF_MIPS_ARCH_4:
+case llvm::ELF::EF_MIPS_ARCH_5:
 case llvm::ELF::EF_MIPS_ARCH_64:
 return (endian == ELFDATA2LSB) ? ArchSpec::eMIPSSubType_mips64el : 
ArchSpec::eMIPSSubType_mips64;
 case llvm::ELF::EF_MIPS_ARCH_64R2:


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


[Lldb-commits] [lldb] r257453 - Changes to lldb and debugserver to reduce extraneous memory reads

2016-01-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jan 12 01:09:16 2016
New Revision: 257453

URL: http://llvm.org/viewvc/llvm-project?rev=257453&view=rev
Log:
Changes to lldb and debugserver to reduce extraneous memory reads
at each public stop to improve performance a bit.  Most of the 
information lldb needed was already in the jThreadsInfo response;
complete that information and catch a few cases where we could still
fall back to getting the information via discrete memory reads.


debugserver adds 'associated_with_dispatch_queue' and 'dispatch_queue_t
keys to the jThreadsInfo response for all the threads.  lldb needs the
dispatch_queue_t value.  And associated_with_dispatch_queue helps to
identify which threads definitively don't have any queue information so
lldb doesn't try to do memory reads to get that information just because
it was absent in the jThreadsInfo response.

Remove the queue information from the questionmark (T) packet.  We'll
get the information for all threads via the jThreadsInfo response -
sending the information for the stopping thread (on all the private
stops, plus the less frequent public stop) was unnecessary information
being sent over the wire.

SystemRuntimeMacOSX will try to get information about queues by asking
the Threads for them, instead of reading memory.  

ProcessGDBRemote changes to recognize the new keys being sent in the
jThreadsInfo response.  Changes to ThreadGDBRemote to track the new
information.  Also, when a thread is marked as definitively not 
associated with a libdispatch queue, don't fall back to the system
runtime to try memory reads to find the queue name / kind / ID etc.


 


Modified:
lldb/trunk/include/lldb/Target/SystemRuntime.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.h

Modified: lldb/trunk/include/lldb/Target/SystemRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/SystemRuntime.h?rev=257453&r1=257452&r2=257453&view=diff
==
--- lldb/trunk/include/lldb/Target/SystemRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/SystemRuntime.h Tue Jan 12 01:09:16 2016
@@ -275,6 +275,23 @@ public:
 return LLDB_INVALID_ADDRESS;
 }
 
+
+//--
+/// Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
+///
+/// Retrieve the Queue kind - either eQueueKindSerial or 
+/// eQueueKindConcurrent, indicating that this queue processes work
+/// items serially or concurrently.
+///
+/// @return
+/// The Queue kind, if it could be read, else eQueueKindUnknown.
+//--
+virtual lldb::QueueKind
+GetQueueKind (lldb::addr_t dispatch_qaddr)
+{
+return lldb::eQueueKindUnknown;
+}
+
 //--
 /// Get the pending work items for a libdispatch Queue
 ///

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=257453&r1=257452&r2=257453&view=diff
==
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Tue Jan 12 01:09:16 2016
@@ -367,6 +367,35 @@ public:
 }
 
 //--
+/// Whether this thread can be associated with a libdispatch queue
+/// 
+/// The Thread may know if it is associated with a libdispatch queue,
+/// it may know definitively that it is NOT associated with a libdispatch
+/// queue, or it may be unknown whether it is associated with a libdispatch
+/// queue.  
+///
+/// @return
+/// eLazyBoolNo if this thread is definitely not associated with a
+/// libdispatch queue (e.g. on a non-Darwin system where GCD aka 
+/// libdispatch is not available).
+///
+/// eLazyBoolYes this thread is associated with a libdispatch queue.
+///
+/// eLazyBoolCalculate this thread may be associated with a 
libdispatch 
+/// queue but the thread doesn't know one way or the other.
+//--
+virtual lldb_private::LazyBool
+GetAssociatedWithLibdispatchQueue ()
+{
+