[Lldb-commits] [PATCH] D61587: [lldb] Added support for dwarf expressions DW_OP_call2/DW_OP_call4

2019-05-07 Thread Chirag Patel via Phabricator via lldb-commits
Chirag updated this revision to Diff 198439.
Chirag added a comment.

Fixed as per comments. passed proper execution/register context. for the time 
being DW_OP_piece is not allowed in call op. Working on testcase.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61587/new/

https://reviews.llvm.org/D61587

Files:
  include/lldb/Expression/DWARFExpression.h
  source/Expression/DWARFExpression.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Target/RegisterContext.cpp
  unittests/Expression/DWARFExpressionTest.cpp

Index: unittests/Expression/DWARFExpressionTest.cpp
===
--- unittests/Expression/DWARFExpressionTest.cpp
+++ unittests/Expression/DWARFExpressionTest.cpp
@@ -22,11 +22,12 @@
 
   Value result;
   Status status;
+  std::vector stack;
   if (!DWARFExpression::Evaluate(
   /*exe_ctx*/ nullptr, /*reg_ctx*/ nullptr, /*opcode_ctx*/ nullptr,
   extractor, /*dwarf_cu*/ nullptr, /*offset*/ 0, expr.size(),
-  lldb::eRegisterKindLLDB, /*initial_value_ptr*/ nullptr,
-  /*object_address_ptr*/ nullptr, result, &status))
+  lldb::eRegisterKindLLDB, /*object_address_ptr*/ nullptr, stack,
+  result, &status))
 return status.ToError();
 
   return result.GetScalar();
Index: source/Target/RegisterContext.cpp
===
--- source/Target/RegisterContext.cpp
+++ source/Target/RegisterContext.cpp
@@ -87,9 +87,10 @@
   Value result;
   Status error;
   const lldb::offset_t offset = 0;
