Re: [Lldb-commits] [PATCH] D17420: Don't use an atexit handler for cleaning up process specific temp dir

2016-02-19 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.

So, linux actually manages to invoke the atexit handlers (through some deep 
magic, no doubt) upon shared library unload, so we are ok here (plus linux 
likes to nuke /tmp after every reboot). LGTM, with a small RAII request.



Comment at: source/Host/common/HostInfoBase.cpp:86
@@ +85,3 @@
+{
+CleanupProcessSpecificLLDBTempDir();
+delete g_fields;

I think we should move this into the destructor of `g_fields`. Then you can 
simply do `delete g_fields` (or even `g_fields.reset()`) here.


http://reviews.llvm.org/D17420



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


[Lldb-commits] [lldb] r261313 - Mark TestLldbGdbServer.test_software_breakpoint_set_and_remove_work_llgs as flaky on linux

2016-02-19 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Feb 19 04:36:31 2016
New Revision: 261313

URL: http://llvm.org/viewvc/llvm-project?rev=261313&view=rev
Log:
Mark TestLldbGdbServer.test_software_breakpoint_set_and_remove_work_llgs as 
flaky on linux

The problem is the asynchronous arrival of inferior stdio (pr25652).

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py?rev=261313&r1=261312&r2=261313&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
 Fri Feb 19 04:36:31 2016
@@ -1232,6 +1232,7 @@ class LldbGdbServerTestCase(gdbremote_te
 self.software_breakpoint_set_and_remove_work()
 
 @llgs_test
+@expectedFlakeyLinux("llvm.org/pr25652")
 def test_software_breakpoint_set_and_remove_work_llgs(self):
 self.init_llgs_test()
 self.build()


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


[Lldb-commits] [lldb] r261314 - Enable TestUnicodeLiterals

2016-02-19 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Feb 19 04:36:38 2016
New Revision: 261314

URL: http://llvm.org/viewvc/llvm-project?rev=261314&view=rev
Log:
Enable TestUnicodeLiterals

Test should work everywhere except windows now.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py?rev=261314&r1=261313&r2=261314&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
 Fri Feb 19 04:36:38 2016
@@ -7,7 +7,6 @@ from __future__ import print_function
 
 
 
-import unittest2
 import os, time
 import lldb
 from lldbsuite.test.decorators import *
@@ -31,21 +30,18 @@ class UnicodeLiteralsTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@unittest2.expectedFailure("rdar://18684408")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name 
lookup not working correctly on Windows")
 def test_expr1(self):
 """Test that the expression parser returns proper Unicode strings."""
 self.build()
 self.rdar12991846(expr=1)
 
-@unittest2.expectedFailure("rdar://18684408")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name 
lookup not working correctly on Windows")
 def test_expr2(self):
 """Test that the expression parser returns proper Unicode strings."""
 self.build()
 self.rdar12991846(expr=2)
 
-@unittest2.expectedFailure("rdar://18684408")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name 
lookup not working correctly on Windows")
 def test_expr3(self):
 """Test that the expression parser returns proper Unicode strings."""


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


[Lldb-commits] [lldb] r261318 - Stack unwinding emulation: handle adjustment of FP

2016-02-19 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Fri Feb 19 04:59:25 2016
New Revision: 261318

URL: http://llvm.org/viewvc/llvm-project?rev=261318&view=rev
Log:
Stack unwinding emulation: handle adjustment of FP

This change is improving the instruction emulation based unwinding to
handle when the frame pointer is adjusted (increment/decrement) after
it has been initialized. The situation can occur in the prologue of
some function where FP is adjusted before it is copied back to SP.

Example code (thumb, generated by gcc 4.8):
< +0>: push  {r4, r7, lr}
< +2>: sub   sp, #0x14
< +4>: add   r7, sp, #0x0
...
<+50>: adds  r7, #0x14 ; The CL fixes the handling of this instruction
<+52>: mov   sp, r7; Previously unwinding from here was broken
<+54>: pop   {r4, r7, pc}

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

Modified:

lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Modified: 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=261318&r1=261317&r2=261318&view=diff
==
--- 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
 Fri Feb 19 04:59:25 2016
@@ -554,7 +554,6 @@ UnwindAssemblyInstEmulation::WriteRegist
 case EmulateInstruction::eContextTableBranchReadMemory:
 case EmulateInstruction::eContextWriteRegisterRandomBits:
 case EmulateInstruction::eContextWriteMemoryRandomBits:
-case EmulateInstruction::eContextArithmetic:
 case EmulateInstruction::eContextAdvancePC:
 case EmulateInstruction::eContextReturnFromException:
 case EmulateInstruction::eContextPushRegisterOnStack:
@@ -573,6 +572,22 @@ UnwindAssemblyInstEmulation::WriteRegist
 //}
 break;
 
+case EmulateInstruction::eContextArithmetic:
+{
+// If we adjusted the current frame pointer by a constant then 
adjust the CFA offset
+// with the same amount.
+lldb::RegisterKind kind = m_unwind_plan_ptr->GetRegisterKind();
+if (m_fp_is_cfa && reg_info->kinds[kind] == 
m_cfa_reg_info.kinds[kind] &&
+context.info_type == 
EmulateInstruction::eInfoTypeRegisterPlusOffset &&
+context.info.RegisterPlusOffset.reg.kinds[kind] == 
m_cfa_reg_info.kinds[kind])
+{
+const int64_t offset = 
context.info.RegisterPlusOffset.signed_offset;
+m_curr_row->GetCFAValue().IncOffset(-1 * offset);
+m_curr_row_modified = true;
+}
+}
+break;
+
 case EmulateInstruction::eContextAbsoluteBranchRegister:
 case EmulateInstruction::eContextRelativeBranchImmediate:
 {


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


Re: [Lldb-commits] [PATCH] D17295: Stack unwinding emulation: handle adjustment of FP

2016-02-19 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261318: Stack unwinding emulation: handle adjustment of FP 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D17295?vs=48078&id=48472#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17295

Files:
  
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Index: 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
===
--- 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -554,7 +554,6 @@
 case EmulateInstruction::eContextTableBranchReadMemory:
 case EmulateInstruction::eContextWriteRegisterRandomBits:
 case EmulateInstruction::eContextWriteMemoryRandomBits:
-case EmulateInstruction::eContextArithmetic:
 case EmulateInstruction::eContextAdvancePC:
 case EmulateInstruction::eContextReturnFromException:
 case EmulateInstruction::eContextPushRegisterOnStack:
@@ -573,6 +572,22 @@
 //}
 break;
 
+case EmulateInstruction::eContextArithmetic:
+{
+// If we adjusted the current frame pointer by a constant then 
adjust the CFA offset
+// with the same amount.
+lldb::RegisterKind kind = m_unwind_plan_ptr->GetRegisterKind();
+if (m_fp_is_cfa && reg_info->kinds[kind] == 
m_cfa_reg_info.kinds[kind] &&
+context.info_type == 
EmulateInstruction::eInfoTypeRegisterPlusOffset &&
+context.info.RegisterPlusOffset.reg.kinds[kind] == 
m_cfa_reg_info.kinds[kind])
+{
+const int64_t offset = 
context.info.RegisterPlusOffset.signed_offset;
+m_curr_row->GetCFAValue().IncOffset(-1 * offset);
+m_curr_row_modified = true;
+}
+}
+break;
+
 case EmulateInstruction::eContextAbsoluteBranchRegister:
 case EmulateInstruction::eContextRelativeBranchImmediate:
 {


Index: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
===
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -554,7 +554,6 @@
 case EmulateInstruction::eContextTableBranchReadMemory:
 case EmulateInstruction::eContextWriteRegisterRandomBits:
 case EmulateInstruction::eContextWriteMemoryRandomBits:
-case EmulateInstruction::eContextArithmetic:
 case EmulateInstruction::eContextAdvancePC:
 case EmulateInstruction::eContextReturnFromException:
 case EmulateInstruction::eContextPushRegisterOnStack:
@@ -573,6 +572,22 @@
 //}
 break;
 
+case EmulateInstruction::eContextArithmetic:
+{
+// If we adjusted the current frame pointer by a constant then adjust the CFA offset
+// with the same amount.
+lldb::RegisterKind kind = m_unwind_plan_ptr->GetRegisterKind();
+if (m_fp_is_cfa && reg_info->kinds[kind] == m_cfa_reg_info.kinds[kind] &&
+context.info_type == EmulateInstruction::eInfoTypeRegisterPlusOffset &&
+context.info.RegisterPlusOffset.reg.kinds[kind] == m_cfa_reg_info.kinds[kind])
+{
+const int64_t offset = context.info.RegisterPlusOffset.signed_offset;
+m_curr_row->GetCFAValue().IncOffset(-1 * offset);
+m_curr_row_modified = true;
+}
+}
+break;
+
 case EmulateInstruction::eContextAbsoluteBranchRegister:
 case EmulateInstruction::eContextRelativeBranchImmediate:
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D17266: delete unused function in ClangExpressionParser`

2016-02-19 Thread Ewan Crawford via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261328: Delete unused function in ClangExpressionParser 
(authored by EwanCrawford).

Changed prior to commit:
  http://reviews.llvm.org/D17266?vs=47980&id=48484#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17266

Files:
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Index: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -87,21 +87,6 @@
 // Utility Methods for Clang
 
//===--===//
 
-std::string GetBuiltinIncludePath(const char *Argv0) {
-SmallString<128> P(llvm::sys::fs::getMainExecutable(
-Argv0, (void *)(intptr_t) GetBuiltinIncludePath));
-
-if (!P.empty()) {
-llvm::sys::path::remove_filename(P); // Remove /clang from 
foo/bin/clang
-llvm::sys::path::remove_filename(P); // Remove /bin   from foo/bin
-
-// Get foo/lib/clang//include
-llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING,
-"include");
-}
-
-return P.str();
-}
 
 class ClangExpressionParser::LLDBPreprocessorCallbacks : public PPCallbacks
 {


Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -87,21 +87,6 @@
 // Utility Methods for Clang
 //===--===//
 
-std::string GetBuiltinIncludePath(const char *Argv0) {
-SmallString<128> P(llvm::sys::fs::getMainExecutable(
-Argv0, (void *)(intptr_t) GetBuiltinIncludePath));
-
-if (!P.empty()) {
-llvm::sys::path::remove_filename(P); // Remove /clang from foo/bin/clang
-llvm::sys::path::remove_filename(P); // Remove /bin   from foo/bin
-
-// Get foo/lib/clang//include
-llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING,
-"include");
-}
-
-return P.str();
-}
 
 class ClangExpressionParser::LLDBPreprocessorCallbacks : public PPCallbacks
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r261328 - Delete unused function in ClangExpressionParser

2016-02-19 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Fri Feb 19 08:31:41 2016
New Revision: 261328

URL: http://llvm.org/viewvc/llvm-project?rev=261328&view=rev
Log:
Delete unused function in ClangExpressionParser

[git 65dafa83] introduced the GetBuiltinIncludePath function copied from 
cfe/lib/Driver/CC1Options.cpp

This function is no longer used in lldb's expression parser and I believe it is 
safe to remove it.


Author: Luke Drummond 
Differential Revision: http://reviews.llvm.org/D17266

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=261328&r1=261327&r2=261328&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Fri Feb 19 08:31:41 2016
@@ -87,21 +87,6 @@ using namespace lldb_private;
 // Utility Methods for Clang
 
//===--===//
 
-std::string GetBuiltinIncludePath(const char *Argv0) {
-SmallString<128> P(llvm::sys::fs::getMainExecutable(
-Argv0, (void *)(intptr_t) GetBuiltinIncludePath));
-
-if (!P.empty()) {
-llvm::sys::path::remove_filename(P); // Remove /clang from 
foo/bin/clang
-llvm::sys::path::remove_filename(P); // Remove /bin   from foo/bin
-
-// Get foo/lib/clang//include
-llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING,
-"include");
-}
-
-return P.str();
-}
 
 class ClangExpressionParser::LLDBPreprocessorCallbacks : public PPCallbacks
 {


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


Re: [Lldb-commits] [PATCH] D17167: Fix bug with register values byte order in expression evaluation

2016-02-19 Thread Marianne Mailhot-Sarrasin via lldb-commits
mamai updated this revision to Diff 48486.
mamai added a comment.

I have updated the patch to add the assertion.


Repository:
  rL LLVM

http://reviews.llvm.org/D17167

Files:
  source/Expression/Materializer.cpp

Index: source/Expression/Materializer.cpp
===
--- source/Expression/Materializer.cpp
+++ source/Expression/Materializer.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/LLDBAssert.h"
 
 using namespace lldb_private;
 
@@ -1275,9 +1276,14 @@
 m_register_contents.reset(new 
DataBufferHeap(register_data.GetDataStart(), register_data.GetByteSize()));
 
 Error write_error;
-
-map.WriteMemory(load_addr, register_data.GetDataStart(), 
register_data.GetByteSize(), write_error);
-
+
+Scalar scalar;
+reg_value.GetScalarValue(scalar);
+
+lldbassert(scalar.GetByteSize() == register_data.GetByteSize());
+
+map.WriteScalarToMemory(load_addr, scalar, scalar.GetByteSize(), 
write_error);
+
 if (!write_error.Success())
 {
 err.SetErrorStringWithFormat("couldn't write the contents of 
register %s: %s", m_register_info.name, write_error.AsCString());


Index: source/Expression/Materializer.cpp
===
--- source/Expression/Materializer.cpp
+++ source/Expression/Materializer.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/LLDBAssert.h"
 
 using namespace lldb_private;
 
@@ -1275,9 +1276,14 @@
 m_register_contents.reset(new DataBufferHeap(register_data.GetDataStart(), register_data.GetByteSize()));
 
 Error write_error;
-
-map.WriteMemory(load_addr, register_data.GetDataStart(), register_data.GetByteSize(), write_error);
-
+
+Scalar scalar;
+reg_value.GetScalarValue(scalar);
+
+lldbassert(scalar.GetByteSize() == register_data.GetByteSize());
+
+map.WriteScalarToMemory(load_addr, scalar, scalar.GetByteSize(), write_error);
+
 if (!write_error.Success())
 {
 err.SetErrorStringWithFormat("couldn't write the contents of register %s: %s", m_register_info.name, write_error.AsCString());
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D17449: Handle the case when a variable is only valid in part of the enclosing scope

2016-02-19 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added reviewers: ovyalov, clay.chang.
tberghammer added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer.

Handle the case when a variable is only valid in part of the enclosing scope

DWARF stores this information in the DW_AT_start_scope attribute. This
CL add support for this attribute and also changes the functions
displaying frame variables to only display the variables currently in
scope.

Note: This CL is part of an effort to make LLDB capable of debugging Java code 
JIT-ed by the android runtime

http://reviews.llvm.org/D17449

Files:
  include/lldb/Core/RangeMap.h
  include/lldb/Symbol/Block.h
  include/lldb/Symbol/Variable.h
  source/API/SBBlock.cpp
  source/API/SBFrame.cpp
  source/Core/Address.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Symbol/Block.cpp
  source/Symbol/Variable.cpp
  source/Target/StackFrame.cpp

Index: source/Target/StackFrame.cpp
===
--- source/Target/StackFrame.cpp
+++ source/Target/StackFrame.cpp
@@ -540,7 +540,11 @@
 const bool can_create = true;
 const bool stop_if_child_block_is_inlined_function = true;
 m_variable_list_sp.reset(new VariableList());
-frame_block->AppendBlockVariables(can_create, get_child_variables, stop_if_child_block_is_inlined_function, m_variable_list_sp.get());
+frame_block->AppendBlockVariables(can_create,
+  get_child_variables,
+  stop_if_child_block_is_inlined_function,
+  [this](Variable* v) { return v->IsInScope(this); },
+  m_variable_list_sp.get());
 }
 }
 
@@ -584,6 +588,7 @@
 m_sc.block->AppendVariables (can_create, 
  get_parent_variables,
  stop_if_block_is_inlined_function,
+ [this](Variable* v) { return v->IsInScope(this); },
  var_list_sp.get());
 }
  
Index: source/Symbol/Variable.cpp
===
--- source/Symbol/Variable.cpp
+++ source/Symbol/Variable.cpp
@@ -43,6 +43,7 @@
 const lldb::SymbolFileTypeSP &symfile_type_sp,
 ValueType scope,
 SymbolContextScope *context,
+const RangeList& scope_range,
 Declaration* decl_ptr,
 const DWARFExpression& location,
 bool external,
@@ -54,6 +55,7 @@
 m_symfile_type_sp(symfile_type_sp),
 m_scope(scope),
 m_owner_scope(context),
+m_scope_range(scope_range),
 m_declaration(decl_ptr),
 m_location(location),
 m_external(external),
@@ -356,14 +358,21 @@
 {
 SymbolContext variable_sc;
 CalculateSymbolContext (&variable_sc);
+
 // Check for static or global variable defined at the compile unit 
 // level that wasn't defined in a block
 if (variable_sc.block == nullptr)
-return true;
-
-if (variable_sc.block == deepest_frame_block)
 return true;
-return variable_sc.block->Contains (deepest_frame_block);
+
+// Check if the variable is valid in the current block
+if (variable_sc.block != deepest_frame_block &&
+!variable_sc.block->Contains(deepest_frame_block))
+{
+return false;
+}
+
+addr_t file_address = frame->GetFrameCodeAddress().GetFileAddress();
+return m_scope_range.FindEntryThatContains(file_address) != nullptr;
 }
 }
 break;
Index: source/Symbol/Block.cpp
===
--- source/Symbol/Block.cpp
+++ source/Symbol/Block.cpp
@@ -486,16 +486,24 @@
 Block::AppendBlockVariables (bool can_create,
  bool get_child_block_variables,
  bool stop_if_child_block_is_inlined_function,
+ const std::function& filter,
  VariableList *variable_list)
 {
 uint32_t num_variables_added = 0;
 VariableList *block_var_list = GetBlockVariableList (can_create).get();
 if (block_var_list)
 {
-num_variables_added += block_var_list->GetSize();
-variable_list->AddVariables (block_var_list);
+for (size_t i = 0; i < block_var_list->GetSize(); ++i)
+{
+VariableSP variable = block_var_list->GetVariableAtIndex(i);
+if (filter(variable.get()))
+{
+ 

[Lldb-commits] [PATCH] D17450: Add support for handling absolute symbols in ELF

2016-02-19 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added reviewers: ovyalov, clayborg.
tberghammer added a subscriber: lldb-commits.

Add support for handling absolute symbols in ELF

Most address represented in lldb as section plus offset and handling of
absolute addresses is problematic in several location because of lack
of necessary information (e.g. Target) or because of performance issues.

This CL change the way ObjectFileELF handle the absolute symbols with
creating a pseudo section for each symbol. With this change all existing
code designed to work with addresses in the form of section plus offset
will work with absolute symbols as well.

http://reviews.llvm.org/D17450

Files:
  include/lldb/lldb-enumerations.h
  source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Symbol/ObjectFile.cpp
  source/Utility/ConvertEnum.cpp

Index: source/Utility/ConvertEnum.cpp
===
--- source/Utility/ConvertEnum.cpp
+++ source/Utility/ConvertEnum.cpp
@@ -115,6 +115,8 @@
 return "compact-unwind";
 case eSectionTypeGoSymtab:
 return "go-symtab";
+case eSectionTypeAbsoluteAddress:
+return "absolute";
 case eSectionTypeOther:
 return "regular";
 }
Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -379,6 +379,7 @@
 case eSectionTypeARMextab:
 case eSectionTypeCompactUnwind:
 return eAddressClassRuntime;
+case eSectionTypeAbsoluteAddress:
 case eSectionTypeELFSymbolTable:
 case eSectionTypeELFDynamicSymbols:
 case eSectionTypeELFRelocationEntries:
Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===
--- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1388,6 +1388,7 @@
 case eSectionTypeCompactUnwind:
 return eAddressClassRuntime;
 
+case eSectionTypeAbsoluteAddress:
 case eSectionTypeELFSymbolTable:
 case eSectionTypeELFDynamicSymbols:
 case eSectionTypeELFRelocationEntries:
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -921,10 +921,14 @@
 // Iterate through the object file sections to find all
 // of the sections that have SHF_ALLOC in their flag bits.
 SectionSP section_sp (section_list->GetSectionAtIndex (sect_idx));
-// if (section_sp && !section_sp->IsThreadSpecific())
 if (section_sp && section_sp->Test(SHF_ALLOC))
 {
-lldb::addr_t load_addr = section_sp->GetFileAddress() + value;
+lldb::addr_t load_addr = section_sp->GetFileAddress();
+// We don't want to update the load address of a section with type
+// eSectionTypeAbsoluteAddress as they already have the absolute load address
+// already specified
+if (section_sp->GetType() != eSectionTypeAbsoluteAddress)
+load_addr += value;
 
 // On 32-bit systems the load address have to fit into 4 bytes. The rest of
 // the bytes are the overflow from the addition.
@@ -2058,6 +2062,8 @@
 
 ArchSpec arch;
 GetArchitecture(arch);
+ModuleSP module_sp(GetModule());
+SectionList* module_section_list = module_sp ? module_sp->GetSectionList() : nullptr;
 
 // Local cache to avoid doing a FindSectionByName for each symbol. The "const char*" key must
 // came from a ConstString object so they can be compared by pointer
@@ -2278,30 +2284,44 @@
 }
 }
 
-// symbol_value_offset may contain 0 for ARM symbols or -1 for
-// THUMB symbols. See above for more details.
+// symbol_value_offset may contain 0 for ARM symbols or -1 for THUMB symbols. See above for
+// more details.
 uint64_t symbol_value = symbol.st_value + symbol_value_offset;
+
+if (symbol_section_sp == nullptr && symbol.st_size != 0)
+{
+// We don't have a section for a symbol with non-zero size. Create a new section for it
+// so the address range covered by the symbol is also covered by the module (represented
+// through the section list). It is needed so module lookup for the 

[Lldb-commits] [lldb] r261333 - Remove XFAIL from test passing on FreeBSD

2016-02-19 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Feb 19 10:58:08 2016
New Revision: 261333

URL: http://llvm.org/viewvc/llvm-project?rev=261333&view=rev
Log:
Remove XFAIL from test passing on FreeBSD

Both Linux and FreeBSD had a comment "This needs to be root-caused."
It looks like the failure has been fixed on both, and the Linux XFAIL
decorator was removed in r233716 (Mar 2015).

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py?rev=261333&r1=261332&r2=261333&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
 Fri Feb 19 10:58:08 2016
@@ -30,7 +30,6 @@ class DynamicValueTestCase(TestBase):
'// Break here and get 
real address of reallyA.')
 
 @add_test_categories(['pyapi'])
-@expectedFailureFreeBSD # FIXME: This needs to be root-caused.
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
 def test_get_dynamic_vals(self):
 """Test fetching C++ dynamic values from pointers & references."""


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


[Lldb-commits] [lldb] r261339 - Remove XFAIL from test passing on FreeBSD

2016-02-19 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Feb 19 11:31:05 2016
New Revision: 261339

URL: http://llvm.org/viewvc/llvm-project?rev=261339&view=rev
Log:
Remove XFAIL from test passing on FreeBSD

This is passing for me consistently on FreeBSD 10 and FreeBSD 11.

llvm.org/pr15989

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py?rev=261339&r1=261338&r2=261339&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 Fri Feb 19 11:31:05 2016
@@ -55,7 +55,6 @@ class CrashingRecursiveInferiorTestCase(
 self.build()
 self.recursive_inferior_crashing_step_after_break()
 
-@expectedFailureFreeBSD('llvm.org/pr15989') # Couldn't allocate space for 
the stack frame
 @skipIfLinux # Inferior exits after stepping after a segfault. This is 
working as intended IMHO.
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
 def test_recursive_inferior_crashing_expr_step_and_expr(self):


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


[Lldb-commits] [lldb] r261340 - Remove XFAIL from test passing on FreeBSD

2016-02-19 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Feb 19 11:35:01 2016
New Revision: 261340

URL: http://llvm.org/viewvc/llvm-project?rev=261340&view=rev
Log:
Remove XFAIL from test passing on FreeBSD

There is a report in the PR from several months ago that it failed
intermittently, but it is passing consistently for me on FreeBSD 10
and 11.  We can re-add a decorator if further testing shows it is
still flakey.

llvm.org/pr17214

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py?rev=261340&r1=261339&r2=261340&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
 Fri Feb 19 11:35:01 2016
@@ -15,7 +15,6 @@ class TestInlineStepping(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @add_test_categories(['pyapi'])
-@expectedFailureFreeBSD('llvm.org/pr17214')
 @expectedFailureAll(compiler="icc", bugnumber="# Not really a bug.  ICC 
combines two inlined functions.")
 def test_with_python_api(self):
 """Test stepping over and into inlined functions."""


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


[Lldb-commits] [PATCH] D17455: Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Ed Maste via lldb-commits
emaste created this revision.
emaste added a reviewer: zturner.
emaste added a subscriber: lldb-commits.

All invocations are updated to use the generic expectedFailureAll.


http://reviews.llvm.org/D17455

Files:
  packages/Python/lldbsuite/test/decorators.py
  
packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
  packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
  
packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
  packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
  
packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
  
packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
  
packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
  
packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
  packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
  packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
  packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
  packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
  packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
  packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py

Index: packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
@@ -49,7 +49,7 @@
 
 @llgs_test
 @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
-@expectedFailureFreeBSD()
+@expectedFailureAll(oslist=['freebsd'])
 def test_sid_is_same_without_setsid_llgs(self):
 self.init_llgs_test()
 self.set_inferior_startup_launch()
Index: packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
===
--- packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
+++ packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
@@ -39,7 +39,7 @@
 self.run_to_address(self.exe_name)
 
 @add_test_categories(['pyapi'])
-@expectedFailureFreeBSD # llvm.org/pr20476
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20476')
 @expectedFailureAll(oslist=["windows"])
 def test_step_out_of_malloc_into_function_b(self):
 """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b()."""
Index: packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
===
--- packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
+++ packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
@@ -11,7 +11,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @python_api_test
-@expectedFailureFreeBSD('llvm.org/pr24895')
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24895')
 @skipIfRemote # Not remote test suite ready
 @skipUnlessGoInstalled
 def test_with_dsym_and_python_api(self):
Index: packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
===
--- packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
+++ packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -10,7 +10,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureFreeBSD("llvm.org/pr25925")
+@expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25925")
 @expectedFailureAll(compiler="gcc", compiler_version=[">", "4.9"])
 def test_with_run_command(self):
 """Tests imported namespaces in C++."""
Index: packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
===
--- packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -51,7 +51,7 @@
 
 @expectedFailureDarwin(9980907)
 @expectedFailureAll(compiler=["clang"

[Lldb-commits] [lldb] r261345 - refactor/cleanup ClangExpressionParser::Parse

2016-02-19 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Fri Feb 19 11:55:10 2016
New Revision: 261345

URL: http://llvm.org/viewvc/llvm-project?rev=261345&view=rev
Log:
refactor/cleanup ClangExpressionParser::Parse

This patches does the following:

+ fix return type: ClangExpressionParser::Parse returns unsigned, but was 
actually returning a signed value, num_errors.
+ use helper clang::TextDiagnosticBuffer::getNumErrors() instead of counting 
the errors ourself.
+ limit scoping of block-level automatic variables as much as practical.
+ remove reused multipurpose TextDiagnosticBuffer::const_iterator in favour of 
loop-scoped err, warn, and note variables in the diagnostic printing code.
+ refactor diagnostic printing loops to use a proper loop invariant.

Author: Luke Drummond 
Differential Revision: http://reviews.llvm.org/D17273

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=261345&r1=261344&r2=261345&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Fri Feb 19 11:55:10 2016
@@ -435,37 +435,34 @@ ClangExpressionParser::~ClangExpressionP
 }
 
 unsigned
-ClangExpressionParser::Parse (Stream &stream)
+ClangExpressionParser::Parse(Stream &stream)
 {
-TextDiagnosticBuffer *diag_buf = 
static_cast(m_compiler->getDiagnostics().getClient());
-
-diag_buf->FlushDiagnostics (m_compiler->getDiagnostics());
+TextDiagnosticBuffer *diag_buf = static_cast(m_compiler->getDiagnostics().getClient());
+diag_buf->FlushDiagnostics(m_compiler->getDiagnostics());
 
 const char *expr_text = m_expr.Text();
 
-clang::SourceManager &SourceMgr = m_compiler->getSourceManager();
+clang::SourceManager &source_mgr = m_compiler->getSourceManager();
 bool created_main_file = false;
 if (m_compiler->getCodeGenOpts().getDebugInfo() == 
codegenoptions::FullDebugInfo)
 {
-std::string temp_source_path;
-
 int temp_fd = -1;
 llvm::SmallString result_path;
 FileSpec tmpdir_file_spec;
 if (HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir, 
tmpdir_file_spec))
 {
 tmpdir_file_spec.AppendPathComponent("lldb-%%.expr");
-temp_source_path = tmpdir_file_spec.GetPath();
+std::string temp_source_path = tmpdir_file_spec.GetPath();
 llvm::sys::fs::createUniqueFile(temp_source_path, temp_fd, 
result_path);
 }
 else
 {
 llvm::sys::fs::createTemporaryFile("lldb", "expr", temp_fd, 
result_path);
 }
-
+
 if (temp_fd != -1)
 {
-lldb_private::File file (temp_fd, true);
+lldb_private::File file(temp_fd, true);
 const size_t expr_text_len = strlen(expr_text);
 size_t bytes_written = expr_text_len;
 if (file.Write(expr_text, bytes_written).Success())
@@ -473,9 +470,8 @@ ClangExpressionParser::Parse (Stream &st
 if (bytes_written == expr_text_len)
 {
 file.Close();
-SourceMgr.setMainFileID(SourceMgr.createFileID(
-m_file_manager->getFile(result_path),
-SourceLocation(), SrcMgr::C_User));
+
source_mgr.setMainFileID(source_mgr.createFileID(m_file_manager->getFile(result_path),
+ 
SourceLocation(), SrcMgr::C_User));
 created_main_file = true;
 }
 }
@@ -485,7 +481,7 @@ ClangExpressionParser::Parse (Stream &st
 if (!created_main_file)
 {
 std::unique_ptr memory_buffer = 
MemoryBuffer::getMemBufferCopy(expr_text, __FUNCTION__);
-
SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(memory_buffer)));
+
source_mgr.setMainFileID(source_mgr.createFileID(std::move(memory_buffer)));
 }
 
 diag_buf->BeginSourceFile(m_compiler->getLangOpts(), 
&m_compiler->getPreprocessor());
@@ -510,34 +506,25 @@ ClangExpressionParser::Parse (Stream &st
 
 diag_buf->EndSourceFile();
 
-TextDiagnosticBuffer::const_iterator diag_iterator;
+unsigned num_errors = diag_buf->getNumErrors();
 
-int num_errors = 0;
-
 if (m_pp_callbacks && m_pp_callbacks->hasErrors())
 {
 num_errors++;
-
 stream.PutCString(m_pp_callbacks->getErrorString().c_str());
 }
 
-for (diag_iterator = diag_buf->warn_begin();
- diag_iterator != diag_buf->warn_end();
- ++diag_iterator)
-stream.Printf("warning: %s\n", (*diag_iterator).second.c_str());
-
-for (

Re: [Lldb-commits] [PATCH] D17273: refactor/cleanup ClangExpressionParser::Parse

2016-02-19 Thread Ewan Crawford via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261345: refactor/cleanup ClangExpressionParser::Parse 
(authored by EwanCrawford).

Changed prior to commit:
  http://reviews.llvm.org/D17273?vs=48002&id=48507#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17273

Files:
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -435,47 +435,43 @@
 }
 
 unsigned
-ClangExpressionParser::Parse (Stream &stream)
+ClangExpressionParser::Parse(Stream &stream)
 {
-TextDiagnosticBuffer *diag_buf = static_cast(m_compiler->getDiagnostics().getClient());
-
-diag_buf->FlushDiagnostics (m_compiler->getDiagnostics());
+TextDiagnosticBuffer *diag_buf = static_cast(m_compiler->getDiagnostics().getClient());
+diag_buf->FlushDiagnostics(m_compiler->getDiagnostics());
 
 const char *expr_text = m_expr.Text();
 
-clang::SourceManager &SourceMgr = m_compiler->getSourceManager();
+clang::SourceManager &source_mgr = m_compiler->getSourceManager();
 bool created_main_file = false;
 if (m_compiler->getCodeGenOpts().getDebugInfo() == codegenoptions::FullDebugInfo)
 {
-std::string temp_source_path;
-
 int temp_fd = -1;
 llvm::SmallString result_path;
 FileSpec tmpdir_file_spec;
 if (HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir, tmpdir_file_spec))
 {
 tmpdir_file_spec.AppendPathComponent("lldb-%%.expr");
-temp_source_path = tmpdir_file_spec.GetPath();
+std::string temp_source_path = tmpdir_file_spec.GetPath();
 llvm::sys::fs::createUniqueFile(temp_source_path, temp_fd, result_path);
 }
 else
 {
 llvm::sys::fs::createTemporaryFile("lldb", "expr", temp_fd, result_path);
 }
-
+
 if (temp_fd != -1)
 {
-lldb_private::File file (temp_fd, true);
+lldb_private::File file(temp_fd, true);
 const size_t expr_text_len = strlen(expr_text);
 size_t bytes_written = expr_text_len;
 if (file.Write(expr_text, bytes_written).Success())
 {
 if (bytes_written == expr_text_len)
 {
 file.Close();
-SourceMgr.setMainFileID(SourceMgr.createFileID(
-m_file_manager->getFile(result_path),
-SourceLocation(), SrcMgr::C_User));
+source_mgr.setMainFileID(source_mgr.createFileID(m_file_manager->getFile(result_path),
+ SourceLocation(), SrcMgr::C_User));
 created_main_file = true;
 }
 }
@@ -485,7 +481,7 @@
 if (!created_main_file)
 {
 std::unique_ptr memory_buffer = MemoryBuffer::getMemBufferCopy(expr_text, __FUNCTION__);
-SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(memory_buffer)));
+source_mgr.setMainFileID(source_mgr.createFileID(std::move(memory_buffer)));
 }
 
 diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor());
@@ -510,34 +506,25 @@
 
 diag_buf->EndSourceFile();
 
-TextDiagnosticBuffer::const_iterator diag_iterator;
+unsigned num_errors = diag_buf->getNumErrors();
 
-int num_errors = 0;
-
 if (m_pp_callbacks && m_pp_callbacks->hasErrors())
 {
 num_errors++;
-
 stream.PutCString(m_pp_callbacks->getErrorString().c_str());
 }
 
-for (diag_iterator = diag_buf->warn_begin();
- diag_iterator != diag_buf->warn_end();
- ++diag_iterator)
-stream.Printf("warning: %s\n", (*diag_iterator).second.c_str());
-
-for (diag_iterator = diag_buf->err_begin();
- diag_iterator != diag_buf->err_end();
- ++diag_iterator)
-{
-num_errors++;
-stream.Printf("error: %s\n", (*diag_iterator).second.c_str());
-}
-
-for (diag_iterator = diag_buf->note_begin();
- diag_iterator != diag_buf->note_end();
- ++diag_iterator)
-stream.Printf("note: %s\n", (*diag_iterator).second.c_str());
+for (TextDiagnosticBuffer::const_iterator warn = diag_buf->warn_begin(), warn_end = diag_buf->warn_end();
+ warn != warn_end; ++warn)
+stream.Printf("warning: %s\n", warn->second.c_str());
+
+for (TextDiagnosticBuffer::const_iterator err = diag_buf->err_begin(), err_end = diag_buf->err_end();
+ err != err_end; ++err)
+stream.Printf("error: %s\n", err->second.c_str());
+
+for (TextDiagnosticBuffer::const_iterator note = diag_buf->

Re: [Lldb-commits] [PATCH] D17455: Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: 
packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py:26-27
@@ -25,4 +25,4 @@
 @skipIfFreeBSD # llvm.org/pr24691 skipping to avoid crashing the test 
runner
-@expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 
complete object constructor
-@expectedFailureFreeBSD('llvm.org/pr24691') # we hit an assertion in clang
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19011 Newer 
Clang omits C1 complete object constructor')
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24691 we hit 
an assertion in clang')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")

We have `skipIfFreeBSD` and then 2 instances of `expectedFailureFreeBSD`, the 
second of which is a duplicate of the skip.  Maybe you could just delete the 
second line.


Comment at: 
packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py:22
@@ -21,3 +21,3 @@
 @skipIfRemote
-@expectedFailureFreeBSD('llvm.org/pr19310')
+@expectedFailureAll(oslist=['freebsd', bugnumber='llvm.org/pr19310')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")

Missing closing `]` after `'freebsd'`


http://reviews.llvm.org/D17455



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


Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

2016-02-19 Thread Greg Clayton via lldb-commits
clayborg added a comment.

General things to know about SymbolFiles:

- We use SymbolContext objects to refer to a specific symbol context: module, 
compile unit, function, deepest block, line entry and symbol.
- A load address should produce 1 symbol context. Never more.
- A file address can produce many symbol contexts. Think about looking up 
address 0x1000. On MacOSX all shared libraries have their file virtual 
addresses such that they start at 0x0, so many functions shortly after zero, so 
address 0x1000 can produce many matches since file addresses aren't unique
- file + line can match many symbol contexts. Think about what the user would 
expect if they typed:  (lldb) b vector:123
- SymbolFile objects produce IDs for compile units, functions, variables, 
types, and many other things by creating these objects with a "lldb::user_id_t" 
that makes sense for the SymbolFile itself such that if they are given this ID 
back and asked to parse further information, they should quickly be able to use 
that number to get back to the debug info and parse more. For DWARF we use the 
DIE offset. The only thing that isn't correctly abstracted right now is the 
file IDs, they are currently expected to be indexes into the support files. 
This works well for DWARF, but probably not for other formats. We can change 
this if needed as I mentioned before.



Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:98-100
@@ +97,5 @@
+{
+auto global = m_session->getGlobalScope();
+auto compilands = global->findAllChildren();
+return compilands->getChildCount();
+}

zturner wrote:
> clayborg wrote:
> > Do you want to cache the compile unit count, or is this really cheap to 
> > call over and over?
> Most of these methods are really cheap.  In fact, the entire process of 
> caching stuff in `SymbolContexts` and whatnot is probably unnecessary for us 
> in theory because while it may be cheaper performance wise to cache it the 
> way we're doing, it's not *that* expensive to just query the file, and when 
> you consider the memory usage of caching it a second time, it's not clear 
> it's a good tradeoff.
> 
> That said, there's not really a way around this with the current 
> architecture, so I only cache where necessary (can always add more later if 
> performance becomes an issue)
I was just talking about caching the number of compile units. You will be asked 
to create each individual lldb_private::CompileUnit by index with:

```
lldb::CompUnitSP
SymbolFilePDB::ParseCompileUnitAtIndex(uint32_t index) 
```

And you will be asked only once for a compile unit by index since the symbol 
vendor will cache those for you.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:257
@@ +256,3 @@
+auto compilands =
+m_session->findCompilandsForSourceFile(file_spec.GetPath(), 
llvm::PDB_NameSearchFlags::NS_CaseInsensitive);
+

> Just to make sure I understand what "support files" are.
> 
> If I have this file:
> 
> // foo.cpp
> #include "foo.h"
> #include 
> int main(int argc, char **argv) {
> return 0;
> }
> and I run clang.exe foo.cpp -o foo.exe, and someone calls 
> ResolveSymbolContext("foo.cpp", ...), then in this scenario:
> 
> The compilation unit is foo.cpp
> The support files are foo.h, vector, and any other headers indirectly 
> included by those headers.

The support files for DWARF will be "foo.cpp" as the first file (this is just 
the way DWARF does it) and foo.h vector and any other header files that were 
used will also be in there. So your support files will need to include your 
compile unit source file because you will create some line entries that point 
to your main source file.

> If check_inlines is false, the SymbolContextList should only have one entry 
> for foo.cpp, and all the line table should contain all entries from foo.cpp 
> that match the line number.

SymbolContextList would have N entries inside of it where the 
SymbolContextList.comp_unit is always a compile unit whose name matches the 
"file_spec". The LineEntry in each symbol context will also have a file index 
that matches the SupportFiles index for the "foo.cpp" source file.

> If check_inlines is true, the SymbolContextList should still only have one 
> entry for foo.cpp, but the line table should contain all entries from foo.cpp 
> that match *and* all entries from all support files (as defined in #2) that 
> match.

No there will be one SymbolContext for each line entry that matches. All of the 
SymbolContext objects will have LineEntry whose file index will produce a file 
that is "foo.cpp" when the file is extracted by index from the compile units 
support files. 

So a quick example in main.cpp:

```
 1  #include 
 2  
 3  int main()
 4  {
 5  std::vector ints;
 6  ints.push_back(123);
 7  ints.push_back(234);
 8  }
 9  
10  int foo()
11  {
12  std::vector longs;
 

Re: [Lldb-commits] [PATCH] D17449: Handle the case when a variable is only valid in part of the enclosing scope

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

DWARF already has support for this using location lists. I would rather see 
this done by having the DWARF parser modify the DWARF expression to be a 
location list based. I don't mean have the compiler change, but just how we 
store the location in the variable. This would mean the ONLY change will be in 
the DWARF parser. We don't need to track any ranges or anything in the variable 
this way.

So if you have a variable:

  DW_TAG_subprogram:
  DW_AT_name("main")
  DW_AT_low_pc(0x1000)
  DW_AT_high_pc(0x2000)
  
  DW_TAG_variable:
  DW_AT_name("a")
  DW_AT_start_scope (0x20)
  DW_AT_location (0x11 0x22 0x33) (location is described by a block of 
DW_OP_expression bytes)

Then we would make a location list expression where the DWARFExpression's type 
is switched from:

NonLocationList with bytes of 0x11, 0x22, 0x33

over to a DWARFExpression whose type is:

RegularLocationList with [0x1020-0x2000): 0x11, 0x22, 0x33

If that doesn't make sense let me know. If we do this, then the ONLY change is 
in the DWARF parser since we already support location list based expressions.


http://reviews.llvm.org/D17449



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


Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

2016-02-19 Thread Zachary Turner via lldb-commits
On Fri, Feb 19, 2016 at 10:43 AM Greg Clayton  wrote:

>
> We should be covering this using API tests that make an example like the
> one above and setting breakpoints in the inline header file. We have many
> tests for this. It is hard to get compilers to generate things that you can
> put in unit tests since they often change.
>
>
>
What I mean is, there's a lot of magic that happens between the high level
of the API test and the low level SymbolFile plugin.  And because of all
that, you can't really write an API test or set of API tests that answers
the question "Is the SymbolFile plugin implemented correctly?"  You can
write some that test whether specific features of the debugger work
correctly.  But only with the inputs you've specified.

For someone implementing a SymbolFile plugin, there's a lot of work that
goes into understanding the expectations of the class and what the methods
are supposed to return in different scenarios.  Having API tests doesn't
really help with this.  On the other hand, if when designing the SymbolFile
plugin architecture, you decide "if `check_inlines` is true, then the
resulting SymbolContextList should satisfy some property", that's very easy
to check with a unit test with just 5-10 lines of C++, and when you have a
large collection of these tests, it becomes very easy for someone
implementing a new one to figure out how to make everything work, or making
changes to an existing SymbolFile without breaking anything (including
things that someone didn't have the foresight to write an API test for).
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r261353 - Don't use an atexit handler for cleaning up the temp directory.

2016-02-19 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Fri Feb 19 13:20:44 2016
New Revision: 261353

URL: http://llvm.org/viewvc/llvm-project?rev=261353&view=rev
Log:
Don't use an atexit handler for cleaning up the temp directory.

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

Modified:
lldb/trunk/include/lldb/Host/HostInfoBase.h
lldb/trunk/source/Host/common/HostInfoBase.cpp
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/include/lldb/Host/HostInfoBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostInfoBase.h?rev=261353&r1=261352&r2=261353&view=diff
==
--- lldb/trunk/include/lldb/Host/HostInfoBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h Fri Feb 19 13:20:44 2016
@@ -34,6 +34,8 @@ class HostInfoBase
 
   public:
 static void Initialize();
+static void
+Terminate();
 
 //--
 /// Returns the number of CPUs on this current host.

Modified: lldb/trunk/source/Host/common/HostInfoBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostInfoBase.cpp?rev=261353&r1=261352&r2=261353&view=diff
==
--- lldb/trunk/source/Host/common/HostInfoBase.cpp (original)
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp Fri Feb 19 13:20:44 2016
@@ -31,19 +31,6 @@ using namespace lldb_private;
 
 namespace
 {
-void
-CleanupProcessSpecificLLDBTempDir()
-{
-// Get the process specific LLDB temporary directory and delete it.
-FileSpec tmpdir_file_spec;
-if (!HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, 
tmpdir_file_spec))
-return;
-
-// Remove the LLDB temporary directory if we have one. Set "recurse" to
-// true to all files that were created for the LLDB process can be 
cleaned up.
-FileSystem::DeleteDirectory(tmpdir_file_spec, true);
-}
-
 //--
 // The HostInfoBaseFields is a work around for windows not supporting
 // static variables correctly in a thread safe way. Really each of the
@@ -54,6 +41,16 @@ namespace
 
 struct HostInfoBaseFields
 {
+~HostInfoBaseFields()
+{
+if (m_lldb_process_tmp_dir.Exists())
+{
+// Remove the LLDB temporary directory if we have one. Set 
"recurse" to
+// true to all files that were created for the LLDB process 
can be cleaned up.
+FileSystem::DeleteDirectory(m_lldb_process_tmp_dir, true);
+}
+}
+
 uint32_t m_number_cpus;
 std::string m_vendor_string;
 std::string m_os_string;
@@ -82,6 +79,13 @@ HostInfoBase::Initialize()
 g_fields = new HostInfoBaseFields();
 }
 
+void
+HostInfoBase::Terminate()
+{
+delete g_fields;
+g_fields = nullptr;
+}
+
 uint32_t
 HostInfoBase::GetNumberCPUS()
 {
@@ -335,9 +339,6 @@ HostInfoBase::ComputeProcessTempFileDire
 if (!FileSystem::MakeDirectory(temp_file_spec, 
eFilePermissionsDirectoryDefault).Success())
 return false;
 
-// Make an atexit handler to clean up the process specify LLDB temp dir
-// and all of its contents.
-::atexit(CleanupProcessSpecificLLDBTempDir);
 file_spec.GetDirectory().SetCString(temp_file_spec.GetCString());
 return true;
 }

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=261353&r1=261352&r2=261353&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Fri Feb 19 
13:20:44 2016
@@ -194,5 +194,6 @@ SystemInitializerCommon::Terminate()
 #endif
 OperatingSystemGo::Terminate();
 
+HostInfo::Terminate();
 Log::Terminate();
 }


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


Re: [Lldb-commits] [PATCH] D17420: Don't use an atexit handler for cleaning up process specific temp dir

2016-02-19 Thread Zachary Turner via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261353: Don't use an atexit handler for cleaning up the temp 
directory. (authored by zturner).

Changed prior to commit:
  http://reviews.llvm.org/D17420?vs=48414&id=48528#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17420

Files:
  lldb/trunk/include/lldb/Host/HostInfoBase.h
  lldb/trunk/source/Host/common/HostInfoBase.cpp
  lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Index: lldb/trunk/include/lldb/Host/HostInfoBase.h
===
--- lldb/trunk/include/lldb/Host/HostInfoBase.h
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h
@@ -34,6 +34,8 @@
 
   public:
 static void Initialize();
+static void
+Terminate();
 
 //--
 /// Returns the number of CPUs on this current host.
Index: lldb/trunk/source/Host/common/HostInfoBase.cpp
===
--- lldb/trunk/source/Host/common/HostInfoBase.cpp
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp
@@ -31,19 +31,6 @@
 
 namespace
 {
-void
-CleanupProcessSpecificLLDBTempDir()
-{
-// Get the process specific LLDB temporary directory and delete it.
-FileSpec tmpdir_file_spec;
-if (!HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, 
tmpdir_file_spec))
-return;
-
-// Remove the LLDB temporary directory if we have one. Set "recurse" to
-// true to all files that were created for the LLDB process can be 
cleaned up.
-FileSystem::DeleteDirectory(tmpdir_file_spec, true);
-}
-
 //--
 // The HostInfoBaseFields is a work around for windows not supporting
 // static variables correctly in a thread safe way. Really each of the
@@ -54,6 +41,16 @@
 
 struct HostInfoBaseFields
 {
+~HostInfoBaseFields()
+{
+if (m_lldb_process_tmp_dir.Exists())
+{
+// Remove the LLDB temporary directory if we have one. Set 
"recurse" to
+// true to all files that were created for the LLDB process 
can be cleaned up.
+FileSystem::DeleteDirectory(m_lldb_process_tmp_dir, true);
+}
+}
+
 uint32_t m_number_cpus;
 std::string m_vendor_string;
 std::string m_os_string;
@@ -82,6 +79,13 @@
 g_fields = new HostInfoBaseFields();
 }
 
+void
+HostInfoBase::Terminate()
+{
+delete g_fields;
+g_fields = nullptr;
+}
+
 uint32_t
 HostInfoBase::GetNumberCPUS()
 {
@@ -335,9 +339,6 @@
 if (!FileSystem::MakeDirectory(temp_file_spec, 
eFilePermissionsDirectoryDefault).Success())
 return false;
 
-// Make an atexit handler to clean up the process specify LLDB temp dir
-// and all of its contents.
-::atexit(CleanupProcessSpecificLLDBTempDir);
 file_spec.GetDirectory().SetCString(temp_file_spec.GetCString());
 return true;
 }
Index: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
===
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
@@ -194,5 +194,6 @@
 #endif
 OperatingSystemGo::Terminate();
 
+HostInfo::Terminate();
 Log::Terminate();
 }


Index: lldb/trunk/include/lldb/Host/HostInfoBase.h
===
--- lldb/trunk/include/lldb/Host/HostInfoBase.h
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h
@@ -34,6 +34,8 @@
 
   public:
 static void Initialize();
+static void
+Terminate();
 
 //--
 /// Returns the number of CPUs on this current host.
Index: lldb/trunk/source/Host/common/HostInfoBase.cpp
===
--- lldb/trunk/source/Host/common/HostInfoBase.cpp
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp
@@ -31,19 +31,6 @@
 
 namespace
 {
-void
-CleanupProcessSpecificLLDBTempDir()
-{
-// Get the process specific LLDB temporary directory and delete it.
-FileSpec tmpdir_file_spec;
-if (!HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, tmpdir_file_spec))
-return;
-
-// Remove the LLDB temporary directory if we have one. Set "recurse" to
-// true to all files that were created for the LLDB process can be cleaned up.
-FileSystem::DeleteDirectory(tmpdir_file_spec, true);
-}
-
 //--
 // The HostInfoBaseFields is a work around for windows not supporting
 // static variables correctly in a thread safe way. Really each of the
@@ -54,6 +41,16 @@
 
 struct HostInfoBaseFields
 {

Re: [Lldb-commits] [PATCH] D17455: Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Ed Maste via lldb-commits
emaste updated this revision to Diff 48529.
emaste added a comment.

Address zturner feedback


http://reviews.llvm.org/D17455

Files:
  packages/Python/lldbsuite/test/decorators.py
  
packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
  packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
  
packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
  packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
  
packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
  
packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
  
packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
  
packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
  packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
  packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
  packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
  packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
  packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
  packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py

Index: packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
@@ -49,7 +49,7 @@
 
 @llgs_test
 @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
-@expectedFailureFreeBSD()
+@expectedFailureAll(oslist=['freebsd'])
 def test_sid_is_same_without_setsid_llgs(self):
 self.init_llgs_test()
 self.set_inferior_startup_launch()
Index: packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
===
--- packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
+++ packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
@@ -39,7 +39,7 @@
 self.run_to_address(self.exe_name)
 
 @add_test_categories(['pyapi'])
-@expectedFailureFreeBSD # llvm.org/pr20476
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20476')
 @expectedFailureAll(oslist=["windows"])
 def test_step_out_of_malloc_into_function_b(self):
 """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b()."""
Index: packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
===
--- packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
+++ packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
@@ -11,7 +11,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 @python_api_test
-@expectedFailureFreeBSD('llvm.org/pr24895')
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24895')
 @skipIfRemote # Not remote test suite ready
 @skipUnlessGoInstalled
 def test_with_dsym_and_python_api(self):
Index: packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
===
--- packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
+++ packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -10,7 +10,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureFreeBSD("llvm.org/pr25925")
+@expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25925")
 @expectedFailureAll(compiler="gcc", compiler_version=[">", "4.9"])
 def test_with_run_command(self):
 """Tests imported namespaces in C++."""
Index: packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
===
--- packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -51,7 +51,7 @@
 
 @expectedFailureDarwin(9980907)
 @expectedFailureAll(compiler=["clang", "gcc"], bugnumber="Compiler emits incomplete debug info")
-@expectedFailu

Re: [Lldb-commits] [PATCH] D17455: Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Ed Maste via lldb-commits
emaste added inline comments.


Comment at: 
packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py:26-27
@@ -25,5 +25,4 @@
 @skipIfFreeBSD # llvm.org/pr24691 skipping to avoid crashing the test 
runner
-@expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 
complete object constructor
-@expectedFailureFreeBSD('llvm.org/pr24691') # we hit an assertion in clang
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19011 Newer 
Clang omits C1 complete object constructor')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 @skipIfTargetAndroid() # skipping to avoid crashing the test runner

Yes - I left two of them because they're different PRs, but didn't notice that 
the 2nd was a duplicate of the `@skipIfFreeBSD`. Thanks for catching it.


Comment at: 
packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py:22
@@ -21,3 +21,3 @@
 @skipIfRemote
-@expectedFailureFreeBSD('llvm.org/pr19310')
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19310')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")

thanks, not sure how that slipped through.


http://reviews.llvm.org/D17455



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


[Lldb-commits] [lldb] r261355 - Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Feb 19 13:25:03 2016
New Revision: 261355

URL: http://llvm.org/viewvc/llvm-project?rev=261355&view=rev
Log:
Remove expectedFailureFreeBSD decorator

All invocations are updated to use the generic expectedFailureAll.

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

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

lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py

lldb/trunk/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py

lldb/trunk/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=261355&r1=261354&r2=261355&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Fri Feb 19 13:25:03 
2016
@@ -300,9 +300,6 @@ def expectedFailureDarwin(bugnumber=None
 # For legacy reasons, we support both "darwin" and "macosx" as OS X 
triples.
 return expectedFailureOS(lldbplatform.darwin_all, bugnumber, compilers, 
debug_info=debug_info)
 
-def expectedFailureFreeBSD(bugnumber=None, compilers=None, debug_info=None):
-return expectedFailureOS(lldbplatform.freebsd, bugnumber, compilers, 
debug_info=debug_info)
-
 def expectedFailureAndroid(bugnumber=None, api_levels=None, archs=None):
 """ Mark a test as xfail for Android.
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py?rev=261355&r1=261354&r2=261355&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
 Fri Feb 19 13:25:03 2016
@@ -23,7 +23,7 @@ class ExprCommandCallFunctionTestCase(Te
 '// Please test these expressions while 
stopped at this line:')
 
 @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr14437, fails 
with ICC 13.1")
-@expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr17807 Fails 
on FreeBSD buildbot')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 def test_with(self):
 """Test calling std::String member function."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py?rev=261355&r1=261354&r2=261355&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatt

Re: [Lldb-commits] [PATCH] D17455: Remove expectedFailureFreeBSD decorator

2016-02-19 Thread Ed Maste via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261355: Remove expectedFailureFreeBSD decorator (authored by 
emaste).

Changed prior to commit:
  http://reviews.llvm.org/D17455?vs=48529&id=48533#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17455

Files:
  lldb/trunk/packages/Python/lldbsuite/test/decorators.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
  lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
  lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py

Index: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py
@@ -300,9 +300,6 @@
 # For legacy reasons, we support both "darwin" and "macosx" as OS X triples.
 return expectedFailureOS(lldbplatform.darwin_all, bugnumber, compilers, debug_info=debug_info)
 
-def expectedFailureFreeBSD(bugnumber=None, compilers=None, debug_info=None):
-return expectedFailureOS(lldbplatform.freebsd, bugnumber, compilers, debug_info=debug_info)
-
 def expectedFailureAndroid(bugnumber=None, api_levels=None, archs=None):
 """ Mark a test as xfail for Android.
 
Index: lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
@@ -39,7 +39,7 @@
 self.run_to_address(self.exe_name)
 
 @add_test_categories(['pyapi'])
-@expectedFailureFreeBSD # llvm.org/pr20476
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20476')
 @expectedFailureAll(oslist=["windows"])
 def test_step_out_of_malloc_into_function_b(self):
 """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b()."""
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
@@ -49,7 +49,7 @@
 
 @llgs_test
 @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
-@expectedFailureFreeBSD()
+@expectedFailureAll(oslist=['freebsd'])
 def test_sid_is_same_without_setsid_llgs(self):
 self.init_llgs_test()
 self.set_inferior_startup_launch()
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -21,7 +21,7 @@
 # Find the line number to break inside main().
 self.line = line_number('main.c', 'Put breakpoint here')
 
-@expectedFailureFreeBSD("llvm.org/pr23318: does not report running 

[Lldb-commits] [lldb] r261356 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

2016-02-19 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Fri Feb 19 13:33:46 2016
New Revision: 261356

URL: http://llvm.org/viewvc/llvm-project?rev=261356&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some 
files in source/Commands; other minor fixes.

Modified:
lldb/trunk/source/Commands/CommandCompletions.cpp
lldb/trunk/source/Commands/CommandObjectApropos.cpp
lldb/trunk/source/Commands/CommandObjectArgs.cpp
lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp

Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=261356&r1=261355&r2=261356&view=diff
==
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Fri Feb 19 13:33:46 2016
@@ -15,6 +15,8 @@
 
 // C++ Includes
 // Other libraries and framework includes
+#include "llvm/ADT/SmallString.h"
+
 // Project includes
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/FileSpecList.h"
@@ -29,14 +31,12 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/CleanUp.h"
 
-#include "llvm/ADT/SmallString.h"
-
 using namespace lldb_private;
 
 CommandCompletions::CommonCompletionElement
 CommandCompletions::g_common_completions[] =
 {
-{eCustomCompletion,  NULL},
+{eCustomCompletion,  nullptr},
 {eSourceFileCompletion,  CommandCompletions::SourceFiles},
 {eDiskFileCompletion,CommandCompletions::DiskFiles},
 {eDiskDirectoryCompletion,   CommandCompletions::DiskDirectories},
@@ -46,21 +46,18 @@ CommandCompletions::g_common_completions
 {ePlatformPluginCompletion,  CommandCompletions::PlatformPluginNames},
 {eArchitectureCompletion,CommandCompletions::ArchitectureNames},
 {eVariablePathCompletion,CommandCompletions::VariablePath},
-{eNoCompletion,  NULL}  // This one has to be last in the 
list.
+{eNoCompletion,  nullptr}  // This one has to be last in 
the list.
 };
 
 bool
-CommandCompletions::InvokeCommonCompletionCallbacks 
-(
-CommandInterpreter &interpreter,
-uint32_t completion_mask,
-const char *completion_str,
-int match_start_point,
-int max_return_elements,
-SearchFilter *searcher,
-bool &word_complete,
-StringList &matches
-)
+CommandCompletions::InvokeCommonCompletionCallbacks(CommandInterpreter 
&interpreter,
+uint32_t completion_mask,
+const char *completion_str,
+int match_start_point,
+int max_return_elements,
+SearchFilter *searcher,
+bool &word_complete,
+StringList &matches)
 {
 bool handled = false;
 
@@ -72,7 +69,7 @@ CommandCompletions::InvokeCommonCompleti
 if (g_common_completions[i].type == eNoCompletion)
 break;
  else if ((g_common_completions[i].type & completion_mask) == 
g_common_completions[i].type
-   && g_common_completions[i].callback != NULL)
+   && g_common_completions[i].callback != nullptr)
  {
 handled = true;
 g_common_completions[i].callback (interpreter,
@@ -88,16 +85,13 @@ CommandCompletions::InvokeCommonCompleti
 }
 
 int
-CommandCompletions::SourceFiles 
-(
-CommandInterpreter &interpreter,
-const char *partial_file_name,
-int match_start_point,
-int max_return_elements,
-SearchFilter *searcher,
-bool &word_complete,
-StringList &matches
-)
+CommandCompletions::SourceFiles(CommandInterpreter &interpreter,
+const char *partial_file_name,
+int match_start_point,
+int max_return_elements,
+SearchFilter *searcher,
+bool &word_complete,
+StringList &matches)
 {
 word_complete = true;
 // Find some way to switch "include support files..."
@@ -108,7 +102,7 @@ CommandCompletions::SourceFiles
max_return_elements,
matches);
 
-if (searcher == NULL)
+if (searcher == nullptr)
 {
 lldb::TargetSP target_sp = 
interpreter.GetDebugger().GetSelectedTarget();
 SearchFilterForUnconstrainedSearches null_searcher (target_sp);
@@ -187,13 +181,10 @@ FileSpec::EnumerateDirectoryResult DiskF
 }
 
 static int
-DiskFilesOrDirectories 
-(
-  

Re: [Lldb-commits] [lldb] r261356 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

2016-02-19 Thread Jim Ingham via lldb-commits
Please don't make this sort of change.  With the code as originally written, I 
can set a breakpoint on the returns "true" or "false" case separately, and stop 
there if I am doing that experiment, whereas your change makes that impossible. 
 Neither one is particularly harder to read than the other, but your version is 
significantly harder to debug.

Jim

> On Feb 19, 2016, at 11:33 AM, Eugene Zelenko via lldb-commits 
>  wrote:
> 
> regex_chars (const char comp)
> {
> -if (comp == '[' || comp == ']' ||
> -comp == '(' || comp == ')' ||
> -comp == '{' || comp == '}' ||
> -comp == '+' ||
> -comp == '.' ||
> -comp == '*' ||
> -comp == '|' ||
> -comp == '^' ||
> -comp == '$' ||
> -comp == '\\' ||
> -comp == '?')
> -return true;
> -else
> -return false;
> -}
> -CommandCompletions::SymbolCompleter::SymbolCompleter 
> -(
> -CommandInterpreter &interpreter,
> -const char *completion_str,
> -int match_start_point,
> -int max_return_elements,
> -StringList &matches
> -) :
> +return (comp == '[' || comp == ']' ||
> +comp == '(' || comp == ')' ||
> +comp == '{' || comp == '}' ||
> +comp == '+' ||
> +comp == '.' ||
> +comp == '*' ||
> +comp == '|' ||
> +comp == '^' ||
> +comp == '$' ||
> +comp == '\\' ||
> +comp == '?');
> +}
> +

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


Re: [Lldb-commits] [lldb] r261356 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

2016-02-19 Thread Eugene Zelenko via lldb-commits
On Fri, Feb 19, 2016 at 12:33 PM, Jim Ingham  wrote:
> Please don't make this sort of change.  With the code as originally written, 
> I can set a breakpoint on the returns "true" or "false" case separately, and 
> stop there if I am doing that experiment, whereas your change makes that 
> impossible.  Neither one is particularly harder to read than the other, but 
> your version is significantly harder to debug.
>
> Jim

I this particular case it'w much easier to debug at point of usage.
Actually multiple comparisons could be replaced with strchr().

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


Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

2016-02-19 Thread Zachary Turner via lldb-commits
zturner marked 6 inline comments as done.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:82-83
@@ +81,4 @@
+auto error = llvm::loadDataForEXE(llvm::PDB_ReaderType::DIA, 
llvm::StringRef(exePath), m_session);
+if (error != llvm::PDB_ErrorCode::Success)
+return 0;
+}

clayborg wrote:
> clayborg wrote:
> > how about reversing this just to be safe:
> > 
> > ```
> > if (error == llvm::PDB_ErrorCode::Success)
> > return CompileUnits | LineTables;
> > ```
> how about reversing this just to be safe:
> 
> ```
> if (error == llvm::PDB_ErrorCode::Success)
> return CompileUnits | LineTables;
> ```
> 
> Do you also need to clear m_session in the else clause?
I wrote it this way because then I only have to construct a non-zero value by 
ORing enums together once.  So I don't have to worry about keeping the 
different return values in sync with each other.  Not a big deal either awy, 
but that was my thinking.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:82-84
@@ +81,5 @@
+auto error = llvm::loadDataForEXE(llvm::PDB_ReaderType::DIA, 
llvm::StringRef(exePath), m_session);
+if (error != llvm::PDB_ErrorCode::Success)
+return 0;
+}
+return CompileUnits | LineTables;

zturner wrote:
> clayborg wrote:
> > clayborg wrote:
> > > how about reversing this just to be safe:
> > > 
> > > ```
> > > if (error == llvm::PDB_ErrorCode::Success)
> > > return CompileUnits | LineTables;
> > > ```
> > how about reversing this just to be safe:
> > 
> > ```
> > if (error == llvm::PDB_ErrorCode::Success)
> > return CompileUnits | LineTables;
> > ```
> > 
> > Do you also need to clear m_session in the else clause?
> I wrote it this way because then I only have to construct a non-zero value by 
> ORing enums together once.  So I don't have to worry about keeping the 
> different return values in sync with each other.  Not a big deal either awy, 
> but that was my thinking.
Shouldn't need to clear `m_session`.  If it returns an error, `m_session` will 
not have been initialized by the API.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:92
@@ +91,3 @@
+lldb::addr_t obj_load_address = m_obj_file->GetFileOffset();
+m_session->setLoadAddress(obj_load_address);
+}

clayborg wrote:
> Do you need to check m_session?
Shouldn't need to.  `m_session` will be valid if and only if the error code 
returned in `CalculateAbilities` was non-zero, and CalculateAbilities will 
return non-zero if and only if that call succeeded as well.  So we should never 
get here unless `CalculateAbilities` returned non-zero, which implies the 
session is valid.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:146
@@ +145,3 @@
+
+uint32_t va = line->getVirtualAddress();
+uint32_t lno = line->getLineNumber();

zturner wrote:
> clayborg wrote:
> > clayborg wrote:
> > > Is this really a 32 bit value for 32 and 64 bit binaries?
> > Again, is this really only a 32 bit value??? This seems wrong.
> Will have to check.  I think you're right though that it's a 64-bit value.  
> relative virtual address is 32-bit though, that's probably what confused me.
I checked, it is indeed a 64-bit value.  Thanks for catching this.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:149
@@ +148,3 @@
+uint32_t cno = line->getColumnNumber();
+uint32_t source_id = line->getSourceFileId();
+bool is_statement = line->isStatement();

zturner wrote:
> clayborg wrote:
> > So line table entries get stored as lldb_private::LineTable::Entry values. 
> > The "source_id" you use is currently assumed to be an index into your 
> > compile unit's support files (CompileUnit::GetSupportFiles()). So you will 
> > either need to:
> > - make each CompileUnit create the support files array and translate your 
> > "source_id" over into an index into the compile units FileSpecList that 
> > will get returned from CompileUnit::GetSupportFiles().
> > - Change CompileUnit so that it no longer has a "FileSpecList 
> > &CompileUnit::GetSupportFiles()" function and make a "const FileSpec 
> > *CompileUnit::GetSupportFilebyID (lldb::user_id_t file_id);" and convert 
> > all users of "FileSpecList &CompileUnit::GetSupportFiles()" over to the new 
> > "const FileSpec *CompileUnit::GetSupportFilebyID (lldb::user_id_t file_id);"
> > 
> > So does a PDB file have a source file array itself that is accessed by a 
> > zero or one based index ID? If so it might be possible to keep 
> > GetSupportFiles(), else you might have better luck switching us over to 
> > "const FileSpec *CompileUnit::GetSupportFilebyID (lldb::user_id_t 
> > file_id);" so we allow each SymbolFile to determine how it speaks about 
> > files. In DWARF, we would continue to use the file index as the file_id, 
> > and

Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

2016-02-19 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 48544.
zturner added a comment.

This should address all (I think) issues except for the one about 
`check_inlines`, which I'll do in a followup.  Can you respond to my comment in 
a previous update about the uniqueness / index-ness of the comp_unit id?


http://reviews.llvm.org/D17363

Files:
  cmake/LLDBDependencies.cmake
  cmake/modules/AddLLDB.cmake
  include/lldb/Host/windows/HostInfoWindows.h
  source/API/SystemInitializerFull.cpp
  source/Host/windows/HostInfoWindows.cpp
  source/Initialization/SystemInitializerCommon.cpp
  source/Plugins/SymbolFile/CMakeLists.txt
  source/Plugins/SymbolFile/PDB/CMakeLists.txt
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  unittests/CMakeLists.txt
  unittests/SymbolFile/CMakeLists.txt
  unittests/SymbolFile/PDB/CMakeLists.txt
  unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp
  unittests/SymbolFile/PDB/Inputs/test-dwarf.exe
  unittests/SymbolFile/PDB/Inputs/test-pdb.cpp
  unittests/SymbolFile/PDB/Inputs/test-pdb.exe
  unittests/SymbolFile/PDB/Inputs/test-pdb.pdb
  unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Index: unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
===
--- /dev/null
+++ unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -0,0 +1,158 @@
+//===-- PythonDataObjectsTests.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/Config/config.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+
+#include "lldb/Core/Address.h"
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/FileSpec.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/LineTable.h"
+#include "lldb/Symbol/SymbolVendor.h"
+
+#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
+#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
+#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
+
+#if defined(_MSC_VER)
+#include 
+#endif
+
+extern const char *TestMainArgv0;
+
+using namespace lldb_private;
+
+class SymbolFilePDBTests : public testing::Test
+{
+public:
+void
+SetUp() override
+{
+#if defined(_MSC_VER)
+::CoInitializeEx(nullptr, COINIT_MULTITHREADED);
+#endif
+
+HostInfoBase::Initialize();
+ObjectFilePECOFF::Initialize();
+SymbolFileDWARF::Initialize();
+SymbolFilePDB::Initialize();
+
+llvm::StringRef exe_folder = llvm::sys::path::parent_path(TestMainArgv0);
+llvm::SmallString<128> inputs_folder = exe_folder;
+llvm::sys::path::append(inputs_folder, "Inputs");
+
+m_pdb_test_exe = inputs_folder;
+m_dwarf_test_exe = inputs_folder;
+llvm::sys::path::append(m_pdb_test_exe, "test-pdb.exe");
+llvm::sys::path::append(m_dwarf_test_exe, "test-dwarf.exe");
+}
+
+void
+TearDown() override
+{
+#if defined(_MSC_VER)
+::CoUninitialize();
+#endif
+SymbolFilePDB::Terminate();
+SymbolFileDWARF::Terminate();
+ObjectFilePECOFF::Terminate();
+}
+
+protected:
+llvm::SmallString<128> m_pdb_test_exe;
+llvm::SmallString<128> m_dwarf_test_exe;
+
+void
+VerifyLineEntry(lldb::ModuleSP module, LineTable <, uint32_t line, lldb::addr_t addr)
+{
+LineEntry entry;
+Address address;
+
+EXPECT_TRUE(module->ResolveFileAddress(addr, address));
+EXPECT_TRUE(lt.FindLineEntryByAddress(address, entry));
+EXPECT_EQ(line, entry.line);
+}
+};
+
+#if defined(HAVE_DIA_SDK)
+#define REQUIRES_DIA_SDK(TestName) TestName
+#else
+#define REQUIRES_DIA_SDK(TestName) DISABLED_##TestName
+#endif
+
+TEST_F(SymbolFilePDBTests, REQUIRES_DIA_SDK(TestAbilitiesForPDB))
+{
+// Test that when we have PDB debug info, SymbolFilePDB is used.
+FileSpec fspec(m_pdb_test_exe.c_str(), false);
+ArchSpec aspec("i686-pc-windows");
+lldb::ModuleSP module = std::make_shared(fspec, aspec);
+
+SymbolVendor *plugin = SymbolVendor::FindPlugin(module, nullptr);
+EXPECT_NE(nullptr, plugin);
+SymbolFile *symfile = plugin->GetSymbolFile();
+EXPECT_NE(nullptr, symfile);
+EXPECT_EQ(symfile->GetPluginName(), SymbolFilePDB::GetPluginNameStatic());
+
+uint32_t expected_abilities = SymbolFile::CompileUnits | SymbolFile::LineTables;
+EXPECT_EQ(expected_abilities, symfile->CalculateAbilities());
+}
+
+TEST_F(SymbolFilePDBTests, TestAbilitiesForDWARF)
+{
+// Test that when we have Dwarf debug info, SymbolFileDWARF is used.
+FileSpec fspec(m_dwarf_test_exe.c_str(), false);
+ArchSpec aspe

Re: [Lldb-commits] [PATCH] D17450: Add support for handling absolute symbols in ELF

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

We should probably make it such that if a section has the type 
eSectionTypeAbsoluteAddress that we do the right thing inside the following 
functions:

Section::GetLoadBaseAddress(...);
Section::Slide(...);

SectionLoadList::SetSectionLoadAddress(...);
SectionLoadList::GetSectionLoadAddress(...);
SectionLoadList::SetSectionUnloaded(...);
SectionLoadList::ResolveLoadAddress(...);



Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2092
@@ -2085,3 +2091,3 @@
 SymbolType symbol_type = eSymbolTypeInvalid;
 Elf64_Half symbol_idx = symbol.st_shndx;
 

This variable has a really bad name. We should change "symbol_idx" to 
"section_idx" and make this const:
```
const Elf64_Half section_idx = symbol.st_shndx;
```


Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2291
@@ +2290,3 @@
+
+if (symbol_section_sp == nullptr && symbol.st_size != 0)
+{

Shouldn't this just be:

```
if (!symbol_section_sp && symbol.st_shndx != SHN_UNDEF  && symbol.st_size != 0)
```

We need to know if a symbol has an address and it only has an address if 
symbol.st_shndx != SHN_UNDEF. All other section types mean that the symbol 
actually has an address


http://reviews.llvm.org/D17450



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


Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

2016-02-19 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:150
@@ +149,3 @@
+return TranslateLanguage(details->getLanguage());
+}
+

Ahh i see the problem.  The problem is not the value Im' specifying for the id 
of the compile unit, but the value I'm specifying in the argument to the 
constructor of LineEntry, which is clearly documented as an index.

Using the `CompileUnit::GetSupportFileByID` seems difficult based on a cursory 
glance over how it's used, so for now I will just do some extra work to add 
support files and map ids to indices.

Later we can think about whether it's worth it to do that refactor to get rid 
of the assumption that they're indices.


http://reviews.llvm.org/D17363



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


Re: [Lldb-commits] [PATCH] D17363: Add SymbolFilePDB with basic support for line tables.

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

So your LineTable::Entry objects that you create are still invalid since you 
didn't implement the support files.

All comments became unaligned but you did comment that:

> In CompileUnit.h, it says this:




  // A representation of a compilation unit, or compiled source file.
  // The UserID of the compile unit is specified by the SymbolFile
  // plug-in and can have any value as long as the value is unique
  // within the Module that owns this compile units.



> Are you sure it's an index into the support files? It sounds like maybe the 
> DWARF plugin treats it as such, but it's not assumed to be such by any 
> generic code.


I wasn't talking about the CompileUnit's UserID, I was talking about file 
indexes that are in the line tables that you create. The CompileUnit's UserID 
is what ever you want it to be and this is correct and will work for any debug 
info. The line tables use file indexes for files in the LineTable::Entry 
structures and they rely on the file index being a valid index into the 
CompilerUnit::GetSupportFiles() FileSpecList.



Comment at: source/Host/windows/HostInfoWindows.cpp:37
@@ +36,3 @@
+HostInfoBase::Terminate();
+CoUninitialize();
+}

Should be:

```
::CoUninitialize();
```


http://reviews.llvm.org/D17363



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


Re: [Lldb-commits] [PATCH] D17425: Use shallow clones in build-llvm.py.

2016-02-19 Thread Todd Fiala via lldb-commits
tfiala added a reviewer: spyffe.
tfiala added a comment.

+Sean

Sean, I'm okay with this for now.  You know my changes coming down the pipe, 
and I can add a configuration setting for the git side that lets us optionally 
add in the history truncation.  Thoughts?


http://reviews.llvm.org/D17425



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


Re: [Lldb-commits] [PATCH] D17425: Use shallow clones in build-llvm.py.

2016-02-19 Thread Todd Fiala via lldb-commits
tfiala added a comment.

(Stephane, I've got a change in the works that is currently backed up behind 
some other things, but it allows better mapping of Xcode lldb configuration to 
llvm/clang configuration, and includes specifying if svn or git should be used. 
 It will actually default to svn.  Most of the change is in 
github.com/tfiala/lldb on the tfiala-master branch but I won't have time to 
clean it up for a little while here).


http://reviews.llvm.org/D17425



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


[Lldb-commits] [PATCH] D17465: Get register context for the 32-bit process in a WoW64 process minidump.

2016-02-19 Thread Adrian McCarthy via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.

32-bit processes on 64-bit Windows run in a layer called WoW64 
(Windows-on-Windows64).  If you capture a mini dump of such a process from a 
32-bit debugger, you end up with a register context for the 64-bit WoW64 
process rather than the 32-bit one you probably care about.

This detects WoW64 by looking to see if there's a module named wow64.dll 
loaded.  For such processes, it then looks in the 64-bit Thread Environment 
Block (TEB) to locate a copy of the 32-bit CONTEXT record that the plugin needs 
for the register context.

I'll add a test before submitting this, but it seems to work in my manual 
experiments.

http://reviews.llvm.org/D17465

Files:
  source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp

Index: source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
===
--- source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
+++ source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
@@ -35,6 +35,8 @@
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 
+#include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
+
 #include "ExceptionRecord.h"
 #include "ThreadWinMiniDump.h"
 
@@ -83,6 +85,7 @@
 HANDLE m_mapping;  // handle to the file mapping for the minidump file
 void * m_base_addr;  // base memory address of the minidump
 std::shared_ptr m_exception_sp;
+bool m_is_wow64;  // minidump is of a 32-bit process captured with a 64-bit debugger
 };
 
 ConstString
@@ -182,6 +185,24 @@
 return m_dyld_ap.get();
 }
 
+
+// This describes the layout of a TEB (Thread Environment Block) for a 64-bit
+// process.  It's adapted from the 32-bit TEB in winternl.h.  Currently, we care
+// only about the position of the TlsSlots.
+struct TEB64 {
+ULONG64 Reserved1[12];
+ULONG64 ProcessEnvironmentBlock;
+ULONG64 Reserved2[399];
+BYTE Reserved3[1952];
+ULONG64 TlsSlots[64];
+BYTE Reserved4[8];
+ULONG64 Reserved5[26];
+ULONG64 ReservedForOle;  // Windows 2000 only
+ULONG64 Reserved6[4];
+ULONG64 TlsExpansionSlots;
+};
+
+
 bool
 ProcessWinMiniDump::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
@@ -195,7 +216,47 @@
 auto thread_sp = std::make_shared(*this, mini_dump_thread.ThreadId);
 if (mini_dump_thread.ThreadContext.DataSize >= sizeof(CONTEXT))
 {
-const CONTEXT *context = reinterpret_cast(static_cast(m_data_up->m_base_addr) + mini_dump_thread.ThreadContext.Rva);
+const CONTEXT *context =
+reinterpret_cast(static_cast(m_data_up->m_base_addr) +
+  mini_dump_thread.ThreadContext.Rva);
+
+if (m_data_up->m_is_wow64)
+{
+// On Windows, a 32-bit process can run on a 64-bit machine under WOW64.
+// If the minidump was captured with a 64-bit debugger, then the CONTEXT
+// we just grabbed from the mini_dump_thread is the one for the 64-bit
+// "native" process rather than the 32-bit "guest" process we care about.
+// In this case, we can get the 32-bit CONTEXT from the TEB (Thread
+// Environment Block) of the 64-bit process.
+Error error;
+TEB64 wow64teb = { 0 };
+ReadMemory(mini_dump_thread.Teb, &wow64teb, sizeof(wow64teb), error);
+if (error.Success())
+{
+// Slot 1 of the thread-local storage in the 64-bit TEB points to a structure
+// that includes the 32-bit CONTEXT (after a ULONG).
+const size_t addr = wow64teb.TlsSlots[1];
+Range range = {0};
+if (FindMemoryRange(addr, &range))
+{
+lldbassert(range.start <= addr);
+const size_t offset = addr - range.start + sizeof(ULONG);
+if (offset < range.size)
+{
+const size_t overlap = range.size - offset;
+if (overlap >= sizeof(CONTEXT))
+{
+context = reinterpret_cast(range.ptr + offset);
+}
+}
+}
+}
+
+// NOTE:  We don't currently use the TEB for anything else.  If we need it in
+// the future, the 32-bit TEB is located according to the address stored in the
+// first slot of the 64-bit TEB (wow64teb.Reserved1[0]).
+  

Re: [Lldb-commits] [PATCH] D17465: Get register context for the 32-bit process in a WoW64 process minidump.

2016-02-19 Thread Zachary Turner via lldb-commits
zturner added a comment.

I'll have to look at this more carefully next week.  I'm guessing the same 
logic can eventually be re-used to live debug a 32-bit process from a 64-bit 
LLDB?  (Not that you have to address that now, just curious)


http://reviews.llvm.org/D17465



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


Re: [Lldb-commits] [PATCH] D17465: Get register context for the 32-bit process in a WoW64 process minidump.

2016-02-19 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp:192
@@ +191,3 @@
+// only about the position of the TlsSlots.
+struct TEB64 {
+ULONG64 Reserved1[12];

I think this structure should go in a different header file in 
Process/Windows/Common.  Maybe it could be called `NtStructures.h` or something 
like that.


Comment at: 
source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp:236-237
@@ +235,4 @@
+{
+// Slot 1 of the thread-local storage in the 64-bit 
TEB points to a structure
+// that includes the 32-bit CONTEXT (after a ULONG).
+const size_t addr = wow64teb.TlsSlots[1];

Are the other fields of this structure known what they mean?


http://reviews.llvm.org/D17465



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


[Lldb-commits] [lldb] r261389 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

2016-02-19 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Fri Feb 19 18:58:29 2016
New Revision: 261389

URL: http://llvm.org/viewvc/llvm-project?rev=261389&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some 
files in source/Commands; other minor fixes.

Modified:
lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
lldb/trunk/source/Commands/CommandObjectDisassemble.h
lldb/trunk/source/Commands/CommandObjectHelp.cpp
lldb/trunk/source/Commands/CommandObjectLog.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectMultiword.cpp
lldb/trunk/source/Commands/CommandObjectPlugin.cpp
lldb/trunk/source/Commands/CommandObjectSyntax.cpp

Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=261389&r1=261388&r2=261389&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Fri Feb 19 18:58:29 
2016
@@ -7,12 +7,11 @@
 //
 
//===--===//
 
-#include "CommandObjectDisassemble.h"
-
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "CommandObjectDisassemble.h"
 #include "lldb/Core/AddressRange.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Module.h"
@@ -54,9 +53,7 @@ CommandObjectDisassemble::CommandOptions
 OptionParsingStarting();
 }
 
-CommandObjectDisassemble::CommandOptions::~CommandOptions ()
-{
-}
+CommandObjectDisassemble::CommandOptions::~CommandOptions() = default;
 
 Error
 CommandObjectDisassemble::CommandOptions::SetOptionValue (uint32_t option_idx, 
const char *option_arg)
@@ -105,6 +102,7 @@ CommandObjectDisassemble::CommandOptions
 some_location_specified = true;
 }
 break;
+
 case 'n':
 func_name.assign (option_arg);
 some_location_specified = true;
@@ -139,6 +137,7 @@ CommandObjectDisassemble::CommandOptions
 error.SetErrorStringWithFormat("Disassembler flavors are 
currently only supported for x86 and x86_64 targets.");
 break;
 }
+
 case 'r':
 raw = true;
 break;
@@ -218,7 +217,6 @@ CommandObjectDisassemble::CommandOptions
 if (!some_location_specified)
 current_function = true;
 return Error();
-
 }
 
 const OptionDefinition*
@@ -230,33 +228,31 @@ CommandObjectDisassemble::CommandOptions
 OptionDefinition
 CommandObjectDisassemble::CommandOptions::g_option_table[] =
 {
-{ LLDB_OPT_SET_ALL, false, "bytes", 'b', OptionParser::eNoArgument 
   , NULL, NULL, 0, eArgTypeNone,"Show opcode bytes when 
disassembling."},
-{ LLDB_OPT_SET_ALL, false, "context"  , 'C', 
OptionParser::eRequiredArgument  , NULL, NULL, 0, eArgTypeNumLines,"Number 
of context lines of source to show."},
-{ LLDB_OPT_SET_ALL, false, "mixed", 'm', OptionParser::eNoArgument 
   , NULL, NULL, 0, eArgTypeNone,"Enable mixed source and assembly 
display."},
-{ LLDB_OPT_SET_ALL, false, "raw"  , 'r', OptionParser::eNoArgument 
   , NULL, NULL, 0, eArgTypeNone,"Print raw disassembly with no symbol 
information."},
-{ LLDB_OPT_SET_ALL, false, "plugin"   , 'P', 
OptionParser::eRequiredArgument  , NULL, NULL, 0, eArgTypePlugin,  "Name of 
the disassembler plugin you want to use."},
-{ LLDB_OPT_SET_ALL, false, "flavor"   , 'F', 
OptionParser::eRequiredArgument  , NULL, NULL, 0, eArgTypeDisassemblyFlavor,
"Name of the disassembly flavor you want to use.  "
+{ LLDB_OPT_SET_ALL, false, "bytes", 'b', OptionParser::eNoArgument 
   , nullptr, nullptr, 0, eArgTypeNone,"Show opcode bytes when 
disassembling."},
+{ LLDB_OPT_SET_ALL, false, "context"  , 'C', 
OptionParser::eRequiredArgument  , nullptr, nullptr, 0, eArgTypeNumLines,
"Number of context lines of source to show."},
+{ LLDB_OPT_SET_ALL, false, "mixed", 'm', OptionParser::eNoArgument 
   , nullptr, nullptr, 0, eArgTypeNone,"Enable mixed source and 
assembly display."},
+{ LLDB_OPT_SET_ALL, false, "raw"  , 'r', OptionParser::eNoArgument 
   , nullptr, nullptr, 0, eArgTypeNone,"Print raw disassembly with no 
symbol information."},
+{ LLDB_OPT_SET_ALL, false, "plugin"   , 'P', 
OptionParser::eRequiredArgument  , nullptr, nullptr, 0, eArgTypePlugin,  
"Name of the disassembler plugin you want to use."},
+{ LLDB_OPT_SET_ALL, false, "flavor"   , 'F', 
OptionParser::eRequiredArgument  , nullptr, nullptr, 0, 
eArgTypeDisassemblyFlavor,"Name of the disassembly flavor you want to 
use.  "

   "Currently the on

[Lldb-commits] LLVM buildmaster restarted in few minutes.

2016-02-19 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated and restarted in few minutes.
Thank you for understanding.

Thanks

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