+  std::vector stack;
   if (dwarf_expr.Evaluate(&exe_ctx, this, opcode_ctx, dwarf_data, nullptr,
   offset, dwarf_opcode_len, eRegisterKindDWARF, nullptr,
-  nullptr, result, &error)) {
+  stack, result, &error)) {
 expr_result = result.GetScalar().SInt(-1);
 switch (expr_result) {
 case 0:
Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2774,18 +2774,20 @@
   break;
 case DW_AT_data_member_location:
   if (form_value.BlockData()) {
-Value initialValue(0);
 Value memberOffset(0);
 const DWARFDataExtractor &debug_info_data = die.GetData();
 uint32_t block_length = form_value.Unsigned();
 uint32_t block_offset =
 form_value.BlockData() - debug_info_data.GetDataStart();
+std::vector stack;
+stack.push_back(Value(0));
+
 if (DWARFExpression::Evaluate(
 nullptr, // ExecutionContext *
 nullptr, // RegisterContext *
 module_sp, debug_info_data, die.GetCU(), block_offset,
-block_length, eRegisterKindDWARF, &initialValue,
-nullptr, memberOffset, nullptr)) {
+block_length, eRegisterKindDWARF, nullptr, stack,
+memberOffset, nullptr)) {
   member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
 }
   } else {
@@ -3229,14 +3231,17 @@
 Value initialValue(0);
 Value memberOffset(0);
 const DWARFDataExtractor &debug_info_data = die.GetData();
+std::vector stack;
+stack.push_back(Value(0));
+
 uint32_t block_length = form_value.Unsigned();
 uint32_t block_offset =
 form_value.BlockData() - debug_info_data.GetDataStart();
 if (DWARFExpression::Evaluate(nullptr, nullptr, module_sp,
   debug_info_data, die.GetCU(),
   block_offset, block_length,
-  eRegisterKindDWARF, &initialValue,
-  nullptr, memberOffset, nullptr)) {
+  eRegisterKindDWARF, nullptr,
+  stack, memberOffset, nullptr)) {
   member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
 }
   } else {
Index: source/Expression/DWARFExpression.cpp
===
--- source/Expression/DWARFExpression.cpp
+++ source/Expression/DWARFExpression.cpp
@@ -1248,6 +1248,9 @@
const Value *object_address_ptr, Value &result,
Status *error_ptr) const {
   ModuleSP module_sp = m_module_wp.lock();
+  std::vector stack;
+  if (initial_value_ptr)
+stack.push_back(*initia

[Lldb-commits] [lldb] r360148 - [lldb] [lit] Fix Register tests to reference arrays via %0 and %1

2019-05-07 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue May  7 07:02:11 2019
New Revision: 360148

URL: http://llvm.org/viewvc/llvm-project?rev=360148&view=rev
Log:
[lldb] [lit] Fix Register tests to reference arrays via %0 and %1

Fix Register tests to reference memory access to arrays via %0 and %1,
rather than via referencing %rax and %rbx directly.  This fixes test
build failures on 32-bit x86.

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp
lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-read.cpp?rev=360148&r1=360147&r2=360148&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-read.cpp Tue May  7 07:02:11 2019
@@ -28,23 +28,23 @@ int main() {
   };
 
   asm volatile(
-"movq 0x00(%%rax), %%r8\n\t"
-"movq 0x08(%%rax), %%r9\n\t"
-"movq 0x10(%%rax), %%r10\n\t"
-"movq 0x18(%%rax), %%r11\n\t"
-"movq 0x20(%%rax), %%r12\n\t"
-"movq 0x28(%%rax), %%r13\n\t"
-"movq 0x30(%%rax), %%r14\n\t"
-"movq 0x38(%%rax), %%r15\n\t"
+"movq 0x00(%0), %%r8\n\t"
+"movq 0x08(%0), %%r9\n\t"
+"movq 0x10(%0), %%r10\n\t"
+"movq 0x18(%0), %%r11\n\t"
+"movq 0x20(%0), %%r12\n\t"
+"movq 0x28(%0), %%r13\n\t"
+"movq 0x30(%0), %%r14\n\t"
+"movq 0x38(%0), %%r15\n\t"
 "\n\t"
-"movaps   0x00(%%rbx), %%xmm8\n\t"
-"movaps   0x10(%%rbx), %%xmm9\n\t"
-"movaps   0x20(%%rbx), %%xmm10\n\t"
-"movaps   0x30(%%rbx), %%xmm11\n\t"
-"movaps   0x40(%%rbx), %%xmm12\n\t"
-"movaps   0x50(%%rbx), %%xmm13\n\t"
-"movaps   0x60(%%rbx), %%xmm14\n\t"
-"movaps   0x70(%%rbx), %%xmm15\n\t"
+"movaps   0x00(%1), %%xmm8\n\t"
+"movaps   0x10(%1), %%xmm9\n\t"
+"movaps   0x20(%1), %%xmm10\n\t"
+"movaps   0x30(%1), %%xmm11\n\t"
+"movaps   0x40(%1), %%xmm12\n\t"
+"movaps   0x50(%1), %%xmm13\n\t"
+"movaps   0x60(%1), %%xmm14\n\t"
+"movaps   0x70(%1), %%xmm15\n\t"
 "\n\t"
 "int3\n\t"
 :

Modified: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=360148&r1=360147&r2=360148&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Tue May  7 07:02:11 2019
@@ -36,29 +36,27 @@ int main() {
 "\n\t"
 "int3\n\t"
 "\n\t"
-"lea %0, %%rbx\n\t"
-"movq%%r8, 0x00(%%rbx)\n\t"
-"movq%%r9, 0x08(%%rbx)\n\t"
-"movq%%r10, 0x10(%%rbx)\n\t"
-"movq%%r11, 0x18(%%rbx)\n\t"
-"movq%%r12, 0x20(%%rbx)\n\t"
-"movq%%r13, 0x28(%%rbx)\n\t"
-"movq%%r14, 0x30(%%rbx)\n\t"
-"movq%%r15, 0x38(%%rbx)\n\t"
+"movq%%r8, 0x00(%0)\n\t"
+"movq%%r9, 0x08(%0)\n\t"
+"movq%%r10, 0x10(%0)\n\t"
+"movq%%r11, 0x18(%0)\n\t"
+"movq%%r12, 0x20(%0)\n\t"
+"movq%%r13, 0x28(%0)\n\t"
+"movq%%r14, 0x30(%0)\n\t"
+"movq%%r15, 0x38(%0)\n\t"
 "\n\t"
-"lea %1, %%rbx\n\t"
-"movaps  %%xmm8, 0x00(%%rbx)\n\t"
-"movaps  %%xmm9, 0x10(%%rbx)\n\t"
-"movaps  %%xmm10, 0x20(%%rbx)\n\t"
-"movaps  %%xmm11, 0x30(%%rbx)\n\t"
-"movaps  %%xmm12, 0x40(%%rbx)\n\t"
-"movaps  %%xmm13, 0x50(%%rbx)\n\t"
-"movaps  %%xmm14, 0x60(%%rbx)\n\t"
-"movaps  %%xmm15, 0x70(%%rbx)\n\t"
-: "=m"(r64), "=m"(xmm)
-: "m"(xmm_fill)
-: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
-  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+"movaps  %%xmm8, 0x00(%1)\n\t"
+"movaps  %%xmm9, 0x10(%1)\n\t"
+"movaps  %%xmm10, 0x20(%1)\n\t"
+"movaps  %%xmm11, 0x30(%1)\n\t"
+"movaps  %%xmm12, 0x40(%1)\n\t"
+"movaps  %%xmm13, 0x50(%1)\n\t"
+"movaps  %%xmm14, 0x60(%1)\n\t"
+"movaps  %%xmm15, 0x70(%1)\n\t"
+:
+: "a"(r64), "b"(xmm), "m"(xmm_fill)
+: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7", "%xmm0",
+  "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
   );
 
   for (int i = 0; i < 8; ++i)

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp?rev=360148&r1=360147&r2=360148&view=diff
=

[Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

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

In D61578#1492422 , @JDevlieghere 
wrote:

> In D61578#1492086 , @clayborg wrote:
>
> > Just wanted to verify that we can put a:
> >
> >   settings set target.load-cwd-lldbinit true
> >
> >
> > in our ~/.lldbinit file and it will then load the local init file in the 
> > current working directory?
>
>
> Yep, that behavior remains unchanged.


Unfortunately, I guess that also means that if somebody does that (set this 
setting in the global config file), this test will fail for him. I think that 
means that one day we will have to add a flag to specifically disable reading 
of the global config file, or find some way to mock its contents.




Comment at: lldb/tools/driver/Options.td:94-100
 def: Flag<["-"], "x">,
   Alias,
   HelpText<"Alias for --no-lldbinit">,
   Group;
+def local_lldbinit: F<"local-lldbinit">,
+  HelpText<"Allow the debugger to load the local lldbinit files.">,
+  Group;

JDevlieghere wrote:
> labath wrote:
> > What's the interaction between these two flags?
> Good question: the `no-lldbinit` flag supersedes the `allow-lldbinit` flag. 
> I'll update the description to make that clear.
Ok, thanks for clarifying.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61578/new/

https://reviews.llvm.org/D61578



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


[Lldb-commits] [PATCH] D61587: [lldb] Added support for dwarf expressions DW_OP_call2/DW_OP_call4

2019-05-07 Thread Greg Clayton via Phabricator via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

A few nits and waiting for the test case.




Comment at: source/Expression/DWARFExpression.cpp:2701-2704
+  auto ref_die = dwarf_cu->GetDIE(die_ref_offset);
+  if (!ref_die.IsValid()) {
+if (error_ptr)
+  error_ptr->SetErrorString("opcode DW_OP_call2 reference not found");

Move these lines into EvaluateCall and pass "die_ref_offset" as the argument 
instead of "ref_die"



Comment at: source/Expression/DWARFExpression.cpp:2704
+if (error_ptr)
+  error_ptr->SetErrorString("opcode DW_OP_call2 reference not found");
+return false;

include the calculated DIE offset in the error message



Comment at: source/Expression/DWARFExpression.cpp:2733-2736
+  auto ref_die = dwarf_cu->GetDIE(die_ref_offset);
+  if (!ref_die.IsValid()) {
+if (error_ptr)
+  error_ptr->SetErrorString("opcode DW_OP_call4 reference not found");

Move these lines into EvaluateCall and pass "die_ref_offset" as the argument 
instead of "ref_die"



Comment at: source/Expression/DWARFExpression.cpp:2736
+if (error_ptr)
+  error_ptr->SetErrorString("opcode DW_OP_call4 reference not found");
+return false;

include the calculated DIE offset in the error message


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61587/new/

https://reviews.llvm.org/D61587



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


[Lldb-commits] [PATCH] D61611: [JITLoaderGDB] Set eTypeJIT for objects read from JIT descriptors

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

Sounds like a reasonable thing to do.

If you're going to be looking into jitted code more, I'd strongly encourage you 
to try to come up with a testing strategy here. Setting up a smoke test which 
jits a simple function using llvm jit, and tries to debug it shouldn't be 
fundamentally difficult (though it will likely be tedious to set up the 
relevant infrastructure), and it will increase our jit test coverage by a 
factor of infinity (from 0% to ??%).

> Might it be better to write ET_EXEC on the JIT side instead?

I don't think that would be right, but ET_DYN might be, since the jitted object 
behaves in a lot of ways like a shared library that was dlopened at runtime. 
OTOH, you could probably find a lot of differences too (I bet lli does not 
bother with generating the program headers for the jitted object)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61611/new/

https://reviews.llvm.org/D61611



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


[Lldb-commits] [lldb] r360158 - RegisterContextLLDB: Push CFA value on DWARF stack when evaluating register expressions

2019-05-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue May  7 08:27:35 2019
New Revision: 360158

URL: http://llvm.org/viewvc/llvm-project?rev=360158&view=rev
Log:
RegisterContextLLDB: Push CFA value on DWARF stack when evaluating register 
expressions

Summary:
This behavior is specified in the Section 6.4.2.3 (Register Rule
instructions) of the DWARF4 spec. We were not doing that, which meant
that any register rule which was relying on the cfa value being there
was not evaluated correctly (it was aborted due to "out of bounds"
access).

I'm not sure how come this wasn't noticed before, but I guess this has
something to do with the fact that dwarf unwind expressions are not used
very often, and when they are, the situation is so complicated that the
CFA is of no use. I noticed this when I started emitting dwarf
expressions for the unwind information present in breakpad symbol files.

Reviewers: jasonmolenda, clayborg

Subscribers: aprantl, lldb-commits

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

Added:
lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Added: lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s?rev=360158&view=auto
==
--- lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s (added)
+++ lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s Tue May  7 08:27:35 
2019
@@ -0,0 +1,49 @@
+.text
+.globl  bar
+.type   bar, @function
+bar:
+.LFB0:
+.cfi_startproc
+leal(%edi, %edi), %eax
+ret
+.cfi_endproc
+.LFE0:
+.size   bar, .-bar
+.globl  foo
+.type   foo, @function
+foo:
+.LFB1:
+.cfi_startproc
+.cfi_escape 0x16, 0x10, 0x06, 0x38, 0x1c, 0x06, 0x08, 0x47, 0x1c
+callbar
+addl$1, %eax
+popq%rdi
+subq$0x47, %rdi
+jmp *%rdi # Return
+.cfi_endproc
+.LFE1:
+.size   foo, .-foo
+.globl  main
+.type   main, @function
+main:
+.LFB2:
+.cfi_startproc
+pushq   %rbp
+.cfi_def_cfa_offset 16
+.cfi_offset 6, -16
+movq%rsp, %rbp
+.cfi_def_cfa_register 6
+movl$47, %edi
+
+# Non-standard calling convention. The real return address must be
+# decremented by 0x47.
+leaq0x47+1f(%rip), %rax
+pushq   %rax
+jmp foo # call
+1:
+popq%rbp
+.cfi_def_cfa 7, 8
+ret
+.cfi_endproc
+.LFE2:
+.size   main, .-main

Added: lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test?rev=360158&view=auto
==
--- lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test (added)
+++ lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test Tue May  7 08:27:35 2019
@@ -0,0 +1,22 @@
+# Test handing of dwarf expressions specifying the location of registers, if
+# those expressions refer to the frame's CFA value.
+
+# REQUIRES: target-x86_64, system-linux, native
+
+# RUN: %clang %p/Inputs/eh-frame-dwarf-unwind.s -o %t
+# RUN: %lldb %t -s %s -o exit | FileCheck %s
+
+breakpoint set -n bar
+# CHECK: Breakpoint 1: where = {{.*}}`bar
+
+process launch
+# CHECK: stop reason = breakpoint 1.1
+
+thread backtrace
+# CHECK: frame #0: {{.*}}`bar
+# CHECK: frame #1: {{.*}}`foo + 5
+# CHECK: frame #2: {{.*}}`main + 19
+
+target modules show-unwind -n foo
+# CHECK: eh_frame UnwindPlan:
+# CHECK: row[0]: 0: CFA=rsp +8 => rip=DW_OP_lit8 , DW_OP_minus , DW_OP_deref , 
DW_OP_const1u 0x47, DW_OP_minus

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=360158&r1=360157&r2=360158&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue May  
7 08:27:35 2019
@@ -1513,9 +1513,11 @@ RegisterContextLLDB::SavedLocationForReg
 DWARFExpression dwarfexpr(opcode_ctx, dwarfdata, nullptr, 0,
   unwindplan_regloc.GetDWARFExpressionLength());
 dwarfexpr.SetRegisterKind(unwindplan_registerkind);
+Value cfa_val = Scalar(m_cfa);
+cfa_val.SetValueType(Value::eValueTypeLoadAddress);
 Value result;
 Status error;
-if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+if (dwarfexpr.Evaluate(&exe_ctx, this, 0, &cfa_val, nullptr, result,
&error)) {
   addr_t val;
   val = result.GetScalar().

[Lldb-commits] [PATCH] D61018: RegisterContextLLDB: Push CFA value on DWARF stack when evaluating register expressions

2019-05-07 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360158: RegisterContextLLDB: Push CFA value on DWARF stack 
when evaluating register… (authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61018?vs=196253&id=198478#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61018/new/

https://reviews.llvm.org/D61018

Files:
  lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
  lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp


Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1513,9 +1513,11 @@
 DWARFExpression dwarfexpr(opcode_ctx, dwarfdata, nullptr, 0,
   unwindplan_regloc.GetDWARFExpressionLength());
 dwarfexpr.SetRegisterKind(unwindplan_registerkind);
+Value cfa_val = Scalar(m_cfa);
+cfa_val.SetValueType(Value::eValueTypeLoadAddress);
 Value result;
 Status error;
-if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+if (dwarfexpr.Evaluate(&exe_ctx, this, 0, &cfa_val, nullptr, result,
&error)) {
   addr_t val;
   val = result.GetScalar().ULongLong();
Index: lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
===
--- lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
+++ lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
@@ -0,0 +1,22 @@
+# Test handing of dwarf expressions specifying the location of registers, if
+# those expressions refer to the frame's CFA value.
+
+# REQUIRES: target-x86_64, system-linux, native
+
+# RUN: %clang %p/Inputs/eh-frame-dwarf-unwind.s -o %t
+# RUN: %lldb %t -s %s -o exit | FileCheck %s
+
+breakpoint set -n bar
+# CHECK: Breakpoint 1: where = {{.*}}`bar
+
+process launch
+# CHECK: stop reason = breakpoint 1.1
+
+thread backtrace
+# CHECK: frame #0: {{.*}}`bar
+# CHECK: frame #1: {{.*}}`foo + 5
+# CHECK: frame #2: {{.*}}`main + 19
+
+target modules show-unwind -n foo
+# CHECK: eh_frame UnwindPlan:
+# CHECK: row[0]: 0: CFA=rsp +8 => rip=DW_OP_lit8 , DW_OP_minus , DW_OP_deref , 
DW_OP_const1u 0x47, DW_OP_minus
Index: lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
===
--- lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
+++ lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
@@ -0,0 +1,49 @@
+.text
+.globl  bar
+.type   bar, @function
+bar:
+.LFB0:
+.cfi_startproc
+leal(%edi, %edi), %eax
+ret
+.cfi_endproc
+.LFE0:
+.size   bar, .-bar
+.globl  foo
+.type   foo, @function
+foo:
+.LFB1:
+.cfi_startproc
+.cfi_escape 0x16, 0x10, 0x06, 0x38, 0x1c, 0x06, 0x08, 0x47, 0x1c
+callbar
+addl$1, %eax
+popq%rdi
+subq$0x47, %rdi
+jmp *%rdi # Return
+.cfi_endproc
+.LFE1:
+.size   foo, .-foo
+.globl  main
+.type   main, @function
+main:
+.LFB2:
+.cfi_startproc
+pushq   %rbp
+.cfi_def_cfa_offset 16
+.cfi_offset 6, -16
+movq%rsp, %rbp
+.cfi_def_cfa_register 6
+movl$47, %edi
+
+# Non-standard calling convention. The real return address must be
+# decremented by 0x47.
+leaq0x47+1f(%rip), %rax
+pushq   %rax
+jmp foo # call
+1:
+popq%rbp
+.cfi_def_cfa 7, 8
+ret
+.cfi_endproc
+.LFE2:
+.size   main, .-main


Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1513,9 +1513,11 @@
 DWARFExpression dwarfexpr(opcode_ctx, dwarfdata, nullptr, 0,
   unwindplan_regloc.GetDWARFExpressionLength());
 dwarfexpr.SetRegisterKind(unwindplan_registerkind);
+Value cfa_val = Scalar(m_cfa);
+cfa_val.SetValueType(Value::eValueTypeLoadAddress);
 Value result;
 Status error;
-if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+if (dwarfexpr.Evaluate(&exe_ctx, this, 0, &cfa_val, nullptr, result,
&error)) {
   addr_t val;
   val = result.GetScalar().ULongLong();
Index: lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
===
--- lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.tes

[Lldb-commits] [lldb] r360161 - Added missing files from 360071.

2019-05-07 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue May  7 08:37:28 2019
New Revision: 360161

URL: http://llvm.org/viewvc/llvm-project?rev=360161&view=rev
Log:
Added missing files from 360071.


Added:
lldb/trunk/unittests/Symbol/Inputs/inlined-functions.yaml
lldb/trunk/unittests/Symbol/TestLineEntry.cpp
Modified:
lldb/trunk/unittests/Symbol/CMakeLists.txt

Modified: lldb/trunk/unittests/Symbol/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/CMakeLists.txt?rev=360161&r1=360160&r2=360161&view=diff
==
--- lldb/trunk/unittests/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Symbol/CMakeLists.txt Tue May  7 08:37:28 2019
@@ -4,6 +4,7 @@ add_lldb_unittest(SymbolTests
   TestClangASTContext.cpp
   TestDWARFCallFrameInfo.cpp
   TestType.cpp
+  TestLineEntry.cpp
 
   LINK_LIBS
 lldbHost

Added: lldb/trunk/unittests/Symbol/Inputs/inlined-functions.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/Inputs/inlined-functions.yaml?rev=360161&view=auto
==
--- lldb/trunk/unittests/Symbol/Inputs/inlined-functions.yaml (added)
+++ lldb/trunk/unittests/Symbol/Inputs/inlined-functions.yaml Tue May  7 
08:37:28 2019
@@ -0,0 +1,943 @@
+--- !mach-o
+FileHeader:  
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x0003
+  filetype:0x0001
+  ncmds:   4
+  sizeofcmds:  1160
+  flags:   0x2000
+  reserved:0x
+LoadCommands:
+  - cmd: LC_SEGMENT_64
+cmdsize: 1032
+segname: ''
+vmaddr:  0
+vmsize:  2022
+fileoff: 1192
+filesize:2022
+maxprot: 7
+initprot:7
+nsects:  6
+flags:   0
+Sections:
+  - sectname:__text
+segname: __TEXT
+addr:0x
+size:224
+offset:  0x04A8
+align:   4
+reloff:  0x0C90
+nreloc:  1
+flags:   0x8400
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__debug_str
+segname: __DWARF
+addr:0x00E0
+size:223
+offset:  0x0588
+align:   0
+reloff:  0x
+nreloc:  0
+flags:   0x0200
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__debug_abbrev
+segname: __DWARF
+addr:0x01BF
+size:190
+offset:  0x0667
+align:   0
+reloff:  0x
+nreloc:  0
+flags:   0x0200
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__debug_info
+segname: __DWARF
+addr:0x027D
+size:583
+offset:  0x0725
+align:   0
+reloff:  0x0C98
+nreloc:  8
+flags:   0x0200
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__compact_unwind
+segname: __LD
+addr:0x0670
+size:64
+offset:  0x0B18
+align:   3
+reloff:  0x0CD8
+nreloc:  2
+flags:   0x0200
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__debug_line
+segname: __DWARF
+addr:0x0718
+size:206
+offset:  0x0BC0
+align:   0
+reloff:  0x0CE8
+nreloc:  1
+flags:   0x0200
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - cmd: LC_BUILD_VERSION
+cmdsize: 24
+platform:1
+minos:   658944
+sdk: 658944
+ntools:  0
+  - cmd: LC_SYMTAB
+cmdsize: 24
+symoff:  3312
+nsyms:   2
+stroff:  3344
+strsize: 20
+  - cmd: LC_DYSYMTAB
+cmdsize: 80
+ilocalsym:   0
+nlocalsym:   0
+iextdefsym:  0
+nextdefsym:  2
+iundefsym:  

Re: [Lldb-commits] [lldb] r360076 - Fix the cmake build by removing non-existant source file

2019-05-07 Thread Greg Clayton via lldb-commits
Thanks for doing this. Just checked the files in with:

$ svn commit
Sendingunittests/Symbol/CMakeLists.txt
Adding unittests/Symbol/Inputs/inlined-functions.yaml
Adding unittests/Symbol/TestLineEntry.cpp
Transmitting file data ...done
Committing transaction...
Committed revision 360161.


> On May 6, 2019, at 1:36 PM, Reid Kleckner via lldb-commits 
>  wrote:
> 
> Author: rnk
> Date: Mon May  6 13:36:58 2019
> New Revision: 360076
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=360076&view=rev
> Log:
> Fix the cmake build by removing non-existant source file
> 
> Modified:
>lldb/trunk/unittests/Symbol/CMakeLists.txt
> 
> Modified: lldb/trunk/unittests/Symbol/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/CMakeLists.txt?rev=360076&r1=360075&r2=360076&view=diff
> ==
> --- lldb/trunk/unittests/Symbol/CMakeLists.txt (original)
> +++ lldb/trunk/unittests/Symbol/CMakeLists.txt Mon May  6 13:36:58 2019
> @@ -4,7 +4,6 @@ add_lldb_unittest(SymbolTests
>   TestClangASTContext.cpp
>   TestDWARFCallFrameInfo.cpp
>   TestType.cpp
> -  TestLineEntry.cpp
> 
>   LINK_LIBS
> lldbHost
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [PATCH] D61311: PostfixExpression: Use signed integers in IntegerNode

2019-05-07 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360166: PostfixExpression: Use signed integers in 
IntegerNode (authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61311?vs=197320&id=198487#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61311/new/

https://reviews.llvm.org/D61311

Files:
  lldb/trunk/include/lldb/Symbol/PostfixExpression.h
  lldb/trunk/source/Symbol/PostfixExpression.cpp
  lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
  
lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp

Index: lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
===
--- lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
+++ lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
@@ -58,20 +58,20 @@
 }
 
 TEST(PDBFPOProgramToDWARFExpressionTests, MultipleIndependentAssignments) {
-  CheckValidProgramTranslation("$T1 1 = $T0 0 =", "$T0", "DW_OP_constu 0x0");
+  CheckValidProgramTranslation("$T1 1 = $T0 0 =", "$T0", "DW_OP_consts +0");
 }
 
 TEST(PDBFPOProgramToDWARFExpressionTests, MultipleDependentAssignments) {
   CheckValidProgramTranslation(
   "$T1 $ebp 4 + = $T0 $T1 8 - 128 @ = ", "$T0",
-  "DW_OP_breg6 +0, DW_OP_constu 0x4, DW_OP_plus , DW_OP_constu 0x8, "
-  "DW_OP_minus , DW_OP_constu 0x80, DW_OP_lit1 , DW_OP_minus , DW_OP_not , "
+  "DW_OP_breg6 +0, DW_OP_consts +4, DW_OP_plus , DW_OP_consts +8, "
+  "DW_OP_minus , DW_OP_consts +128, DW_OP_lit1 , DW_OP_minus , DW_OP_not , "
   "DW_OP_and ");
 }
 
 TEST(PDBFPOProgramToDWARFExpressionTests, DependencyChain) {
   CheckValidProgramTranslation("$T1 0 = $T0 $T1 = $ebp $T0 =", "$ebp",
-   "DW_OP_constu 0x0");
+   "DW_OP_consts +0");
 }
 
 /// Invalid programs tests
Index: lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
===
--- lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
+++ lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
@@ -88,6 +88,7 @@
   EXPECT_EQ("^(^(int(1)))", ParseAndStringify("1 ^ ^"));
   EXPECT_EQ("^(+(int(1), ^(int(2", ParseAndStringify("1 2 ^ + ^"));
   EXPECT_EQ("-($foo, int(47))", ParseAndStringify("$foo 47 -"));
+  EXPECT_EQ("+(int(47), int(-42))", ParseAndStringify("47 -42 +"));
 
   EXPECT_EQ("nullptr", ParseAndStringify("+"));
   EXPECT_EQ("nullptr", ParseAndStringify("^"));
@@ -137,7 +138,7 @@
 }
 
 TEST(PostfixExpression, ToDWARF) {
-  EXPECT_EQ("DW_OP_constu 0x0", ParseAndGenerateDWARF("0"));
+  EXPECT_EQ("DW_OP_consts +0", ParseAndGenerateDWARF("0"));
 
   EXPECT_EQ("DW_OP_breg1 +0", ParseAndGenerateDWARF("R1"));
 
@@ -151,18 +152,18 @@
   EXPECT_EQ("DW_OP_breg1 +0, DW_OP_pick 0x01, DW_OP_plus ",
 ParseAndGenerateDWARF("R1 INIT +"));
 
-  EXPECT_EQ("DW_OP_constu 0x1, DW_OP_pick 0x01, DW_OP_deref , DW_OP_plus ",
+  EXPECT_EQ("DW_OP_consts +1, DW_OP_pick 0x01, DW_OP_deref , DW_OP_plus ",
 ParseAndGenerateDWARF("1 INIT ^ +"));
 
-  EXPECT_EQ("DW_OP_constu 0x4, DW_OP_constu 0x5, DW_OP_plus ",
+  EXPECT_EQ("DW_OP_consts +4, DW_OP_consts +5, DW_OP_plus ",
 ParseAndGenerateDWARF("4 5 +"));
 
-  EXPECT_EQ("DW_OP_constu 0x4, DW_OP_constu 0x5, DW_OP_minus ",
+  EXPECT_EQ("DW_OP_consts +4, DW_OP_consts +5, DW_OP_minus ",
 ParseAndGenerateDWARF("4 5 -"));
 
-  EXPECT_EQ("DW_OP_constu 0x4, DW_OP_deref ", ParseAndGenerateDWARF("4 ^"));
+  EXPECT_EQ("DW_OP_consts +4, DW_OP_deref ", ParseAndGenerateDWARF("4 ^"));
 
-  EXPECT_EQ("DW_OP_breg6 +0, DW_OP_constu 0x80, DW_OP_lit1 "
+  EXPECT_EQ("DW_OP_breg6 +0, DW_OP_consts +128, DW_OP_lit1 "
 ", DW_OP_minus , DW_OP_not , DW_OP_and ",
 ParseAndGenerateDWARF("R6 128 @"));
 }
Index: lldb/trunk/source/Symbol/PostfixExpression.cpp
===
--- lldb/trunk/source/Symbol/PostfixExpression.cpp
+++ lldb/trunk/source/Symbol/PostfixExpression.cpp
@@ -67,7 +67,7 @@
   continue;
 }
 
-uint32_t value;
+int64_t value;
 if (to_integer(token, value, 10)) {
   // token is integer literal
   stack.push_back(MakeNode(alloc, value));
@@ -129,8 +129,8 @@
   void Visit(InitialValueNode &val, Node *&) override;
 
   void Visit(IntegerNode &integer, Node *&) override {
-m_out_stream.PutHex8(DW_OP_constu);
-m_out_stream.PutULEB128(integer.GetValue());
+m_out_stream.PutHex8(DW_OP_consts);
+m_out_stream.PutSLEB128(integer.GetValue());
 ++m_stack_depth;
   }
 
Index: lldb/trunk/include/lldb/Symbol/PostfixExpression.h
===
--- lldb/trunk/include/lldb/Symbol/PostfixExpressio

[Lldb-commits] [lldb] r360166 - PostfixExpression: Use signed integers in IntegerNode

2019-05-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue May  7 08:58:20 2019
New Revision: 360166

URL: http://llvm.org/viewvc/llvm-project?rev=360166&view=rev
Log:
PostfixExpression: Use signed integers in IntegerNode

Summary:
This is necessary to support parsing expressions like ".cfa -16 + ^", as
that format is used in breakpad STACK CFI expressions.

Since the PDB expressions use the same parser, this change will affect
them too, but I don't believe that should be a problem in practice. If
PDBs do contain the negative values, it's very likely that they are
intended to be parsed the same way, and if they don't, then it doesn't
matter.

In case that we do ever need to handle this differently, we can always
make the parser behavior customizable, or just use a different parser.

To make sure that the integer size is big enough for everyone, I switch
from using a (unsigned) 32-bit integer to a 64-bit (signed) one.

Reviewers: amccarth, clayborg, aleksandr.urakov

Subscribers: markmentovai, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Symbol/PostfixExpression.h
lldb/trunk/source/Symbol/PostfixExpression.cpp
lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp

lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp

Modified: lldb/trunk/include/lldb/Symbol/PostfixExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/PostfixExpression.h?rev=360166&r1=360165&r2=360166&view=diff
==
--- lldb/trunk/include/lldb/Symbol/PostfixExpression.h (original)
+++ lldb/trunk/include/lldb/Symbol/PostfixExpression.h Tue May  7 08:58:20 2019
@@ -87,14 +87,14 @@ public:
 /// A node representing an integer literal.
 class IntegerNode : public Node {
 public:
-  IntegerNode(uint32_t value) : Node(Integer), m_value(value) {}
+  IntegerNode(int64_t value) : Node(Integer), m_value(value) {}
 
-  uint32_t GetValue() const { return m_value; }
+  int64_t GetValue() const { return m_value; }
 
   static bool classof(const Node *node) { return node->GetKind() == Integer; }
 
 private:
-  uint32_t m_value;
+  int64_t m_value;
 };
 
 /// A node representing the value of a register with the given register number.

Modified: lldb/trunk/source/Symbol/PostfixExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/PostfixExpression.cpp?rev=360166&r1=360165&r2=360166&view=diff
==
--- lldb/trunk/source/Symbol/PostfixExpression.cpp (original)
+++ lldb/trunk/source/Symbol/PostfixExpression.cpp Tue May  7 08:58:20 2019
@@ -67,7 +67,7 @@ Node *postfix::Parse(llvm::StringRef exp
   continue;
 }
 
-uint32_t value;
+int64_t value;
 if (to_integer(token, value, 10)) {
   // token is integer literal
   stack.push_back(MakeNode(alloc, value));
@@ -129,8 +129,8 @@ private:
   void Visit(InitialValueNode &val, Node *&) override;
 
   void Visit(IntegerNode &integer, Node *&) override {
-m_out_stream.PutHex8(DW_OP_constu);
-m_out_stream.PutULEB128(integer.GetValue());
+m_out_stream.PutHex8(DW_OP_consts);
+m_out_stream.PutSLEB128(integer.GetValue());
 ++m_stack_depth;
   }
 

Modified: lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp?rev=360166&r1=360165&r2=360166&view=diff
==
--- lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp (original)
+++ lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp Tue May  7 08:58:20 
2019
@@ -88,6 +88,7 @@ TEST(PostfixExpression, Parse) {
   EXPECT_EQ("^(^(int(1)))", ParseAndStringify("1 ^ ^"));
   EXPECT_EQ("^(+(int(1), ^(int(2", ParseAndStringify("1 2 ^ + ^"));
   EXPECT_EQ("-($foo, int(47))", ParseAndStringify("$foo 47 -"));
+  EXPECT_EQ("+(int(47), int(-42))", ParseAndStringify("47 -42 +"));
 
   EXPECT_EQ("nullptr", ParseAndStringify("+"));
   EXPECT_EQ("nullptr", ParseAndStringify("^"));
@@ -137,7 +138,7 @@ static std::string ParseAndGenerateDWARF
 }
 
 TEST(PostfixExpression, ToDWARF) {
-  EXPECT_EQ("DW_OP_constu 0x0", ParseAndGenerateDWARF("0"));
+  EXPECT_EQ("DW_OP_consts +0", ParseAndGenerateDWARF("0"));
 
   EXPECT_EQ("DW_OP_breg1 +0", ParseAndGenerateDWARF("R1"));
 
@@ -151,18 +152,18 @@ TEST(PostfixExpression, ToDWARF) {
   EXPECT_EQ("DW_OP_breg1 +0, DW_OP_pick 0x01, DW_OP_plus ",
 ParseAndGenerateDWARF("R1 INIT +"));
 
-  EXPECT_EQ("DW_OP_constu 0x1, DW_OP_pick 0x01, DW_OP_deref , DW_OP_plus ",
+  EXPECT_EQ("DW_OP_consts +1, DW_OP_pick 0x01, DW_OP_deref , DW_OP_plus ",
 ParseAndGenerateDWARF("1 INIT ^ +"));
 
-  EXPECT_EQ("DW_OP_constu 0x4, DW_OP_constu 0x5, DW_OP_plus ",
+  EXPECT_EQ("DW_OP_consts +4, DW_OP_consts +5, DW_OP_plus ",
 ParseAndGenerateDWARF("4 5 +"));
 
-  E

[Lldb-commits] [lldb] r360168 - Make eh-frame-dwarf-unwind.test run on non-linux platforms

2019-05-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue May  7 09:13:05 2019
New Revision: 360168

URL: http://llvm.org/viewvc/llvm-project?rev=360168&view=rev
Log:
Make eh-frame-dwarf-unwind.test run on non-linux platforms

This was meant to be a part of r360158, but I forgot to squash the
commits before pushing.

Added:
lldb/trunk/lit/Unwind/Inputs/call-asm.c
Modified:
lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test

Added: lldb/trunk/lit/Unwind/Inputs/call-asm.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/Inputs/call-asm.c?rev=360168&view=auto
==
--- lldb/trunk/lit/Unwind/Inputs/call-asm.c (added)
+++ lldb/trunk/lit/Unwind/Inputs/call-asm.c Tue May  7 09:13:05 2019
@@ -0,0 +1,3 @@
+int asm_main() asm("asm_main");
+
+int main() { return asm_main(); }

Modified: lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s?rev=360168&r1=360167&r2=360168&view=diff
==
--- lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s (original)
+++ lldb/trunk/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s Tue May  7 09:13:05 
2019
@@ -1,18 +1,13 @@
 .text
 .globl  bar
-.type   bar, @function
 bar:
-.LFB0:
 .cfi_startproc
 leal(%edi, %edi), %eax
 ret
 .cfi_endproc
-.LFE0:
-.size   bar, .-bar
+
 .globl  foo
-.type   foo, @function
 foo:
-.LFB1:
 .cfi_startproc
 .cfi_escape 0x16, 0x10, 0x06, 0x38, 0x1c, 0x06, 0x08, 0x47, 0x1c
 callbar
@@ -21,12 +16,9 @@ foo:
 subq$0x47, %rdi
 jmp *%rdi # Return
 .cfi_endproc
-.LFE1:
-.size   foo, .-foo
-.globl  main
-.type   main, @function
-main:
-.LFB2:
+
+.globl  asm_main
+asm_main:
 .cfi_startproc
 pushq   %rbp
 .cfi_def_cfa_offset 16
@@ -45,5 +37,3 @@ main:
 .cfi_def_cfa 7, 8
 ret
 .cfi_endproc
-.LFE2:
-.size   main, .-main

Modified: lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test?rev=360168&r1=360167&r2=360168&view=diff
==
--- lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test (original)
+++ lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test Tue May  7 09:13:05 2019
@@ -1,9 +1,9 @@
 # Test handing of dwarf expressions specifying the location of registers, if
 # those expressions refer to the frame's CFA value.
 
-# REQUIRES: target-x86_64, system-linux, native
+# REQUIRES: target-x86_64, native
 
-# RUN: %clang %p/Inputs/eh-frame-dwarf-unwind.s -o %t
+# RUN: %clang %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
 # RUN: %lldb %t -s %s -o exit | FileCheck %s
 
 breakpoint set -n bar
@@ -15,7 +15,7 @@ process launch
 thread backtrace
 # CHECK: frame #0: {{.*}}`bar
 # CHECK: frame #1: {{.*}}`foo + 5
-# CHECK: frame #2: {{.*}}`main + 19
+# CHECK: frame #2: {{.*}}`asm_main + 22
 
 target modules show-unwind -n foo
 # CHECK: eh_frame UnwindPlan:


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


[Lldb-commits] [lldb] r360169 - Fixup r360161

2019-05-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue May  7 09:13:10 2019
New Revision: 360169

URL: http://llvm.org/viewvc/llvm-project?rev=360169&view=rev
Log:
Fixup r360161

Remove SymbolVendorMacOSX from the test, as this plugin is not available
on non-mac platforms, and it does not seem to be necessary anyway.

Declare inlined-functions.yaml as an input of the test in cmake.

Modified:
lldb/trunk/unittests/Symbol/CMakeLists.txt
lldb/trunk/unittests/Symbol/TestLineEntry.cpp

Modified: lldb/trunk/unittests/Symbol/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/CMakeLists.txt?rev=360169&r1=360168&r2=360169&view=diff
==
--- lldb/trunk/unittests/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Symbol/CMakeLists.txt Tue May  7 09:13:10 2019
@@ -18,5 +18,6 @@ add_lldb_unittest(SymbolTests
 
 set(test_inputs
   basic-call-frame-info.yaml
+  inlined-functions.yaml
   )
 add_unittest_inputs(SymbolTests "${test_inputs}")

Modified: lldb/trunk/unittests/Symbol/TestLineEntry.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/TestLineEntry.cpp?rev=360169&r1=360168&r2=360169&view=diff
==
--- lldb/trunk/unittests/Symbol/TestLineEntry.cpp (original)
+++ lldb/trunk/unittests/Symbol/TestLineEntry.cpp Tue May  7 09:13:10 2019
@@ -14,7 +14,6 @@
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
 #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
 #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
-#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
 #include "TestingSupport/TestUtilities.h"
 #include "lldb/Symbol/ClangASTContext.h"
 
@@ -38,7 +37,6 @@ public:
 FileSystem::Initialize();
 HostInfo::Initialize();
 ObjectFileMachO::Initialize();
-SymbolVendorMacOSX::Initialize();
 SymbolFileDWARF::Initialize();
 ClangASTContext::Initialize();
   }
@@ -46,7 +44,6 @@ public:
   void TearDown() override {
 ClangASTContext::Terminate();
 SymbolFileDWARF::Terminate();
-SymbolVendorMacOSX::Terminate();
 ObjectFileMachO::Terminate();
 HostInfo::Terminate();
 FileSystem::Terminate();


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


[Lldb-commits] [PATCH] D61565: Ignore generated @import statements in the expression evaluator to fix import-std-module tests on macOS

2019-05-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

A slightly more elegant solution might be to inject a #line directive that 
changes to a different source file for the code that the user entered. I've 
been long wanting to make `expr -g` more palatable to end users by hiding the 
LLDB-injected code in a separate source file by default. If that turns out to 
be too much work, feel free to land this version.




Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:111
+  // True iff the parser has entered or passed the actual user expression.
+  // False means the parser is still parsing the wrapper code generated by 
LLDB.
+  bool m_entered_expr = false;

`///`



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:141
+// loaded by the user. We can stop here as we only care about user-loaded
+// modules.
+if (!m_entered_expr)

Just to make sure I'm understanding:

`expr @import Foo` will still work, but it will import Foo into the expression 
rather than into the context from which we ASTImport definitions?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61565/new/

https://reviews.llvm.org/D61565



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


[Lldb-commits] [PATCH] D61423: MinidumpYAML: add support for the ThreadList stream

2019-05-07 Thread James Henderson via Phabricator via lldb-commits
jhenderson added inline comments.



Comment at: include/llvm/ObjectYAML/MinidumpYAML.h:57
+/// instantiations can be used to represent the ModuleList stream and other
+/// streams with similar structure.
+template 

with -> with a



Comment at: include/llvm/ObjectYAML/MinidumpYAML.h:58
+/// streams with similar structure.
+template 
+struct ListStream : public Stream {

KindV and TypeV aren't clear names to me. What does the V stand for?



Comment at: include/llvm/ObjectYAML/MinidumpYAML.h:64
 
-  static bool classof(const Stream *S) {
-return S->Kind == StreamKind::ModuleList;
-  }
+  ListStream(std::vector Entries = {})
+  : Stream(KindV, TypeV), Entries(std::move(Entries)) {}

`explicit`?



Comment at: include/llvm/ObjectYAML/MinidumpYAML.h:70-73
+/// A structure containing all data belonging to a single minidump module. On
+/// disk, these are placed at various places in the minidump file and
+/// cross-referenced via their offsets, but for ease of use, we group them
+/// together in the logical memory view.

I'm not sure how much sense it makes to go into the detail of the minidump file 
format versus the memory view here. I also am not convinced by the repetition 
of this in the comments below.



Comment at: lib/ObjectYAML/MinidumpYAML.cpp:481
+
+template 
+static size_t

Same comment as above re. names.



Comment at: test/tools/obj2yaml/basic-minidump.yaml:47-49
+  - Thread Id:   0x5C5D5E5F
+Priority Class:  0x60616263
+Environment Block: 0x6465666768696A6B

It would be nice if these were padded so that they all line up. Ditto in the 
Stack block below.



Comment at: test/tools/obj2yaml/basic-minidump.yaml:51
+Stack:   
+  Start of Memory Range: 0x6C6D6E6F70717273
+  Content: 7475767778797A7B

I don't have a concrete suggestion, but it might be nice to have a shorter 
field name than "Start of Memory Range", but that's less of a concern if that's 
the actual minidump field name.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61423/new/

https://reviews.llvm.org/D61423



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


[Lldb-commits] [PATCH] D61565: Ignore generated @import statements in the expression evaluator to fix import-std-module tests on macOS

2019-05-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

To clarify:

I'd like `expr -g` to write out one temporary file (`lldb-expr.mm`) that only 
contains the code the user typed and in the expression. The expression should 
say

  @implementation $__lldb_objc_class ($__lldb_category) 
  +(void)%s:(void *)$__lldb_arg {
  #line "/tmp/lldb-expr.mm" 1
blah();
  #line "/tmp/hidden.mm" 8
  }

and then we set a breakpoint at /tmp/lldb-expr.mm:1.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61565/new/

https://reviews.llvm.org/D61565



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


[Lldb-commits] [PATCH] D61482: [DWARF] Store compile unit IDs in the DIERef class

2019-05-07 Thread Pavel Labath via Phabricator via lldb-commits
labath planned changes to this revision.
labath added a comment.

My understanding of the DIERef class has evolved. I'm going to revise this 
approach a bit.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61482/new/

https://reviews.llvm.org/D61482



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


[Lldb-commits] [lldb] r360172 - [Driver] Add command line option to allow loading local lldbinit file.

2019-05-07 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue May  7 09:57:17 2019
New Revision: 360172

URL: http://llvm.org/viewvc/llvm-project?rev=360172&view=rev
Log:
[Driver] Add command line option to allow loading local lldbinit file.

This patch adds a command line flag that allows lldb to load local
lldbinit files.

Differential revision: https://reviews.llvm.org/D61578

Modified:
lldb/trunk/lit/Driver/LocalLLDBInit.test
lldb/trunk/tools/driver/Driver.cpp
lldb/trunk/tools/driver/Options.td

Modified: lldb/trunk/lit/Driver/LocalLLDBInit.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/LocalLLDBInit.test?rev=360172&r1=360171&r2=360172&view=diff
==
--- lldb/trunk/lit/Driver/LocalLLDBInit.test (original)
+++ lldb/trunk/lit/Driver/LocalLLDBInit.test Tue May  7 09:57:17 2019
@@ -1,9 +1,12 @@
 # RUN: mkdir -p %t.root
+# RUN: mkdir -p %t.home
 # RUN: cp %S/Inputs/.lldbinit %t.root
 # RUN: cd %t.root
-# RUN: %lldb-init -o 'settings show frame-format' 2>&1 | FileCheck %s 
--check-prefix=INIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -o 'settings show frame-format' 2>&1 | 
FileCheck %s --check-prefix=WARNINIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show 
frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT
 # RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s 
--check-prefix=NOINIT --check-prefix=CHECK
 
-# INIT: There is a .lldbinit file in the current directory which is not being 
read.
+# WARNINIT: There is a .lldbinit file in the current directory which is not 
being read.
 # NOINIT-NOT: There is a .lldbinit file in the current directory which is not 
being read.
 # CHECK-NOT: bogus
+# ALLOWINIT: bogus

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=360172&r1=360171&r2=360172&view=diff
==
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Tue May  7 09:57:17 2019
@@ -222,6 +222,11 @@ SBError Driver::ProcessArgs(const opt::I
 m_debugger.SkipAppInitFiles(true);
   }
 
+  if (args.hasArg(OPT_local_lldbinit)) {
+lldb::SBDebugger::SetInternalVariable("target.load-cwd-lldbinit", "true",
+  m_debugger.GetInstanceName());
+  }
+
   if (args.hasArg(OPT_no_use_colors)) {
 m_debugger.SetUseColor(false);
   }

Modified: lldb/trunk/tools/driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Options.td?rev=360172&r1=360171&r2=360172&view=diff
==
--- lldb/trunk/tools/driver/Options.td (original)
+++ lldb/trunk/tools/driver/Options.td Tue May  7 09:57:17 2019
@@ -95,6 +95,9 @@ def: Flag<["-"], "x">,
   Alias,
   HelpText<"Alias for --no-lldbinit">,
   Group;
+def local_lldbinit: F<"local-lldbinit">,
+  HelpText<"Allow the debugger to parse the .lldbinit files in the current 
working directory, unless --no-lldbinit is passed.">,
+  Group;
 
 def batch: F<"batch">,
   HelpText<"Tells the debugger to run the commands from -s, -S, -o & -O, and 
then quit.">,


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


[Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

2019-05-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360172: [Driver] Add command line option to allow loading 
local lldbinit file. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61578?vs=198334&id=198494#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61578/new/

https://reviews.llvm.org/D61578

Files:
  lldb/trunk/lit/Driver/LocalLLDBInit.test
  lldb/trunk/tools/driver/Driver.cpp
  lldb/trunk/tools/driver/Options.td


Index: lldb/trunk/tools/driver/Options.td
===
--- lldb/trunk/tools/driver/Options.td
+++ lldb/trunk/tools/driver/Options.td
@@ -95,6 +95,9 @@
   Alias,
   HelpText<"Alias for --no-lldbinit">,
   Group;
+def local_lldbinit: F<"local-lldbinit">,
+  HelpText<"Allow the debugger to parse the .lldbinit files in the current 
working directory, unless --no-lldbinit is passed.">,
+  Group;
 
 def batch: F<"batch">,
   HelpText<"Tells the debugger to run the commands from -s, -S, -o & -O, and 
then quit.">,
Index: lldb/trunk/tools/driver/Driver.cpp
===
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -222,6 +222,11 @@
 m_debugger.SkipAppInitFiles(true);
   }
 
+  if (args.hasArg(OPT_local_lldbinit)) {
+lldb::SBDebugger::SetInternalVariable("target.load-cwd-lldbinit", "true",
+  m_debugger.GetInstanceName());
+  }
+
   if (args.hasArg(OPT_no_use_colors)) {
 m_debugger.SetUseColor(false);
   }
Index: lldb/trunk/lit/Driver/LocalLLDBInit.test
===
--- lldb/trunk/lit/Driver/LocalLLDBInit.test
+++ lldb/trunk/lit/Driver/LocalLLDBInit.test
@@ -1,9 +1,12 @@
 # RUN: mkdir -p %t.root
+# RUN: mkdir -p %t.home
 # RUN: cp %S/Inputs/.lldbinit %t.root
 # RUN: cd %t.root
-# RUN: %lldb-init -o 'settings show frame-format' 2>&1 | FileCheck %s 
--check-prefix=INIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -o 'settings show frame-format' 2>&1 | 
FileCheck %s --check-prefix=WARNINIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show 
frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT
 # RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s 
--check-prefix=NOINIT --check-prefix=CHECK
 
-# INIT: There is a .lldbinit file in the current directory which is not being 
read.
+# WARNINIT: There is a .lldbinit file in the current directory which is not 
being read.
 # NOINIT-NOT: There is a .lldbinit file in the current directory which is not 
being read.
 # CHECK-NOT: bogus
+# ALLOWINIT: bogus


Index: lldb/trunk/tools/driver/Options.td
===
--- lldb/trunk/tools/driver/Options.td
+++ lldb/trunk/tools/driver/Options.td
@@ -95,6 +95,9 @@
   Alias,
   HelpText<"Alias for --no-lldbinit">,
   Group;
+def local_lldbinit: F<"local-lldbinit">,
+  HelpText<"Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed.">,
+  Group;
 
 def batch: F<"batch">,
   HelpText<"Tells the debugger to run the commands from -s, -S, -o & -O, and then quit.">,
Index: lldb/trunk/tools/driver/Driver.cpp
===
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -222,6 +222,11 @@
 m_debugger.SkipAppInitFiles(true);
   }
 
+  if (args.hasArg(OPT_local_lldbinit)) {
+lldb::SBDebugger::SetInternalVariable("target.load-cwd-lldbinit", "true",
+  m_debugger.GetInstanceName());
+  }
+
   if (args.hasArg(OPT_no_use_colors)) {
 m_debugger.SetUseColor(false);
   }
Index: lldb/trunk/lit/Driver/LocalLLDBInit.test
===
--- lldb/trunk/lit/Driver/LocalLLDBInit.test
+++ lldb/trunk/lit/Driver/LocalLLDBInit.test
@@ -1,9 +1,12 @@
 # RUN: mkdir -p %t.root
+# RUN: mkdir -p %t.home
 # RUN: cp %S/Inputs/.lldbinit %t.root
 # RUN: cd %t.root
-# RUN: %lldb-init -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=INIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=WARNINIT --check-prefix=CHECK
+# RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT
 # RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=NOINIT --check-prefix=CHECK
 
-# INIT: There is a .lldbinit file in the current directory which is not being read.
+# WARNINIT: There is a .lldbinit file in the current directory which is not being read.
 

[Lldb-commits] [PATCH] D61606: Add support for importing general C++ modules into the LLDB expression evaluator

2019-05-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/include/lldb/Symbol/CompileUnit.h:397
   std::vector m_imported_modules;
+  /// All modules, including the current module, used directly or indirectly
+  /// by this compile unit.

All *Clang/Source* modules? Otherwise it sounds like lldb::Modules.



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:486
+if (!m.search_path.IsEmpty())
+  m_include_directories.push_back(m.search_path);
+  }

std::copy_if?



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:933
+  // Clang emits some modulemap files as module tags, so we have to
+  // filter them out here as they are not actual SourceModules.
+  if (name == "module.modulemap")

Is that a bug in Clang? Can you send me an example?



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:934
+  // filter them out here as they are not actual SourceModules.
+  if (name == "module.modulemap")
+continue;

That is not the only valid name for module map files, we also support 
module.map, module.private.modulemap and possibly more. I feel like there 
should be a better solution to the underlying problem.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:995
+
+// The first compile unit should contain all used modules.
+if (module->GetNumCompileUnits() == 0)

This sounds wrong for LTO binaries, which will contain many Clang CUs in one 
file.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61606/new/

https://reviews.llvm.org/D61606



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


[Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

2019-05-07 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D61578#1493452 , @labath wrote:

> In D61578#1492422 , @JDevlieghere 
> wrote:
>
> > In D61578#1492086 , @clayborg 
> > wrote:
> >
> > > Just wanted to verify that we can put a:
> > >
> > >   settings set target.load-cwd-lldbinit true
> > >
> > >
> > > in our ~/.lldbinit file and it will then load the local init file in the 
> > > current working directory?
> >
> >
> > Yep, that behavior remains unchanged.
>
>
> Unfortunately, I guess that also means that if somebody does that (set this 
> setting in the global config file), this test will fail for him. I think that 
> means that one day we will have to add a flag to specifically disable reading 
> of the global config file, or find some way to mock its contents.


The dotest.py tests all disable reading the global .lldbinit file.  Do the lit 
tests not do that as well?  For tests that actually test reading the user's 
.lldbinit file we will need to do something fancy (can we change the HOME 
environment variable to some other place so that it gets read from there?)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61578/new/

https://reviews.llvm.org/D61578



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


Re: [Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

2019-05-07 Thread Jonas Devlieghere via lldb-commits
On Tue, May 7, 2019 at 10:33 AM Jim Ingham via Phabricator <
revi...@reviews.llvm.org> wrote:

> jingham added a comment.
>
> In D61578#1493452 , @labath
> wrote:
>
> > In D61578#1492422 ,
> @JDevlieghere wrote:
> >
> > > In D61578#1492086 ,
> @clayborg wrote:
> > >
> > > > Just wanted to verify that we can put a:
> > > >
> > > >   settings set target.load-cwd-lldbinit true
> > > >
> > > >
> > > > in our ~/.lldbinit file and it will then load the local init file in
> the current working directory?
> > >
> > >
> > > Yep, that behavior remains unchanged.
> >
> >
> > Unfortunately, I guess that also means that if somebody does that (set
> this setting in the global config file), this test will fail for him. I
> think that means that one day we will have to add a flag to specifically
> disable reading of the global config file, or find some way to mock its
> contents.
>
>
> The dotest.py tests all disable reading the global .lldbinit file.  Do the
> lit tests not do that as well?  For tests that actually test reading the
> user's .lldbinit file we will need to do something fancy (can we change the
> HOME environment variable to some other place so that it gets read from
> there?)
>

Yes, the lit tests do this too. However, for this particular test I worked
around that, because it would prevent us from reading the local lldbinit
file. As a mitigation for the issue Pavel mentioned, I did exactly that, I
exported a different HOME env in the test. I'm not 100% that will work
everywhere, but it tricked my LLDB into using that as the home dir.



>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D61578/new/
>
> https://reviews.llvm.org/D61578
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

2019-05-07 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61578#1493863 , @jingham wrote:

> The dotest.py tests all disable reading the global .lldbinit file.  Do the 
> lit tests not do that as well?  For tests that actually test reading the 
> user's .lldbinit file we will need to do something fancy (can we change the 
> HOME environment variable to some other place so that it gets read from 
> there?)


Yes, they do. However, this test specifically disables that behavior because 
otherwise we wouldn't even read the CWD lldbinit. Changing the HOME variable 
might be enough to address this though (and I see Jonas already did that).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61578/new/

https://reviews.llvm.org/D61578



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


[Lldb-commits] [lldb] r360178 - [Host] Clean up dependencies of HostMacOSXObjCXX

2019-05-07 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Tue May  7 11:08:06 2019
New Revision: 360178

URL: http://llvm.org/viewvc/llvm-project?rev=360178&view=rev
Log:
[Host] Clean up dependencies of HostMacOSXObjCXX

Modified:
lldb/trunk/source/Host/macosx/objcxx/CMakeLists.txt

Modified: lldb/trunk/source/Host/macosx/objcxx/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/objcxx/CMakeLists.txt?rev=360178&r1=360177&r2=360178&view=diff
==
--- lldb/trunk/source/Host/macosx/objcxx/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/macosx/objcxx/CMakeLists.txt Tue May  7 11:08:06 2019
@@ -8,13 +8,9 @@ add_lldb_library(lldbHostMacOSXObjCXX
   HostThreadMacOSX.mm
 
   LINK_LIBS
-lldbCore
-lldbSymbol
-lldbTarget
 lldbUtility
 ${EXTRA_LIBS}
 
   LINK_COMPONENTS
-Object
 Support
   )


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


[Lldb-commits] [PATCH] D61578: [Driver] Add command line option to allow loading local lldbinit file

2019-05-07 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D61578#1493875 , @labath wrote:

> In D61578#1493863 , @jingham wrote:
>
> > The dotest.py tests all disable reading the global .lldbinit file.  Do the 
> > lit tests not do that as well?  For tests that actually test reading the 
> > user's .lldbinit file we will need to do something fancy (can we change the 
> > HOME environment variable to some other place so that it gets read from 
> > there?)
>
>
> Yes, they do. However, this test specifically disables that behavior because 
> otherwise we wouldn't even read the CWD lldbinit. Changing the HOME variable 
> might be enough to address this though (and I see Jonas already did that).


Ah, excellent.  That's probably good enough.

The notion of being able to specify to the driver where you store the global 
.lldbinit file is not 100% crazy - for instance if you had several different 
configurations you wanted to run lldb in, you could just switch global lldb 
dirs (e.g. using various shell aliases for the different global locations).  So 
if this does cause problems adding that wouldn't be a totally silly way to fix 
the tests.  But I'm not sure it's worth adding on its own.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61578/new/

https://reviews.llvm.org/D61578



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


[Lldb-commits] [lldb] r360182 - Disable eh-frame-dwarf-unwind.test on windows

2019-05-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue May  7 12:24:28 2019
New Revision: 360182

URL: http://llvm.org/viewvc/llvm-project?rev=360182&view=rev
Log:
Disable eh-frame-dwarf-unwind.test on windows

It fails on the windows bot. Disable until I can figure out what's the
reason.

Modified:
lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test

Modified: lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test?rev=360182&r1=360181&r2=360182&view=diff
==
--- lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test (original)
+++ lldb/trunk/lit/Unwind/eh-frame-dwarf-unwind.test Tue May  7 12:24:28 2019
@@ -1,6 +1,7 @@
 # Test handing of dwarf expressions specifying the location of registers, if
 # those expressions refer to the frame's CFA value.
 
+# UNSUPPORTED: system-windows
 # REQUIRES: target-x86_64, native
 
 # RUN: %clang %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t


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


[Lldb-commits] [PATCH] D61648: [DWARF] Centralize user_id <-> DWARFDIE conversions

2019-05-07 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.

The logic for translating a user_id into a DWARFDIE was replicated in
several places. This removes that redundancy and settles on a single
implementation in SymbolFileDWARF.

The reason for choosing that instead of DIERef was that we were
always immediately converting the returned DIERef into a DWARFDIE
anyway, which meant that one had to specify the SymbolFileDWARF argument
twice (once to get the DIERef, and once to get the actual DIE). Also,
passing a higher-level object (SymbolFileDWARF) into a lower-level one
(DIERef) seemed like a less intuitive arrangement than doing things the
other way around.


https://reviews.llvm.org/D61648

Files:
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -134,10 +134,9 @@
   bool assert_not_being_parsed = true,
   bool resolve_function_context = false);
 
-  SymbolFileDWARF *GetDWARFForUID(lldb::user_id_t uid);
-
-  DWARFDIE
-  GetDIEFromUID(lldb::user_id_t uid);
+  DWARFDIE GetDIEFromUID(lldb::user_id_t uid);
+  lldb::user_id_t GetUIDFromDIE(DWARFBaseDIE die);
+  lldb::user_id_t GetUIDFromDIERef(DIERef ref);
 
   lldb_private::CompilerDecl GetDeclForUID(lldb::user_id_t uid) override;
 
@@ -440,6 +439,12 @@
 return m_forward_decl_clang_type_to_die;
   }
 
+  struct DecodedUID {
+SymbolFileDWARF *dwarf;
+DIERef ref;
+  };
+  DecodedUID DecodeUID(lldb::user_id_t uid);
+
   SymbolFileDWARFDwp *GetDwpSymbolFile();
 
   lldb::ModuleWP m_debug_map_module_wp;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1243,7 +1243,7 @@
   ast_parser->GetDeclForUIDFromDWARF(decl);
 }
 
-SymbolFileDWARF *SymbolFileDWARF::GetDWARFForUID(lldb::user_id_t uid) {
+SymbolFileDWARF::DecodedUID SymbolFileDWARF::DecodeUID(lldb::user_id_t uid) {
   // This method can be called without going through the symbol vendor so we
   // need to lock the module.
   std::lock_guard guard(GetModuleMutex());
@@ -1254,11 +1254,12 @@
   // references to other DWARF objects and we must be ready to receive a
   // "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
   // instance.
-  SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile();
-  if (debug_map)
-return debug_map->GetSymbolFileByOSOIndex(
+  if (SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile()) {
+SymbolFileDWARF *dwarf = debug_map->GetSymbolFileByOSOIndex(
 debug_map->GetOSOIndexFromUserID(uid));
-  return this;
+return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}};
+  }
+  return {this, {dw_offset_t(uid >> 32), dw_offset_t(uid)}};
 }
 
 DWARFDIE
@@ -1266,19 +1267,23 @@
   // This method can be called without going through the symbol vendor so we
   // need to lock the module.
   std::lock_guard guard(GetModuleMutex());
-  // Anytime we get a "lldb::user_id_t" from an lldb_private::SymbolFile API we
-  // must make sure we use the correct DWARF file when resolving things. On
-  // MacOSX, when using SymbolFileDWARFDebugMap, we will use multiple
-  // SymbolFileDWARF classes, one for each .o file. We can often end up with
-  // references to other DWARF objects and we must be ready to receive a
-  // "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
-  // instance.
-  SymbolFileDWARF *dwarf = GetDWARFForUID(uid);
-  if (dwarf)
-return dwarf->GetDIE(DIERef(uid, dwarf));
+
+  DecodedUID decoded = DecodeUID(uid);
+
+  if (decoded.dwarf)
+return decoded.dwarf->GetDIE(decoded.ref);
+
   return DWARFDIE();
 }
 
+lldb::user_id_t SymbolFileDWARF::GetUIDFromDIE(DWARFBaseDIE die) {
+  return GetID() | die.GetOffset();
+}
+
+lldb::user_id_t SymbolFileDWARF::GetUIDFromDIERef(DIERef ref) {
+  return GetID() | ref.die_offset;
+}
+
 CompilerDecl SymbolFileDWARF::GetDeclForUID(lldb::user_id_t type_uid) {
   // This method can be called without going through the symbol vendor so we
   // need to lock the module.
@@ -3105,7 +3110,7 @@
   return 0;
 
 if (sc.function) {
-  DWARFDIE function_die = info->GetDIE(DIERef(sc.function->GetID(), this));
+  DWARFDIE function_die = GetDIEFromUID(sc.function->GetID());
 
   const dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
   DW_AT_low_pc, LLDB_INVALID_ADDRESS);
@@ -3531,7 +353

[Lldb-commits] [PATCH] D61648: [DWARF] Centralize user_id <-> DWARFDIE conversions

2019-05-07 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:137
 
-  SymbolFileDWARF *GetDWARFForUID(lldb::user_id_t uid);
-
-  DWARFDIE
-  GetDIEFromUID(lldb::user_id_t uid);
+  DWARFDIE GetDIEFromUID(lldb::user_id_t uid);
+  lldb::user_id_t GetUIDFromDIE(DWARFBaseDIE die);

Maybe just overload?:
```
DWARFDIE GetDIE(lldb::user_id_t uid);
```



Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:138-139
+  DWARFDIE GetDIEFromUID(lldb::user_id_t uid);
+  lldb::user_id_t GetUIDFromDIE(DWARFBaseDIE die);
+  lldb::user_id_t GetUIDFromDIERef(DIERef ref);
 

Maybe just overload these?:
```
lldb::user_id_t GetUID(DWARFBaseDIE die);
lldb::user_id_t GetUID(DIERef ref);
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61648/new/

https://reviews.llvm.org/D61648



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


[Lldb-commits] [lldb] r360193 - [Core] Remove unused dependencies

2019-05-07 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Tue May  7 14:34:44 2019
New Revision: 360193

URL: http://llvm.org/viewvc/llvm-project?rev=360193&view=rev
Log:
[Core] Remove unused dependencies

Modified:
lldb/trunk/source/Core/CMakeLists.txt

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=360193&r1=360192&r2=360193&view=diff
==
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Tue May  7 14:34:44 2019
@@ -67,13 +67,11 @@ add_lldb_library(lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
-lldbPluginProcessUtility
 lldbPluginCPlusPlusLanguage
 lldbPluginObjCLanguage
 ${LLDB_CURSES_LIBS}
 
   LINK_COMPONENTS
-BinaryFormat
 Support
 Demangle
   )


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


[Lldb-commits] [PATCH] D61579: Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

I wonder if it would make this a little more convenient if we added a SetNoisy 
as the opposite of SetSilent?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61579/new/

https://reviews.llvm.org/D61579



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


[Lldb-commits] [PATCH] D61659: Fix bug in ArchSpec::MergeFrom

2019-05-07 Thread Greg Clayton via Phabricator via lldb-commits
clayborg created this revision.
clayborg added reviewers: labath, zturner, jingham.

Previous ArchSpec tests didn't catch this bug since we never tested just the OS 
being out of date. Fixed the bug and covered this with a test that would catch 
this.

This was found when trying to load a core file where the core file was an ELF 
file with just the e_machine for architeture and where the ELF header had no OS 
set in the OSABI field of the e_ident. It wasn't merging the architecture with 
the target architecture correctly.


https://reviews.llvm.org/D61659

Files:
  source/Utility/ArchSpec.cpp
  unittests/Utility/ArchSpecTest.cpp


Index: unittests/Utility/ArchSpecTest.cpp
===
--- unittests/Utility/ArchSpecTest.cpp
+++ unittests/Utility/ArchSpecTest.cpp
@@ -10,6 +10,7 @@
 
 #include "lldb/Utility/ArchSpec.h"
 #include "llvm/BinaryFormat/MachO.h"
+#include "llvm/BinaryFormat/ELF.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -174,6 +175,31 @@
 EXPECT_EQ(llvm::Triple::EnvironmentType::Android,
   A.GetTriple().getEnvironment());
   }
+  {
+ArchSpec A, B;
+A.SetArchitecture(eArchTypeELF, llvm::ELF::EM_ARM,
+  LLDB_INVALID_CPUTYPE, llvm::ELF::ELFOSABI_NONE);
+B.SetArchitecture(eArchTypeELF, llvm::ELF::EM_ARM,
+  LLDB_INVALID_CPUTYPE, llvm::ELF::ELFOSABI_LINUX);
+
+EXPECT_TRUE(A.IsValid());
+EXPECT_TRUE(B.IsValid());
+
+EXPECT_EQ(llvm::Triple::ArchType::arm, B.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+  B.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS());
+EXPECT_EQ(llvm::Triple::EnvironmentType::UnknownEnvironment,
+  B.GetTriple().getEnvironment());
+
+A.MergeFrom(B);
+EXPECT_EQ(llvm::Triple::ArchType::arm, A.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+  A.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
+EXPECT_EQ(llvm::Triple::EnvironmentType::UnknownEnvironment,
+  A.GetTriple().getEnvironment());
+  }
 }
 
 TEST(ArchSpecTest, MergeFromMachOUnknown) {
Index: source/Utility/ArchSpec.cpp
===
--- source/Utility/ArchSpec.cpp
+++ source/Utility/ArchSpec.cpp
@@ -859,7 +859,7 @@
 void ArchSpec::MergeFrom(const ArchSpec &other) {
   if (!TripleVendorWasSpecified() && other.TripleVendorWasSpecified())
 GetTriple().setVendor(other.GetTriple().getVendor());
-  if (!TripleOSWasSpecified() && other.TripleVendorWasSpecified())
+  if (!TripleOSWasSpecified() && other.TripleOSWasSpecified())
 GetTriple().setOS(other.GetTriple().getOS());
   if (GetTriple().getArch() == llvm::Triple::UnknownArch) {
 GetTriple().setArch(other.GetTriple().getArch());


Index: unittests/Utility/ArchSpecTest.cpp
===
--- unittests/Utility/ArchSpecTest.cpp
+++ unittests/Utility/ArchSpecTest.cpp
@@ -10,6 +10,7 @@
 
 #include "lldb/Utility/ArchSpec.h"
 #include "llvm/BinaryFormat/MachO.h"
+#include "llvm/BinaryFormat/ELF.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -174,6 +175,31 @@
 EXPECT_EQ(llvm::Triple::EnvironmentType::Android,
   A.GetTriple().getEnvironment());
   }
+  {
+ArchSpec A, B;
+A.SetArchitecture(eArchTypeELF, llvm::ELF::EM_ARM,
+  LLDB_INVALID_CPUTYPE, llvm::ELF::ELFOSABI_NONE);
+B.SetArchitecture(eArchTypeELF, llvm::ELF::EM_ARM,
+  LLDB_INVALID_CPUTYPE, llvm::ELF::ELFOSABI_LINUX);
+
+EXPECT_TRUE(A.IsValid());
+EXPECT_TRUE(B.IsValid());
+
+EXPECT_EQ(llvm::Triple::ArchType::arm, B.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+  B.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS());
+EXPECT_EQ(llvm::Triple::EnvironmentType::UnknownEnvironment,
+  B.GetTriple().getEnvironment());
+
+A.MergeFrom(B);
+EXPECT_EQ(llvm::Triple::ArchType::arm, A.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+  A.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
+EXPECT_EQ(llvm::Triple::EnvironmentType::UnknownEnvironment,
+  A.GetTriple().getEnvironment());
+  }
 }
 
 TEST(ArchSpecTest, MergeFromMachOUnknown) {
Index: source/Utility/ArchSpec.cpp
===
--- source/Utility/ArchSpec.cpp
+++ source/Utility/ArchSpec.cpp
@@ -859,7 +859,7 @@
 void ArchSpec::MergeFrom(const ArchSpec &other) {
   if (!TripleVendorWasSpecified() && other.TripleVendorWasSpecified())
 GetTriple().setVendor(other.GetTriple().getVendor());
-  if (!TripleOSWasSpecified() && other.Tri

[Lldb-commits] [PATCH] D61579: Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Seems plausible.




Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:2472
+  flags |= eHandleCommandFlagPrintErrors;
+} else if (m_command_source_flags.back() & eHandleCommandFlagPrintErrors) {
+  flags |= eHandleCommandFlagPrintErrors;

Is `m_command_source_flags.empty() || 
Flags(m_command_source_flags.back()).Test(eHandleCommandFlagPrintErrors)` 
better? Not sure.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61579/new/

https://reviews.llvm.org/D61579



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


[Lldb-commits] [PATCH] D61659: Fix bug in ArchSpec::MergeFrom

2019-05-07 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

Ah, this was my bad. Thanks for taking care of this.




Comment at: unittests/Utility/ArchSpecTest.cpp:188-193
+EXPECT_EQ(llvm::Triple::ArchType::arm, B.GetTriple().getArch());
+EXPECT_EQ(llvm::Triple::VendorType::UnknownVendor,
+  B.GetTriple().getVendor());
+EXPECT_EQ(llvm::Triple::OSType::Linux, B.GetTriple().getOS());
+EXPECT_EQ(llvm::Triple::EnvironmentType::UnknownEnvironment,
+  B.GetTriple().getEnvironment());

I think it might be a good idea to assert A's values here to show that nothing 
changed except the OS after the `MergeFrom` call.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61659/new/

https://reviews.llvm.org/D61659



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


[Lldb-commits] [PATCH] D61579: Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:2472
+  flags |= eHandleCommandFlagPrintErrors;
+} else if (m_command_source_flags.back() & eHandleCommandFlagPrintErrors) {
+  flags |= eHandleCommandFlagPrintErrors;

aprantl wrote:
> Is `m_command_source_flags.empty() || 
> Flags(m_command_source_flags.back()).Test(eHandleCommandFlagPrintErrors)` 
> better? Not sure.
Personally I think this is easier to read, and consistent with what we do 
elsewhere. Happy to be convinced otherwise though :-) 


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61579/new/

https://reviews.llvm.org/D61579



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


[Lldb-commits] [PATCH] D61579: Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Jim Ingham via Phabricator via lldb-commits
jingham added inline comments.



Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:2472
+  flags |= eHandleCommandFlagPrintErrors;
+} else if (m_command_source_flags.back() & eHandleCommandFlagPrintErrors) {
+  flags |= eHandleCommandFlagPrintErrors;

JDevlieghere wrote:
> aprantl wrote:
> > Is `m_command_source_flags.empty() || 
> > Flags(m_command_source_flags.back()).Test(eHandleCommandFlagPrintErrors)` 
> > better? Not sure.
> Personally I think this is easier to read, and consistent with what we do 
> elsewhere. Happy to be convinced otherwise though :-) 
I agree with Jonas, the original is easier to read.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61579/new/

https://reviews.llvm.org/D61579



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


[Lldb-commits] [lldb] r360208 - [Expression] Remove unused dependency

2019-05-07 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Tue May  7 16:11:05 2019
New Revision: 360208

URL: http://llvm.org/viewvc/llvm-project?rev=360208&view=rev
Log:
[Expression] Remove unused dependency

lldbExpression was linking against lldbPluginExpressionParserClang, and
lldbPluginExpressionParserClang was linking against lldbExpression.
There's no reason lldbExpression should need anything from
lldbPluginExpressionParserClang, so let's remove that dependency.

Modified:
lldb/trunk/include/lldb/Expression/ExpressionVariable.h
lldb/trunk/source/Expression/CMakeLists.txt
lldb/trunk/source/Expression/UserExpression.cpp

Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=360208&r1=360207&r2=360208&view=diff
==
--- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original)
+++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Tue May  7 16:11:05 
2019
@@ -20,8 +20,6 @@
 
 namespace lldb_private {
 
-class ClangExpressionVariable;
-
 class ExpressionVariable
 : public std::enable_shared_from_this {
 public:

Modified: lldb/trunk/source/Expression/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=360208&r1=360207&r2=360208&view=diff
==
--- lldb/trunk/source/Expression/CMakeLists.txt (original)
+++ lldb/trunk/source/Expression/CMakeLists.txt Tue May  7 16:11:05 2019
@@ -28,7 +28,6 @@ add_lldb_library(lldbExpression
 lldbSymbol
 lldbTarget
 lldbUtility
-lldbPluginExpressionParserClang
 lldbPluginObjectFileJIT
 
   LINK_COMPONENTS

Modified: lldb/trunk/source/Expression/UserExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UserExpression.cpp?rev=360208&r1=360207&r2=360208&view=diff
==
--- lldb/trunk/source/Expression/UserExpression.cpp (original)
+++ lldb/trunk/source/Expression/UserExpression.cpp Tue May  7 16:11:05 2019
@@ -15,11 +15,11 @@
 #include 
 #include 
 
-#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/Expression/DiagnosticManager.h"
+#include "lldb/Expression/ExpressionVariable.h"
 #include "lldb/Expression/IRExecutionUnit.h"
 #include "lldb/Expression/IRInterpreter.h"
 #include "lldb/Expression/Materializer.h"


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


[Lldb-commits] [lldb] r360209 - [Docs] Add timestamp

2019-05-07 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue May  7 16:14:06 2019
New Revision: 360209

URL: http://llvm.org/viewvc/llvm-project?rev=360209&view=rev
Log:
[Docs] Add timestamp

Modified:
lldb/trunk/docs/conf.py

Modified: lldb/trunk/docs/conf.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/conf.py?rev=360209&r1=360208&r2=360209&view=diff
==
--- lldb/trunk/docs/conf.py (original)
+++ lldb/trunk/docs/conf.py Tue May  7 16:14:06 2019
@@ -133,7 +133,7 @@ html_extra_path = ['.htaccess']
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
+html_last_updated_fmt = '%b %d, %Y'
 
 # If true, SmartyPants will be used to convert quotes and dashes to
 # typographically correct entities.


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


[Lldb-commits] [lldb] r360216 - Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue May  7 18:23:47 2019
New Revision: 360216

URL: http://llvm.org/viewvc/llvm-project?rev=360216&view=rev
Log:
Propagate command interpreter errors from lldlbinit

This patch ensures that we propagate errors coming from the lldbinit
file trough the command/script interpreter. Before, if you did something
like command script import syntax_error.py, and the python file
contained a syntax error, lldb wouldn't tell you about it. This changes
with the current patch: errors are now propagated by default.

PS: Jim authored this change and I added testing.

Differential revision: https://reviews.llvm.org/D61579

Added:
lldb/trunk/lit/Driver/Inputs/syntax_error.py
Modified:
lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
lldb/trunk/lit/Driver/Inputs/.lldbinit
lldb/trunk/lit/Driver/LocalLLDBInit.test
lldb/trunk/source/Breakpoint/BreakpointOptions.cpp
lldb/trunk/source/Commands/CommandObjectBugreport.cpp
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Commands/CommandObjectSettings.cpp
lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=360216&r1=360215&r2=360216&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Tue May  7 
18:23:47 2019
@@ -53,19 +53,23 @@ public:
   ///\b false, print no ouput in this case. This setting has an effect only
   ///if \param echo_commands is \b true.
   /// \param[in] print_results
-  ///If \b true print the results of the command after executing it. If
-  ///\b false, execute silently.
+  ///If \b true and the command succeeds, print the results of the command
+  ///after executing it. If \b false, execute silently.
+  /// \param[in] print_errors
+  ///If \b true and the command fails, print the results of the command
+  ///after executing it. If \b false, execute silently.
   /// \param[in] add_to_history
   ///If \b true add the commands to the command history. If \b false, don't
   ///add them.
   CommandInterpreterRunOptions(LazyBool stop_on_continue,
LazyBool stop_on_error, LazyBool stop_on_crash,
LazyBool echo_commands, LazyBool echo_comments,
-   LazyBool print_results, LazyBool add_to_history)
+   LazyBool print_results, LazyBool print_errors,
+   LazyBool add_to_history)
   : m_stop_on_continue(stop_on_continue), m_stop_on_error(stop_on_error),
 m_stop_on_crash(stop_on_crash), m_echo_commands(echo_commands),
 m_echo_comment_commands(echo_comments), m_print_results(print_results),
-m_add_to_history(add_to_history) {}
+m_print_errors(print_errors), m_add_to_history(add_to_history) {}
 
   CommandInterpreterRunOptions()
   : m_stop_on_continue(eLazyBoolCalculate),
@@ -73,13 +77,14 @@ public:
 m_stop_on_crash(eLazyBoolCalculate),
 m_echo_commands(eLazyBoolCalculate),
 m_echo_comment_commands(eLazyBoolCalculate),
-m_print_results(eLazyBoolCalculate),
+m_print_results(eLazyBoolCalculate), 
m_print_errors(eLazyBoolCalculate),
 m_add_to_history(eLazyBoolCalculate) {}
 
   void SetSilent(bool silent) {
 LazyBool value = silent ? eLazyBoolNo : eLazyBoolYes;
 
 m_print_results = value;
+m_print_errors = value;
 m_echo_commands = value;
 m_echo_comment_commands = value;
 m_add_to_history = value;
@@ -127,6 +132,12 @@ public:
 m_print_results = print_results ? eLazyBoolYes : eLazyBoolNo;
   }
 
+  bool GetPrintErrors() const { return DefaultToYes(m_print_errors); }
+
+  void SetPrintErrors(bool print_errors) {
+m_print_errors = print_errors ? eLazyBoolYes : eLazyBoolNo;
+  }
+
   bool GetAddToHistory() const { return DefaultToYes(m_add_to_history); }
 
   void SetAddToHistory(bool add_to_history) {
@@ -139,6 +150,7 @@ public:
   LazyBool m_echo_commands;
   LazyBool m_echo_comment_commands;
   LazyBool m_print_results;
+  LazyBool m_print_errors;
   LazyBool m_add_to_history;
 
 private:

Modified: lldb/trunk/lit/Driver/Inputs/.lldbinit
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/.lldbinit?rev=360216&r1=360215&r2=360216&view=diff
==
--- lldb/trunk/lit/Driver/Inputs/.lldbinit (original)
+++ lldb/trunk/lit/Driver/Inputs/.lldbinit Tue May  7 18:23:47 2019
@@ -1 +1,2 @@
 settings set -f frame-format "bogus"
+command script import syntax_error.py

Added:

[Lldb-commits] [PATCH] D61579: Propagate command interpreter errors from lldlbinit

2019-05-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360216: Propagate command interpreter errors from 
lldlbinit (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61579?vs=198215&id=198571#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61579/new/

https://reviews.llvm.org/D61579

Files:
  include/lldb/Interpreter/CommandInterpreter.h
  lit/Driver/Inputs/.lldbinit
  lit/Driver/Inputs/syntax_error.py
  lit/Driver/LocalLLDBInit.test
  source/Breakpoint/BreakpointOptions.cpp
  source/Commands/CommandObjectBugreport.cpp
  source/Commands/CommandObjectCommands.cpp
  source/Commands/CommandObjectSettings.cpp
  source/Commands/CommandObjectWatchpointCommand.cpp
  source/Interpreter/CommandInterpreter.cpp
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2652,6 +2652,7 @@
 options.SetStopOnError(true);
 options.SetEchoCommands(false);
 options.SetPrintResults(true);
+options.SetPrintErrors(true);
 options.SetAddToHistory(false);
 
 // Force Async:
Index: source/Interpreter/CommandInterpreter.cpp
===
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -2173,6 +2173,7 @@
 const bool saved_batch = SetBatchCommandMode(true);
 CommandInterpreterRunOptions options;
 options.SetSilent(true);
+options.SetPrintErrors(true);
 options.SetStopOnError(false);
 options.SetStopOnContinue(true);
 
@@ -2364,7 +2365,8 @@
   eHandleCommandFlagEchoCommand = (1u << 2),
   eHandleCommandFlagEchoCommentCommand = (1u << 3),
   eHandleCommandFlagPrintResult = (1u << 4),
-  eHandleCommandFlagStopOnCrash = (1u << 5)
+  eHandleCommandFlagPrintErrors = (1u << 5),
+  eHandleCommandFlagStopOnCrash = (1u << 6)
 };
 
 void CommandInterpreter::HandleCommandsFromFile(
@@ -2463,6 +2465,17 @@
 flags |= eHandleCommandFlagPrintResult;
   }
 
+  if (options.m_print_errors == eLazyBoolCalculate) {
+if (m_command_source_flags.empty()) {
+  // Print output by default
+  flags |= eHandleCommandFlagPrintErrors;
+} else if (m_command_source_flags.back() & eHandleCommandFlagPrintErrors) {
+  flags |= eHandleCommandFlagPrintErrors;
+}
+  } else if (options.m_print_errors == eLazyBoolYes) {
+flags |= eHandleCommandFlagPrintErrors;
+  }
+
   if (flags & eHandleCommandFlagPrintResult) {
 debugger.GetOutputFile()->Printf("Executing commands in '%s'.\n",
  cmd_file_path.c_str());
@@ -2790,7 +2803,9 @@
   HandleCommand(line.c_str(), eLazyBoolCalculate, result);
 
   // Now emit the command output text from the command we just executed
-  if (io_handler.GetFlags().Test(eHandleCommandFlagPrintResult)) {
+  if ((result.Succeeded() &&
+   io_handler.GetFlags().Test(eHandleCommandFlagPrintResult)) ||
+  io_handler.GetFlags().Test(eHandleCommandFlagPrintErrors)) {
 // Display any STDOUT/STDERR _prior_ to emitting the command result text
 GetProcessOutput();
 
@@ -2960,8 +2975,11 @@
 flags |= eHandleCommandFlagEchoCommentCommand;
   if (options->m_print_results != eLazyBoolNo)
 flags |= eHandleCommandFlagPrintResult;
+  if (options->m_print_errors != eLazyBoolNo)
+flags |= eHandleCommandFlagPrintErrors;
 } else {
-  flags = eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult;
+  flags = eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult |
+  eHandleCommandFlagPrintErrors;
 }
 
 m_command_io_handler_sp = std::make_shared(
Index: source/Commands/CommandObjectWatchpointCommand.cpp
===
--- source/Commands/CommandObjectWatchpointCommand.cpp
+++ source/Commands/CommandObjectWatchpointCommand.cpp
@@ -295,6 +295,7 @@
 options.SetStopOnError(data->stop_on_error);
 options.SetEchoCommands(false);
 options.SetPrintResults(true);
+options.SetPrintErrors(true);
 options.SetAddToHistory(false);
 
 debugger.GetCommandInterpreter().HandleCommands(commands, &exe_ctx,
Index: source/Commands/CommandObjectSettings.cpp
===
--- source/Commands/CommandObjectSettings.cpp
+++ source/Commands/CommandObjectSettings.cpp
@@ -501,6 +501,7 @@
 options.SetAddToHistory(false);
 options.SetEchoCommands(false);
 options.SetPrintResults(true);
+options.SetPrintErrors(true);
 options.SetStopOnError(false);
 m_interpreter.HandleCommandsFromFile(file, &clean_ctx, options, result);
 return result.Succeeded();
Index: source/Commands/CommandObjectBugreport.cpp
===

[Lldb-commits] [PATCH] D61648: [DWARF] Centralize user_id <-> DWARFDIE conversions

2019-05-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Greg's suggestion for an overload seems reasonable. Otherwise LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61648/new/

https://reviews.llvm.org/D61648



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


[Lldb-commits] [lldb] r360218 - [Docs] Re-order homepage: Download -> Build -> Test

2019-05-07 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue May  7 18:38:12 2019
New Revision: 360218

URL: http://llvm.org/viewvc/llvm-project?rev=360218&view=rev
Log:
[Docs] Re-order homepage: Download -> Build -> Test

I also reformatted some paragraphs to 80 cols.

Modified:
lldb/trunk/docs/index.rst
lldb/trunk/docs/resources/test.rst

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=360218&r1=360217&r2=360218&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Tue May  7 18:38:12 2019
@@ -52,8 +52,8 @@ Resources
 
resources/download
resources/build
-   resources/source
resources/test
+   resources/source
resources/bots
resources/sbapi
 

Modified: lldb/trunk/docs/resources/test.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/test.rst?rev=360218&r1=360217&r2=360218&view=diff
==
--- lldb/trunk/docs/resources/test.rst (original)
+++ lldb/trunk/docs/resources/test.rst Tue May  7 18:38:12 2019
@@ -1,5 +1,5 @@
-Testing LLDB
-
+Testing
+===
 
 The LLDB test suite consists of Python scripts located under the test
 directory. Each script contains a number of test cases and is usually
@@ -20,10 +20,10 @@ against a debug version of LLDB.
 The easiest way to run the LLDB test suite is to use the ``check-lldb`` build
 target. By default, the ``check-lldb`` target builds the test programs with the
 same compiler that was used to build LLDB. To build the tests with a different
-compiler, you can set the ``LLDB_TEST_C_COMPILER`` or the 
``LLDB_TEST_CXX_COMPILER``
-CMake variables. These variables are ignored unless the respective
-``LLDB_TEST_USE_CUSTOM_C_COMPILER`` and ``LLDB_TEST_USE_CUSTOM_CXX_COMPILER`` 
are set
-to ``ON``.
+compiler, you can set the ``LLDB_TEST_C_COMPILER`` or the
+``LLDB_TEST_CXX_COMPILER`` CMake variables. These variables are ignored unless
+the respective ``LLDB_TEST_USE_CUSTOM_C_COMPILER`` and
+``LLDB_TEST_USE_CUSTOM_CXX_COMPILER`` are set to ``ON``.
 
 It is possible to customize the architecture of the test binaries and compiler
 used by appending ``-A`` and ``-C`` options respectively to the CMake variable
@@ -44,14 +44,17 @@ environment. This is due to lack of the
 Running a Specific Test or Set of Tests
 ---
 
-In addition to running all the LLDB test suites with the "check-lldb" CMake 
target above, it is possible to run individual LLDB tests. For example, to run 
the test cases defined in TestInferiorCrashing.py, run:
+In addition to running all the LLDB test suites with the "check-lldb" CMake
+target above, it is possible to run individual LLDB tests. For example, to run
+the test cases defined in TestInferiorCrashing.py, run:
 
 ::
 
> cd $lldb/test
> python dotest.py --executable  -p TestInferiorCrashing.py 
../packages/Python/lldbsuite/test
 
-If the test is not specified by name (e.g. if you leave the -p argument off), 
LLDB will run all tests in that directory:
+If the test is not specified by name (e.g. if you leave the -p argument off),
+LLDB will run all tests in that directory:
 
 ::
 
@@ -63,11 +66,11 @@ Many more options that are available. To
 
> python dotest.py -h
 
-The ``dotest.py`` script runs tests in parallel by default. To disable the 
parallel
-test running feature, use the ``--no-multiprocess`` flag. The number of 
concurrent
-tests is controlled by the ``LLDB_TEST_THREADS`` environment variable or the
-``--threads command`` line parameter. The default value is the number of CPU 
cores
-on your system.
+The ``dotest.py`` script runs tests in parallel by default. To disable the
+parallel test running feature, use the ``--no-multiprocess`` flag. The number
+of concurrent tests is controlled by the ``LLDB_TEST_THREADS`` environment
+variable or the ``--threads command`` line parameter. The default value is the
+number of CPU cores on your system.
 
 The parallel test running feature will handle an additional ``--test-subdir
 SUBDIR`` arg. When specified, ``SUBDIR`` is relative to the root test directory


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


[Lldb-commits] [lldb] r360219 - [Docs] Fix incorrect heading and update titles.

2019-05-07 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue May  7 18:51:26 2019
New Revision: 360219

URL: http://llvm.org/viewvc/llvm-project?rev=360219&view=rev
Log:
[Docs] Fix incorrect heading and update titles.

This patch fixes two incorrect headings in source.rst which caused it to
show up on the homepage. I also updated the titles to have more sensible
links there.

Modified:
lldb/trunk/docs/index.rst
lldb/trunk/docs/resources/download.rst
lldb/trunk/docs/resources/source.rst

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=360219&r1=360218&r2=360219&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Tue May  7 18:51:26 2019
@@ -51,9 +51,9 @@ Resources
:maxdepth: 1
 
resources/download
+   resources/source
resources/build
resources/test
-   resources/source
resources/bots
resources/sbapi
 

Modified: lldb/trunk/docs/resources/download.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/download.rst?rev=360219&r1=360218&r2=360219&view=diff
==
--- lldb/trunk/docs/resources/download.rst (original)
+++ lldb/trunk/docs/resources/download.rst Tue May  7 18:51:26 2019
@@ -1,4 +1,4 @@
-Download
+Releases
 
 
 Nightly Builds

Modified: lldb/trunk/docs/resources/source.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/source.rst?rev=360219&r1=360218&r2=360219&view=diff
==
--- lldb/trunk/docs/resources/source.rst (original)
+++ lldb/trunk/docs/resources/source.rst Tue May  7 18:51:26 2019
@@ -1,5 +1,5 @@
-Checking out LLDB Sources
-=
+Getting the Sources
+===
 
 Refer to the `LLVM Getting Started Guide
 `_
@@ -33,7 +33,7 @@ Clang in these locations.  Refer to the
 particular platform / build system combination.
 
 Contributing to LLDB
-
+
 
 Please refer to the `LLVM Developer Policy
 `_ for information about
@@ -48,7 +48,7 @@ policy.
 
 
 Error handling and use of assertions in LLDB
-
+
 
 Contrary to Clang, which is typically a short-lived process, LLDB
 debuggers stay up and running for a long time, often serving multiple
@@ -65,7 +65,7 @@ rules of thumb:
   used. Functions that may fail should return their result using these
   wrapper types instead of using a bool to indicate success. Returning
   a default value when an error occurred is also discouraged.
-  
+
 * Assertions.  Assertions (from `assert.h`) should be used liberally
   to assert internal consistency.  Assertions shall **never** be
   used to detect invalid user input, such as malformed DWARF.  An
@@ -75,11 +75,11 @@ rules of thumb:
   checks in an assertion may be more expensive than otherwise
   permissible. In combination with the LLDB test suite, assertions are
   what allows us to refactor and evolve the LLDB code base.
-   
+
 * Logging. LLDB provides a very rich logging API. When recoverable
   errors cannot reasonably by surfaced to the end user, the error may
   be written to a topical log channel.
-
+
 * Soft assertions.  LLDB provides `lldb_assert()` as a soft
   alternative to cover the middle ground of situations that indicate a
   recoverable bug in LLDB.  In a Debug configuration `lldb_assert()`


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