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

2015-08-25 Thread Hafiz Abid Qadeer via lldb-commits
abidh added inline comments.


Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp:348
@@ -292,1 +347,3 @@
+}
+}
 

You are not using the DW_AT_GNU_dwo_id. Is this intentional or an oversight?


http://reviews.llvm.org/D12291



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


[Lldb-commits] [lldb] r245927 - Fix build on mips

2015-08-25 Thread Sagar Thakur via lldb-commits
Author: slthakur
Date: Tue Aug 25 04:52:59 2015
New Revision: 245927

URL: http://llvm.org/viewvc/llvm-project?rev=245927&view=rev
Log:
Fix build on mips

Setting and getting register values as bytes instead of depending on the 128 
bit integer support in register value.
This patch will fix the build failure in the release branch.

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

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=245927&r1=245926&r2=245927&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
Tue Aug 25 04:52:59 2015
@@ -584,7 +584,6 @@ NativeRegisterContextLinux_mips64::ReadR
 if (IsMSA(reg) || IsFPR(reg))
 {
 uint8_t *src;
-type128 int128;
 
 error = ReadCP1();
 
@@ -604,9 +603,6 @@ NativeRegisterContextLinux_mips64::ReadR
 assert (reg_info->byte_offset < sizeof(UserArea));
 src = (uint8_t *)&m_msa + reg_info->byte_offset - (sizeof(m_gpr) + 
sizeof(m_fpr));
 }
-int128.x[0] = *(uint64_t *)src;
-int128.x[1] = *(uint64_t *)(src + 8);
-llvm::APInt rhs = llvm::APInt(128, 2, int128.x);
 switch (reg_info->byte_size)
 {
 case 4:
@@ -616,7 +612,7 @@ NativeRegisterContextLinux_mips64::ReadR
 reg_value.SetUInt64(*(uint64_t *)src);
 break;
 case 16:
-reg_value.SetUInt128(rhs);
+reg_value.SetBytes((const void *)src, 16, GetByteOrder());
 break;
 default:
 assert(false && "Unhandled data size.");
@@ -660,7 +656,7 @@ NativeRegisterContextLinux_mips64::Write
 if (IsFPR(reg_index) || IsMSA(reg_index))
 {
 uint8_t *dst;
-const uint64_t *src;
+uint64_t *src;
 
 // Initialise the FP and MSA buffers by reading all co-processor 1 
registers
 ReadCP1();
@@ -675,8 +671,6 @@ NativeRegisterContextLinux_mips64::Write
 assert (reg_info->byte_offset < sizeof(UserArea));
 dst = (uint8_t *)&m_msa + reg_info->byte_offset - (sizeof(m_gpr) + 
sizeof(m_fpr));
 }
-llvm::APInt lhs;
-llvm::APInt fail_value = llvm::APInt::getMaxValue(128);
 switch (reg_info->byte_size)
 {
 case 4:
@@ -686,8 +680,7 @@ NativeRegisterContextLinux_mips64::Write
 *(uint64_t *)dst = reg_value.GetAsUInt64();
 break;
 case 16:
-lhs = reg_value.GetAsUInt128(fail_value);
-src = lhs.getRawData();
+src = (uint64_t *)reg_value.GetBytes();
 *(uint64_t *)dst = *src;
 *(uint64_t *)(dst + 8) = *(src + 1);
 break;


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


Re: [Lldb-commits] [PATCH] D12275: Fix build on mips

2015-08-25 Thread Sagar Thakur via lldb-commits
sagar added a comment.

Hi Hans,

I have committed it to the trunk in revision 245927.  You can now merge it to 
the release branch.

Thanks,
Sagar


Repository:
  rL LLVM

http://reviews.llvm.org/D12275



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


[Lldb-commits] [lldb] r245928 - Fix source manager regression caused by r245905

2015-08-25 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Aug 25 05:27:38 2015
New Revision: 245928

URL: http://llvm.org/viewvc/llvm-project?rev=245928&view=rev
Log:
Fix source manager regression caused by r245905

Modified:
lldb/trunk/source/Symbol/SymbolFile.cpp

Modified: lldb/trunk/source/Symbol/SymbolFile.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolFile.cpp?rev=245928&r1=245927&r2=245928&view=diff
==
--- lldb/trunk/source/Symbol/SymbolFile.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolFile.cpp Tue Aug 25 05:27:38 2015
@@ -99,7 +99,6 @@ SymbolFile::GetTypeSystemForLanguage (ll
 uint32_t
 SymbolFile::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, 
bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
 {
-sc_list.Clear();
 return 0;
 }
 


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


[Lldb-commits] [lldb] r245932 - Handle DW_OP_GNU_addr_index in DWARF expressions

2015-08-25 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Aug 25 06:46:06 2015
New Revision: 245932

URL: http://llvm.org/viewvc/llvm-project?rev=245932&view=rev
Log:
Handle DW_OP_GNU_addr_index in DWARF expressions

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

Modified:
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=245932&r1=245931&r2=245932&view=diff
==
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Tue Aug 25 06:46:06 
2015
@@ -17,12 +17,14 @@
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Scalar.h"
 
+class DWARFCompileUnit;
+
 namespace lldb_private {
 
+class ClangExpressionDeclMap;
 class ClangExpressionVariable;
 class ClangExpressionVariableList;
 
-class ClangExpressionDeclMap;
 
 //--
 /// @class DWARFExpression DWARFExpression.h 
"lldb/Expression/DWARFExpression.h"
@@ -43,7 +45,7 @@ public:
 //--
 /// Constructor
 //--
-DWARFExpression();
+explicit DWARFExpression(DWARFCompileUnit* dwarf_cu);
 
 //--
 /// Constructor
@@ -60,6 +62,7 @@ public:
 //--
 DWARFExpression(lldb::ModuleSP module,
 const DataExtractor& data,
+DWARFCompileUnit* dwarf_cu,
 lldb::offset_t data_offset,
 lldb::offset_t data_length);
 
@@ -356,6 +359,7 @@ public:
   RegisterContext *reg_ctx,
   lldb::ModuleSP opcode_ctx,
   const DataExtractor& opcodes,
+  DWARFCompileUnit* dwarf_cu,
   const lldb::offset_t offset,
   const lldb::offset_t length,
   const lldb::RegisterKind reg_set,
@@ -436,6 +440,9 @@ protected:
 
 lldb::ModuleWP m_module_wp; ///< Module which defined this 
expression.
 DataExtractor m_data;   ///< A data extractor capable 
of reading opcode bytes
+DWARFCompileUnit* m_dwarf_cu;   ///< The DWARF compile unit 
this expression belongs to. It is used
+///< to evaluate values 
indexing into the .debug_addr section (e.g.
+///< DW_OP_GNU_addr_index
 lldb::RegisterKind m_reg_kind;  ///< One of the defines that 
starts with LLDB_REGKIND_
 lldb::addr_t m_loclist_slide;   ///< A value used to slide the 
location list offsets so that 
 ///< they are relative to the 
object that owns the location list

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=245932&r1=245931&r2=245932&view=diff
==
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Tue Aug 25 06:46:06 2015
@@ -38,6 +38,8 @@
 #include "lldb/Target/StackID.h"
 #include "lldb/Target/Thread.h"
 
+#include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h"
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -196,6 +198,7 @@ DW_OP_value_to_name (uint32_t val)
 case 0x98: return "DW_OP_call2";
 case 0x99: return "DW_OP_call4";
 case 0x9a: return "DW_OP_call_ref";
+case 0xfb: return "DW_OP_GNU_addr_index";
 //case DW_OP_APPLE_array_ref: return "DW_OP_APPLE_array_ref";
 //case DW_OP_APPLE_extern: return "DW_OP_APPLE_extern";
 case DW_OP_APPLE_uninit: return "DW_OP_APPLE_uninit";
@@ -219,9 +222,10 @@ DW_OP_value_to_name (uint32_t val)
 //--
 // DWARFExpression constructor
 //--
-DWARFExpression::DWARFExpression() :
+DWARFExpression::DWARFExpression(DWARFCompileUnit* dwarf_cu) :
 m_module_wp(),
 m_data(),
+m_dwarf_cu(dwarf_cu),
 m_reg_kind (eRegisterKindDWARF),
 m_loclist_slide (LLDB_INVALID_ADDRESS)
 {
@@ -230,15 +234,21 @@ DWARFExpression:

[Lldb-commits] [lldb] r245930 - Fix buffer overflow for fixed_form_sizes

2015-08-25 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Aug 25 06:45:46 2015
New Revision: 245930

URL: http://llvm.org/viewvc/llvm-project?rev=245930&view=rev
Log:
Fix buffer overflow for fixed_form_sizes

The array is indexed by the value in the DW_FORM filed what can be
bigger then the size of the array. This CL add bound checking to avoid
buffer overflows

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=245930&r1=245929&r2=245930&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Tue Aug 25 
06:45:46 2015
@@ -176,7 +176,8 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (b
 die_index_stack.reserve(32);
 die_index_stack.push_back(0);
 bool prev_die_had_children = false;
-const uint8_t *fixed_form_sizes = 
DWARFFormValue::GetFixedFormSizesForAddressSize (GetAddressByteSize(), 
m_is_dwarf64);
+DWARFFormValue::FixedFormSizes fixed_form_sizes =
+DWARFFormValue::GetFixedFormSizesForAddressSize (GetAddressByteSize(), 
m_is_dwarf64);
 while (offset < next_cu_offset &&
die.FastExtract (debug_info_data, this, fixed_form_sizes, &offset))
 {
@@ -661,7 +662,8 @@ DWARFCompileUnit::Index (const uint32_t
 {
 const DWARFDataExtractor* debug_str = &m_dwarf2Data->get_debug_str_data();
 
-const uint8_t *fixed_form_sizes = 
DWARFFormValue::GetFixedFormSizesForAddressSize (GetAddressByteSize(), 
m_is_dwarf64);
+DWARFFormValue::FixedFormSizes fixed_form_sizes =
+DWARFFormValue::GetFixedFormSizesForAddressSize (GetAddressByteSize(), 
m_is_dwarf64);
 
 Log *log (LogChannelDWARF::GetLogIfAll (DWARF_LOG_LOOKUPS));
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=245930&r1=245929&r2=245930&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Tue Aug 
25 06:45:46 2015
@@ -119,7 +119,7 @@ DWARFDebugInfoEntry::FastExtract
 (
 const DWARFDataExtractor& debug_info_data,
 const DWARFCompileUnit* cu,
-const uint8_t *fixed_form_sizes,
+const DWARFFormValue::FixedFormSizes& fixed_form_sizes,
 lldb::offset_t *offset_ptr
 )
 {
@@ -158,7 +158,7 @@ DWARFDebugInfoEntry::FastExtract
 {
 form = abbrevDecl->GetFormByIndexUnchecked(i);
 
-const uint8_t fixed_skip_size = fixed_form_sizes [form];
+const uint8_t fixed_skip_size = fixed_form_sizes.GetSize(form);
 if (fixed_skip_size)
 offset += fixed_skip_size;
 else
@@ -1210,7 +1210,7 @@ DWARFDebugInfoEntry::GetAttributes
 (
 SymbolFileDWARF* dwarf2Data,
 const DWARFCompileUnit* cu,
-const uint8_t *fixed_form_sizes,
+DWARFFormValue::FixedFormSizes fixed_form_sizes,
 DWARFDebugInfoEntry::Attributes& attributes,
 uint32_t curr_depth
 ) const
@@ -1222,8 +1222,9 @@ DWARFDebugInfoEntry::GetAttributes
 {
 const DWARFDataExtractor& debug_info_data = 
dwarf2Data->get_debug_info_data();
 
-if (fixed_form_sizes == NULL)
-fixed_form_sizes = 
DWARFFormValue::GetFixedFormSizesForAddressSize(cu->GetAddressByteSize(), 
cu->IsDWARF64());
+if (fixed_form_sizes.Empty())
+fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize(
+cu->GetAddressByteSize(), cu->IsDWARF64());
 
 const uint32_t num_attributes = abbrevDecl->NumAttributes();
 uint32_t i;
@@ -1277,7 +1278,7 @@ DWARFDebugInfoEntry::GetAttributes
 }
 else
 {
-const uint8_t fixed_skip_size = fixed_form_sizes [form];
+const uint8_t fixed_skip_size = fixed_form_sizes.GetSize(form);
 if (fixed_skip_size)
 offset += fixed_skip_size;
 else
@@ -1956,7 +1957,7 @@ DWARFDebugInfoEntry::GetParentDeclContex
 

Re: [Lldb-commits] [PATCH] D12239: Fix buffer overflow for fixed_form_sizes

2015-08-25 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245930: Fix buffer overflow for fixed_form_sizes (authored 
by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D12239?vs=32946&id=33060#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12239

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Symbol/ClangASTContext.cpp

Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2540,7 +2540,7 @@
 Mangled best_name;
 DWARFDebugInfoEntry::Attributes attributes;
 DWARFFormValue form_value;
-die->GetAttributes(this, dwarf_cu, NULL, attributes);
+die->GetAttributes(this, dwarf_cu, DWARFFormValue::FixedFormSizes(), attributes);
 uint32_t idx = attributes.FindAttributeIndex(DW_AT_MIPS_linkage_name);
 if (idx == UINT32_MAX)
 idx = attributes.FindAttributeIndex(DW_AT_linkage_name);
@@ -3990,7 +3990,10 @@
 (tag == DW_TAG_formal_parameter && sc.function))
 {
 DWARFDebugInfoEntry::Attributes attributes;
-const size_t num_attributes = die->GetAttributes(this, dwarf_cu, NULL, attributes);
+const size_t num_attributes = die->GetAttributes(this,
+ dwarf_cu,
+ DWARFFormValue::FixedFormSizes(),
+ attributes);
 if (num_attributes > 0)
 {
 const char *name = NULL;
@@ -4040,9 +4043,12 @@
 else if (DWARFFormValue::IsDataForm(form_value.Form()))
 {
 // Retrieve the value as a data expression.
-const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (attributes.CompileUnitAtIndex(i)->GetAddressByteSize(), attributes.CompileUnitAtIndex(i)->IsDWARF64());
+DWARFFormValue::FixedFormSizes fixed_form_sizes =
+DWARFFormValue::GetFixedFormSizesForAddressSize (
+attributes.CompileUnitAtIndex(i)->GetAddressByteSize(),
+attributes.CompileUnitAtIndex(i)->IsDWARF64());
 uint32_t data_offset = attributes.DIEOffsetAtIndex(i);
-uint32_t data_length = fixed_form_sizes[form_value.Form()];
+uint32_t data_length = fixed_form_sizes.GetSize(form_value.Form());
 if (data_length == 0)
 {
 const uint8_t *data_pointer = form_value.BlockData();
@@ -4064,9 +4070,12 @@
 // Retrieve the value as a string expression.
 if (form_value.Form() == DW_FORM_strp)
 {
-const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (attributes.CompileUnitAtIndex(i)->GetAddressByteSize(), attributes.CompileUnitAtIndex(i)->IsDWARF64());
+DWARFFormValue::FixedFormSizes fixed_form_sizes =
+DWARFFormValue::GetFixedFormSizesForAddressSize (
+attributes.CompileUnitAtIndex(i)->GetAddressByteSize(),
+attributes.CompileUnitAtIndex(i)->IsDWARF64());
 uint32_t data_offset = attributes.DIEOffsetAtIndex(i);
-uint32_t data_length = fixed_form_sizes[form_value.Form()];
+uint32_t data_length = fixed_form_sizes.GetSize(form_value.Form());
 location.CopyOpcodeData(module, debug_info_data, data_offset, data_length);
 }
 else
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h

[Lldb-commits] [lldb] r245931 - Add support for DW_FORM_GNU_[addr, str]_index

2015-08-25 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Aug 25 06:45:58 2015
New Revision: 245931

URL: http://llvm.org/viewvc/llvm-project?rev=245931&view=rev
Log:
Add support for DW_FORM_GNU_[addr,str]_index

These are 2 new value currently in experimental status used when split
debug info is enabled.

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

Modified:
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/source/Expression/IRExecutionUnit.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/ObjectFile.cpp
lldb/trunk/source/Utility/ConvertEnum.cpp

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=245931&r1=245930&r2=245931&view=diff
==
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Tue Aug 25 06:45:58 2015
@@ -595,6 +595,7 @@ namespace lldb {
 eSectionTypeDataObjCMessageRefs,// Pointer to function pointer + 
selector
 eSectionTypeDataObjCCFStrings,  // Objective C const 
CFString/NSString objects
 eSectionTypeDWARFDebugAbbrev,
+eSectionTypeDWARFDebugAddr,
 eSectionTypeDWARFDebugAranges,
 eSectionTypeDWARFDebugFrame,
 eSectionTypeDWARFDebugInfo,
@@ -605,6 +606,7 @@ namespace lldb {
 eSectionTypeDWARFDebugPubTypes,
 eSectionTypeDWARFDebugRanges,
 eSectionTypeDWARFDebugStr,
+eSectionTypeDWARFDebugStrOffsets,
 eSectionTypeDWARFAppleNames,
 eSectionTypeDWARFAppleTypes,
 eSectionTypeDWARFAppleNamespaces,

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=245931&r1=245930&r2=245931&view=diff
==
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Tue Aug 25 06:45:58 2015
@@ -488,6 +488,8 @@ IRExecutionUnit::GetSectionTypeFromSecti
 sect_type = lldb::eSectionTypeDWARFDebugAbbrev;
 else if (dwarf_name.equals("aranges"))
 sect_type = lldb::eSectionTypeDWARFDebugAranges;
+else if (dwarf_name.equals("addr"))
+sect_type = lldb::eSectionTypeDWARFDebugAddr;
 break;
 
 case 'f':
@@ -522,6 +524,8 @@ IRExecutionUnit::GetSectionTypeFromSecti
 case 's':
 if (dwarf_name.equals("str"))
 sect_type = lldb::eSectionTypeDWARFDebugStr;
+else if (dwarf_name.equals("str_offsets"))
+sect_type = lldb::eSectionTypeDWARFDebugStrOffsets;
 break;
 
 case 'r':
@@ -789,6 +793,7 @@ IRExecutionUnit::CommitAllocations (lldb
 {
 case lldb::eSectionTypeInvalid:
 case lldb::eSectionTypeDWARFDebugAbbrev:
+case lldb::eSectionTypeDWARFDebugAddr:
 case lldb::eSectionTypeDWARFDebugAranges:
 case lldb::eSectionTypeDWARFDebugFrame:
 case lldb::eSectionTypeDWARFDebugInfo:
@@ -799,6 +804,7 @@ IRExecutionUnit::CommitAllocations (lldb
 case lldb::eSectionTypeDWARFDebugPubTypes:
 case lldb::eSectionTypeDWARFDebugRanges:
 case lldb::eSectionTypeDWARFDebugStr:
+case lldb::eSectionTypeDWARFDebugStrOffsets:
 case lldb::eSectionTypeDWARFAppleNames:
 case lldb::eSectionTypeDWARFAppleTypes:
 case lldb::eSectionTypeDWARFAppleNamespaces:

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=245931&r1=245930&r2=245931&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Aug 25 
06:45:58 

Re: [Lldb-commits] [PATCH] D12290: Handle DW_OP_GNU_addr_index in DWARF expressions

2015-08-25 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245932: Handle DW_OP_GNU_addr_index in DWARF expressions 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D12290?vs=32971&id=33061#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12290

Files:
  lldb/trunk/include/lldb/Expression/DWARFExpression.h
  lldb/trunk/source/Expression/DWARFExpression.cpp
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Symbol/Function.cpp

Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1488,7 +1488,11 @@
  unwindplan_regloc.GetDWARFExpressionLength(),
  process->GetByteOrder(), process->GetAddressByteSize());
 ModuleSP opcode_ctx;
-DWARFExpression dwarfexpr (opcode_ctx, dwarfdata, 0, unwindplan_regloc.GetDWARFExpressionLength());
+DWARFExpression dwarfexpr (opcode_ctx,
+   dwarfdata,
+   nullptr,
+   0,
+   unwindplan_regloc.GetDWARFExpressionLength());
 dwarfexpr.SetRegisterKind (unwindplan_registerkind);
 Value result;
 Error error;
@@ -1784,7 +1788,11 @@
  row->GetCFAValue().GetDWARFExpressionLength(),
  process->GetByteOrder(), process->GetAddressByteSize());
 ModuleSP opcode_ctx;
-DWARFExpression dwarfexpr (opcode_ctx, dwarfdata, 0, row->GetCFAValue().GetDWARFExpressionLength());
+DWARFExpression dwarfexpr (opcode_ctx,
+   dwarfdata,
+   nullptr,
+   0,
+   row->GetCFAValue().GetDWARFExpressionLength());
 dwarfexpr.SetRegisterKind (row_register_kind);
 Value result;
 Error error;
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
@@ -149,6 +149,8 @@
 size = 128; break;
 case DW_OP_regx:
 size = 128; break;
+case DW_OP_GNU_addr_index:
+size = 128; break;
 default:
 s.Printf("UNKNOWN ONE-OPERAND OPCODE, #%u", opcode);
 return 1;
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4013,7 +4013,7 @@
 Declaration decl;
 uint32_t i;
 lldb::user_id_t type_uid = LLDB_INVALID_UID;
-DWARFExpression location;
+DWARFExpression location(dwarf_cu);
 bool is_external = false;
 bool is_artificial = false;
 bool location_is_const_value_data = false;
Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -9616,7 +9616,7 @@
 int call_file = 0;
 int call_line = 0;
 int call_column = 0;
-DWARFExpression frame_base;
+DWARFExpression frame_base(dwarf_cu);
 
 assert (die->Tag() == DW_TAG_subprogram);
 
@@ -9835,6 +9835,7 @@
   NULL, // RegisterContext *
   module_sp,
   debug_info_data,
+  dwarf_cu,
   block_offset,
   block_length,
   eRegisterKindDWARF,
@@ -10204,7 +10205,7 @@
 if (num_attributes > 0)
 {
 Declaration decl;
-DWARFExpression location;
+DWARFExpression location(dwarf_cu);
 lldb::use

Re: [Lldb-commits] [PATCH] D12238: Add support for DW_FORM_GNU_[addr, str]_index

2015-08-25 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245931: Add support for DW_FORM_GNU_[addr,str]_index 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D12238?vs=32949&id=33062#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12238

Files:
  lldb/trunk/include/lldb/lldb-enumerations.h
  lldb/trunk/source/Expression/IRExecutionUnit.cpp
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Symbol/ObjectFile.cpp
  lldb/trunk/source/Utility/ConvertEnum.cpp

Index: lldb/trunk/include/lldb/lldb-enumerations.h
===
--- lldb/trunk/include/lldb/lldb-enumerations.h
+++ lldb/trunk/include/lldb/lldb-enumerations.h
@@ -595,6 +595,7 @@
 eSectionTypeDataObjCMessageRefs,// Pointer to function pointer + selector
 eSectionTypeDataObjCCFStrings,  // Objective C const CFString/NSString objects
 eSectionTypeDWARFDebugAbbrev,
+eSectionTypeDWARFDebugAddr,
 eSectionTypeDWARFDebugAranges,
 eSectionTypeDWARFDebugFrame,
 eSectionTypeDWARFDebugInfo,
@@ -605,6 +606,7 @@
 eSectionTypeDWARFDebugPubTypes,
 eSectionTypeDWARFDebugRanges,
 eSectionTypeDWARFDebugStr,
+eSectionTypeDWARFDebugStrOffsets,
 eSectionTypeDWARFAppleNames,
 eSectionTypeDWARFAppleTypes,
 eSectionTypeDWARFAppleNamespaces,
Index: lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -142,17 +142,19 @@
 
 static const SectionType g_sections[] =
 {
-eSectionTypeDWARFDebugAranges,
-eSectionTypeDWARFDebugInfo,
 eSectionTypeDWARFDebugAbbrev,
+eSectionTypeDWARFDebugAddr,
+eSectionTypeDWARFDebugAranges,
 eSectionTypeDWARFDebugFrame,
+eSectionTypeDWARFDebugInfo,
 eSectionTypeDWARFDebugLine,
-eSectionTypeDWARFDebugStr,
 eSectionTypeDWARFDebugLoc,
 eSectionTypeDWARFDebugMacInfo,
 eSectionTypeDWARFDebugPubNames,
 eSectionTypeDWARFDebugPubTypes,
 eSectionTypeDWARFDebugRanges,
+eSectionTypeDWARFDebugStr,
+eSectionTypeDWARFDebugStrOffsets,
 eSectionTypeELFSymbolTable,
 };
 for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]); ++idx)
Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1672,6 +1672,7 @@
 static ConstString g_sect_name_tdata (".tdata");
 static ConstString g_sect_name_tbss (".tbss");
 static ConstString g_sect_name_dwarf_debug_abbrev (".debug_abbrev");
+static ConstString g_sect_name_dwarf_debug_addr (".debug_addr");
 static ConstString g_sect_name_dwarf_debug_aranges (".debug_aranges");
 static ConstString g_sect_name_dwarf_debug_frame (".debug_frame");
 static ConstString g_sect_name_dwarf_debug_info (".debug_info");
@@ -1682,6 +1683,7 @@
 static ConstString g_sect_name_dwarf_debug_pubtypes (".debug_pubtypes");
 static ConstString g_sect_name_dwarf_debug_ranges (".debug_ranges");
 static ConstString g_sect_name_dwarf_debug_str (".debug_str");
+static ConstString g_sect_name_dwarf_debug_str_offsets (".debug_str_offsets");
 static ConstString g_sect_name_eh_frame (".eh_frame");
 
 SectionType sect_type = eSectionTypeOther;
@@ -1715,18 +1717,20 @@
 // MISSING? .gn

Re: [Lldb-commits] [PATCH] D12184: [MIPS] Avoid breakpoint in delay slot

2015-08-25 Thread Bhushan Attarde via lldb-commits
bhushan updated this revision to Diff 33063.
bhushan added a comment.

Addressed review comments.

1. Introduced Target::GetBreakableLoadAddress() instead of 
Target::AdjustBreakpointInDelaySlot() so that it should look more generic and 
targets can calculate the new breakpoint address based on whatever reason 
applicable to them (not restricting it to a delay-slot only).

2. Target::GetBreakableLoadAddress() does not do any work unless a target 
requires it.

3. Logging is enabled (under the breakpoint channel) and now mentions a reason 
why we changed the original breakpoint address. (In case of MIPS, the reason is 
a delay slot).


Repository:
  rL LLVM

http://reviews.llvm.org/D12184

Files:
  include/lldb/Core/Disassembler.h
  include/lldb/Target/Target.h
  source/Core/Disassembler.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
  source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
  source/Target/Target.cpp

Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -44,6 +44,8 @@
 #include "lldb/Interpreter/Property.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/Symbol.h"
 #include "lldb/Target/LanguageRuntime.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
@@ -344,6 +346,10 @@
 Target::CreateBreakpoint (lldb::addr_t addr, bool internal, bool hardware)
 {
 Address so_addr;
+
+// Check for any reason we want to move this breakpoint to other address.
+addr = GetBreakableLoadAddress(addr);
+
 // Attempt to resolve our load address if possible, though it is ok if
 // it doesn't resolve to section/offset.
 
@@ -2134,6 +2140,170 @@
 return opcode_addr;
 }
 
+lldb::addr_t
+Target::GetBreakableLoadAddress (lldb::addr_t addr)
+{
+addr_t breakable_addr = addr;
+Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS));
+
+switch (m_arch.GetMachine())
+{
+default:
+break;
+case llvm::Triple::mips:
+case llvm::Triple::mipsel:
+case llvm::Triple::mips64:
+case llvm::Triple::mips64el:
+{
+addr_t function_start = 0;
+addr_t current_offset = 0;
+uint32_t loop_count = 0;
+Address resolved_addr;
+uint32_t arch_flags = m_arch.GetFlags ();
+bool IsMips16 = arch_flags & ArchSpec::eMIPSAse_mips16;
+bool IsMicromips = arch_flags & ArchSpec::eMIPSAse_micromips;
+SectionLoadList §ion_load_list = GetSectionLoadList();
+
+if (section_load_list.IsEmpty())
+// No sections are loaded, so we must assume we are not running yet
+// and need to operate only on file address.
+m_images.ResolveFileAddress (addr, resolved_addr); 
+else
+section_load_list.ResolveLoadAddress(addr, resolved_addr);
+
+// Get the function boundaries to make sure we don't scan back before the beginning of the current function.
+ModuleSP temp_addr_module_sp (resolved_addr.GetModule());
+if (temp_addr_module_sp)
+{
+SymbolContext sc;
+uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
+uint32_t resolved_mask = temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc);
+if (sc.function)
+{
+function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
+if (function_start == LLDB_INVALID_ADDRESS)
+function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
+}
+else if (sc.symbol)
+{
+Address sym_addr = sc.symbol->GetAddress();
+function_start = sym_addr.GetFileAddress();
+}
+current_offset = addr - function_start;
+}
+
+// If breakpoint address is start of function then we dont have to do anything.
+if (current_offset == 0)
+return breakable_addr;
+else
+loop_count = current_offset / 2;
+
+if (loop_count > 3)
+{
+// Scan previous 6 bytes
+if (IsMips16 | IsMicromips)
+loop_count = 3;
+// For mips-only, instructions are always 4 bytes, so scan previous 4 bytes only.
+else
+loop_count = 2;
+}
+
+// Create Disassembler Instance
+lldb::DisassemblerSP disasm_sp (Disassembler::FindPlugin(m_arch, NULL, NULL));
+
+ExecutionContext exe_ctx;
+CalculateExecutionContext(exe_ctx);
+InstructionList instruction_list;
+InstructionSP prev_insn;
+bool prefer_file_cache = true; // Read from file
+uint32_t inst_to_choose = 0;
+
+for (uint32_t i = 1; i <= loop_count; i++)
+ 

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

2015-08-25 Thread Tamas Berghammer via lldb-commits
tberghammer updated this revision to Diff 33073.
tberghammer marked 10 inline comments as done.
tberghammer added a comment.

Fix the minor refactors requested in the review.

I haven't changed the approach to return all DIEs from the dwo file when 
indexing the main compile unit because I would like to hear your opinion about 
my concerns (see previous comment) about speed and memory usage first.


http://reviews.llvm.org/D12291

Files:
  include/lldb/Symbol/ObjectFile.h
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
  source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
  source/Symbol/ObjectFile.cpp

Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -602,15 +602,23 @@
 }
 
 SectionList *
-ObjectFile::GetSectionList()
+ObjectFile::GetSectionList(bool update_module_section_list)
 {
 if (m_sections_ap.get() == nullptr)
 {
-ModuleSP module_sp(GetModule());
-if (module_sp)
+if (update_module_section_list)
 {
-lldb_private::Mutex::Locker locker(module_sp->GetMutex());
-CreateSections(*module_sp->GetUnifiedSectionList());
+ModuleSP module_sp(GetModule());
+if (module_sp)
+{
+lldb_private::Mutex::Locker locker(module_sp->GetMutex());
+CreateSections(*module_sp->GetUnifiedSectionList());
+}
+}
+else
+{
+SectionList unified_section_list;
+CreateSections(unified_section_list);
 }
 }
 return m_sections_ap.get();
Index: source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
===
--- source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
+++ source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
@@ -86,7 +86,7 @@
 
 lldb::TypeSP m_type_sp;
 SymbolFileDWARF *m_symfile;
-const DWARFCompileUnit *m_cu;
+DWARFCompileUnit *m_cu;
 const DWARFDebugInfoEntry *m_die;
 lldb_private::Declaration m_declaration;
 int32_t m_byte_size;
@@ -118,7 +118,7 @@
 
 bool
 Find (SymbolFileDWARF *symfile,
-  const DWARFCompileUnit *cu,
+  DWARFCompileUnit *cu,
   const DWARFDebugInfoEntry *die, 
   const lldb_private::Declaration &decl,
   const int32_t byte_size,
@@ -151,7 +151,7 @@
 bool
 Find (const lldb_private::ConstString &name, 
   SymbolFileDWARF *symfile,
-  const DWARFCompileUnit *cu,
+  DWARFCompileUnit *cu,
   const DWARFDebugInfoEntry *die, 
   const lldb_private::Declaration &decl,
   const int32_t byte_size,
Index: source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
===
--- source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
+++ source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
@@ -21,7 +21,7 @@
 UniqueDWARFASTTypeList::Find 
 (
 SymbolFileDWARF *symfile,
-const DWARFCompileUnit *cu,
+DWARFCompileUnit *cu,
 const DWARFDebugInfoEntry *die, 
 const lldb_private::Declaration &decl,
 const int32_t byte_size,
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- /dev/null
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -0,0 +1,45 @@
+//===-- SymbolFileDWARFDwo.h *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
+#define SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "SymbolFileDWARF.h"
+
+class SymbolFileDWARFDwo : public SymbolFileDWARF
+{
+public:
+SymbolFileDWARFDwo(lldb_private::ObjectFile* objfile, DWARFCompileUnit* dwarf_cu);
+
+virtual
+~SymbolFileDWARFDwo() = default;
+
+const lldb_private::DWARFDataExtractor&
+GetCachedSectionData(uint32_t got_flag,
+ lldb::SectionType sec

Re: [Lldb-commits] [PATCH] D9703: Adds support for ARM hardware watchpoints

2015-08-25 Thread Muhammad Omair Javaid via lldb-commits
omjavaid updated this revision to Diff 33075.
omjavaid added a comment.

This updated patches correct problems in arm hardware watchpoint support patch 
posted earlier.

This patch has been tested on samsung chromebook (ARM - Linux) and PandaBoard 
using basic watchpoint test application.

Also it was tested on Nexus 7 Android device.

On chromebook linux we are able to set and clear all types of watchpoints but 
on android we end up getting a watchpoint packet error because we are not able 
to call hardware watchpoint ptrace functions successfully.

I still dont have a android device on me that has hardware watchpoints enable 
but fact that this functionality now works on linux means that we should get 
this into our source code.

I am trying to write a test to check hardware watchpoint capabilities of a 
platform so we are pretty sure what works on which platform.

Is this good to commit?


http://reviews.llvm.org/D9703

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -183,6 +183,8 @@
 #else
 if (host_arch.GetMachine() == llvm::Triple::aarch64 ||
 host_arch.GetMachine() == llvm::Triple::aarch64_be ||
+host_arch.GetMachine() == llvm::Triple::arm ||
+host_arch.GetMachine() == llvm::Triple::armeb ||
 host_arch.GetMachine() == llvm::Triple::mips64 ||
 host_arch.GetMachine() == llvm::Triple::mips64el)
 response.Printf("watchpoint_exceptions_received:before;");
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -48,6 +48,47 @@
 Error
 WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override;
 
+//--
+// Hardware breakpoints/watchpoint mangement functions
+//--
+
+uint32_t
+SetHardwareBreakpoint (lldb::addr_t addr, size_t size) override;
+
+bool
+ClearHardwareBreakpoint (uint32_t hw_idx) override;
+
+uint32_t
+NumSupportedHardwareWatchpoints () override;
+
+uint32_t
+SetHardwareWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags) override;
+
+bool
+ClearHardwareWatchpoint (uint32_t hw_index) override;
+
+Error
+ClearAllHardwareWatchpoints () override;
+
+Error
+GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr) override;
+
+lldb::addr_t
+GetWatchpointAddress (uint32_t wp_index) override;
+
+uint32_t
+GetWatchpointSize(uint32_t wp_index);
+
+bool
+WatchpointIsEnabled(uint32_t wp_index);
+
+// Debug register type select
+enum DREGType
+{
+eDREGTypeWATCH = 0,
+eDREGTypeBREAK
+};
+
 protected:
 void*
 GetGPRBuffer() override { return &m_gpr_arm; }
@@ -94,11 +135,32 @@
 RegInfo  m_reg_info;
 FPU m_fpr; 
 
+// Debug register info for hardware breakpoints and watchpoints management.
+struct DREG
+{
+lldb::addr_t address;  // Breakpoint/watchpoint address value.
+uint32_t control;  // Breakpoint/watchpoint control value.
+uint32_t refcount;  // Serves as enable/disable and refernce counter.
+};
+
+struct DREG m_hbr_regs[16];  // Arm native linux hardware breakpoints
+struct DREG m_hwp_regs[16];  // Arm native linux hardware watchpoints
+
+uint32_t m_max_hwp_supported;
+uint32_t m_max_hbp_supported;
+bool m_refresh_hwdebug_info;
+
 bool
 IsGPR(unsigned reg) const;
 
 bool
 IsFPR(unsigned reg) const;
+
+Error
+ReadHardwareDebugInfo();
+
+Error
+WriteHardwareDebugRegs(int hwbType, int hwb_index);
 };
 
 } // namespace process_linux
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -13,6 +13,7 @@
 
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Error.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/RegisterValue.h"
 
 #include "Plug

Re: [Lldb-commits] [PATCH] D9703: Adds support for ARM hardware watchpoints

2015-08-25 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

Looks good with a few minor comments inline



Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:397
@@ +396,3 @@
+
+uint32_t control_value, bp_index;
+

(nit): Please initialize these variables


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:434
@@ +433,3 @@
+ if (bp_index == LLDB_INVALID_INDEX32)
+return LLDB_INVALID_INDEX32;
+

(nit): Indentation


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:444
@@ +443,3 @@
+// PTRACE call to set corresponding hardware breakpoint register.
+WriteHardwareDebugRegs(eDREGTypeBREAK, bp_index);
+}

Please check for error


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:484
@@ +483,3 @@
+// PTRACE call to clear corresponding hardware breakpoint register.
+WriteHardwareDebugRegs(eDREGTypeBREAK, hw_idx);
+}

I think a return true is missing here


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:484
@@ +483,3 @@
+// PTRACE call to clear corresponding hardware breakpoint register.
+WriteHardwareDebugRegs(eDREGTypeBREAK, hw_idx);
+}

tberghammer wrote:
> I think a return true is missing here
Please check for error


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:525
@@ +524,3 @@
+   
+uint32_t control_value, wp_index, addr_word_offset, byte_mask;
+

(nit): Please initialize


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:599
@@ +598,3 @@
+// PTRACE call to set corresponding watchpoint register.
+WriteHardwareDebugRegs(eDREGTypeWATCH, wp_index);
+}

Please check for error


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:640
@@ +639,3 @@
+// Ptrace call to update hardware debug registers
+WriteHardwareDebugRegs(eDREGTypeWATCH, wp_index);
+return true;

Please check for error


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:673
@@ +672,3 @@
+// Ptrace call to update hardware debug registers
+WriteHardwareDebugRegs(eDREGTypeWATCH, i);
+}

Please check for error


http://reviews.llvm.org/D9703



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


Re: [Lldb-commits] [PATCH] D12275: Fix build on mips

2015-08-25 Thread Hans Wennborg via lldb-commits
hans added a comment.

In http://reviews.llvm.org/D12275#231979, @sagar wrote:

> I have committed it to the trunk in revision 245927.  You can now merge it to 
> the release branch.


Thanks! Merged in r245947.


Repository:
  rL LLVM

http://reviews.llvm.org/D12275



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


Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Unless you really know what you are doing, I don't want anyone playing with 
this code just to fix some random test case.

What must remain true: we first try the currently selected platform, but we 
must make sure it is compatible with the architecture of the binary specified 
and the arch that was specified. If the platform and arch are compatible with 
the current platform, we use it. Else we find a platform that will work with 
the current binary and specified architecture (either of which can be missing).


Repository:
  rL LLVM

http://reviews.llvm.org/D12303



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


Re: [Lldb-commits] [PATCH] D12184: [MIPS] Avoid breakpoint in delay slot

2015-08-25 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D12184



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


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

2015-08-25 Thread Greg Clayton via lldb-commits
clayborg added a comment.

I also question why Symbo

In http://reviews.llvm.org/D12291#231523, @tberghammer wrote:

> In the current version of the patch the compile units in the main object file 
> hands out only the compile unit DIE with the information what is available in 
> the main object file. I considered the other approach (hand out all DIEs by 
> the DWARF compile unit in the main object file) but I dropped it for the 
> following reasons:
>
> - If we hand out DIEs from a dwo symbol file then each DIE have to store a 
> pointer to the symbol file (or compile unit) it belongs to what is a 
> significant memory overhead (we have more DIEs then Symbols) if we ever want 
> to store all DIE in memory. Even worse is that we have to change all name to 
> DIE index to contain a pointer (compile unit / dwo symbol file) and an offset 
> to find the DIE belongs to (compared to just an offset now) what is more 
> entry then the number DIEs.


Can't we just store the SymbolFile inside the compile unit? We always need the 
compile unit to really do anything with a DIE anyway. We currently store the 
DWO file inside the compile unit so it seems that we could just store it once 
in the compile unit and avoid any extra cost.

> - In an average debug session run from an IDE the user usually sets the 
> breakpoints based on file name + line number, display some stack traces, some 
> variables and do some stepping. If we can index each dwo file separately then 
> we can handle all of these features without parsing the full debug info what 
> can give us some significant speed benefits at debugger startup time.


I don't see how we can ever just index one DWO file? If we index one, we must 
index them all within an executable otherwise the index will be incomplete. If 
you set a file + line breakpoint, you can't rely on the file matching the 
compile unit because there could be inlined functions so you would always need 
to index all of them. Likewise with setting a breakpoint by function name, you 
will need to index all DWO files.

Maybe we can:

- Have a new class that we hand out for a DIE, maybe named DWARFDIE that 
contains:

  class DWARFDIE
  {
  DWARFCompileUnit *m_cu;
  DWARFDebugInfoEntry *m_die;
  };

Then change all of the places we currently use a "DWARFCompileUnit *cu, 
DWARFDebugInfoEntry* die" (we always pass them around together) to use a 
DWARFDIE instead. This allows us to store the DIEs efficiently, yet pass them 
around in a slightly larger container for usage. This would allow our memory 
usage to stay very close to where it is (an extra pointer in the compile unit).

Then we modify DWARFCompileUnit to store the "SymbolFileDWARF *" that the 
compile unit comes from. We can still store the DWO file in the compile unit as 
well as you are already doing, we would just need to add a "SymbolFileDWARF 
*m_dwarf;" member variable for the non DWO case (and also for digging up the 
DW_TAG_compile_unit attributes that aren't in the DWO DW_TAG_compile_unit).

Then we just make sure that all code that hands out DIEs actually hands out 
DWARFDIE instances instead of returning a "DWARFDebugInfoEntry *" and also 
having an out parameter that fills in the compile unit.

Thoughts?


http://reviews.llvm.org/D12291



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


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

2015-08-25 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

In http://reviews.llvm.org/D12291#232191, @clayborg wrote:

> I also question why Symbo
>
> In http://reviews.llvm.org/D12291#231523, @tberghammer wrote:
>
> > In the current version of the patch the compile units in the main object 
> > file hands out only the compile unit DIE with the information what is 
> > available in the main object file. I considered the other approach (hand 
> > out all DIEs by the DWARF compile unit in the main object file) but I 
> > dropped it for the following reasons:
> >
> > - If we hand out DIEs from a dwo symbol file then each DIE have to store a 
> > pointer to the symbol file (or compile unit) it belongs to what is a 
> > significant memory overhead (we have more DIEs then Symbols) if we ever 
> > want to store all DIE in memory. Even worse is that we have to change all 
> > name to DIE index to contain a pointer (compile unit / dwo symbol file) and 
> > an offset to find the DIE belongs to (compared to just an offset now) what 
> > is more entry then the number DIEs.
>
>
> Can't we just store the SymbolFile inside the compile unit? We always need 
> the compile unit to really do anything with a DIE anyway. We currently store 
> the DWO file inside the compile unit so it seems that we could just store it 
> once in the compile unit and avoid any extra cost.


In the name to DIE indexes (in SymbolFileDWARF) currently we store only a DIE 
offset and we find the compile unit based on the fact that the DIE should be 
inside the range of the compile unit. The compile units leave in the dwo symbol 
files all start at address 0 so just a DIE offset isn't enough to find the 
compile unit. We can store the offset in 4 byte (we already do it, but I am not 
sure it is a good idea) and the compile unit index in another 4 byte what isn't 
a major overhead, but it can matter for large inferiors. Storing the symbol 
file  in the DIE might be avoidable but then the DIE have to ask the compile 
unit for the correct symbol file when somebody queries it for an attribute (we 
don't want the caller of the GetAttribute* function to know about dwo files).

> 

> 

> > - In an average debug session run from an IDE the user usually sets the 
> > breakpoints based on file name + line number, display some stack traces, 
> > some variables and do some stepping. If we can index each dwo file 
> > separately then we can handle all of these features without parsing the 
> > full debug info what can give us some significant speed benefits at 
> > debugger startup time.

> 

> 

> I don't see how we can ever just index one DWO file? If we index one, we must 
> index them all within an executable otherwise the index will be incomplete. 
> If you set a file + line breakpoint, you can't rely on the file matching the 
> compile unit because there could be inlined functions so you would always 
> need to index all of them. Likewise with setting a breakpoint by function 
> name, you will need to index all DWO files.


I made a few measurements a few weeks ago and setting a file + line breakpoint 
re

> Maybe we can:

> 

> - Have a new class that we hand out for a DIE, maybe named DWARFDIE that 
> contains:

> 

>   ``` class DWARFDIE { DWARFCompileUnit *m_cu; DWARFDebugInfoEntry *m_die; }; 
> ```

> 

>   Then change all of the places we currently use a "DWARFCompileUnit *cu, 
> DWARFDebugInfoEntry* die" (we always pass them around together) to use a 
> DWARFDIE instead. This allows us to store the DIEs efficiently, yet pass them 
> around in a slightly larger container for usage. This would allow our memory 
> usage to stay very close to where it is (an extra pointer in the compile 
> unit).

> 

>   Then we modify DWARFCompileUnit to store the "SymbolFileDWARF *" that the 
> compile unit comes from. We can still store the DWO file in the compile unit 
> as well as you are already doing, we would just need to add a 
> "SymbolFileDWARF *m_dwarf;" member variable for the non DWO case (and also 
> for digging up the DW_TAG_compile_unit attributes that aren't in the DWO 
> DW_TAG_compile_unit).

> 

>   Then we just make sure that all code that hands out DIEs actually hands out 
> DWARFDIE instances instead of returning a "DWARFDebugInfoEntry *" and also 
> having an out parameter that fills in the compile unit.

> 

>   Thoughts?




Comment at: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp:348
@@ -292,1 +347,3 @@
+}
+}
 

abidh wrote:
> You are not using the DW_AT_GNU_dwo_id. Is this intentional or an oversight?
I just forgot to check if (fixed).


Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:806-818
@@ -802,10 +805,15 @@
 case DW_AT_high_pc:
-hi_pc = form_value.Unsigned();
-if (form_value.Form() != DW_FORM_addr)
+if (form_value.Form() == DW_FORM_addr ||
+form_value.Form() == DW_FORM_GNU_addr_index)
 

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

2015-08-25 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Sorry, first I manage to submit my comments without finishing them.

In http://reviews.llvm.org/D12291#232191, @clayborg wrote:

> I also question why Symbo
>
> In http://reviews.llvm.org/D12291#231523, @tberghammer wrote:
>
> > In the current version of the patch the compile units in the main object 
> > file hands out only the compile unit DIE with the information what is 
> > available in the main object file. I considered the other approach (hand 
> > out all DIEs by the DWARF compile unit in the main object file) but I 
> > dropped it for the following reasons:
> >
> > - If we hand out DIEs from a dwo symbol file then each DIE have to store a 
> > pointer to the symbol file (or compile unit) it belongs to what is a 
> > significant memory overhead (we have more DIEs then Symbols) if we ever 
> > want to store all DIE in memory. Even worse is that we have to change all 
> > name to DIE index to contain a pointer (compile unit / dwo symbol file) and 
> > an offset to find the DIE belongs to (compared to just an offset now) what 
> > is more entry then the number DIEs.
>
>
> Can't we just store the SymbolFile inside the compile unit? We always need 
> the compile unit to really do anything with a DIE anyway. We currently store 
> the DWO file inside the compile unit so it seems that we could just store it 
> once in the compile unit and avoid any extra cost.


In the name to DIE indexes (in SymbolFileDWARF) currently we store only a DIE 
offset and we find the compile unit based on the fact that the DIE should be 
inside the range of the compile unit. The compile units leave in the dwo symbol 
files all start at address 0 so just a DIE offset isn't enough to find the 
compile unit. We can store the offset in 4 byte (we already do it, but I am not 
sure it is a good idea) and the compile unit index in another 4 byte what isn't 
a major overhead, but it can matter for large inferiors. Storing the symbol 
file  in the DIE might be avoidable but then the DIE have to ask the compile 
unit for the correct symbol file when somebody queries it for an attribute (we 
don't want the caller of the GetAttribute* function to know about dwo files).

> 

> 

> > - In an average debug session run from an IDE the user usually sets the 
> > breakpoints based on file name + line number, display some stack traces, 
> > some variables and do some stepping. If we can index each dwo file 
> > separately then we can handle all of these features without parsing the 
> > full debug info what can give us some significant speed benefits at 
> > debugger startup time.

> 

> 

> I don't see how we can ever just index one DWO file? If we index one, we must 
> index them all within an executable otherwise the index will be incomplete. 
> If you set a file + line breakpoint, you can't rely on the file matching the 
> compile unit because there could be inlined functions so you would always 
> need to index all of them. Likewise with setting a breakpoint by function 
> name, you will need to index all DWO files.


I made a few measurements a few weeks ago and to set a file + line breakpoint 
we only need to parse the line table what is reasonably fast while parsing all 
DIEs is significantly slower. Setting a breakpoint based on function name 
require a full dwarf parsing, but if you use an IDE you almost never want to do 
it.

> Maybe we can:

> 

> - Have a new class that we hand out for a DIE, maybe named DWARFDIE that 
> contains:

> 

>   ``` class DWARFDIE { DWARFCompileUnit *m_cu; DWARFDebugInfoEntry *m_die; }; 
> ```

> 

>   Then change all of the places we currently use a "DWARFCompileUnit *cu, 
> DWARFDebugInfoEntry* die" (we always pass them around together) to use a 
> DWARFDIE instead. This allows us to store the DIEs efficiently, yet pass them 
> around in a slightly larger container for usage. This would allow our memory 
> usage to stay very close to where it is (an extra pointer in the compile 
> unit).

> 

>   Then we modify DWARFCompileUnit to store the "SymbolFileDWARF *" that the 
> compile unit comes from. We can still store the DWO file in the compile unit 
> as well as you are already doing, we would just need to add a 
> "SymbolFileDWARF *m_dwarf;" member variable for the non DWO case (and also 
> for digging up the DW_TAG_compile_unit attributes that aren't in the DWO 
> DW_TAG_compile_unit).

> 

>   Then we just make sure that all code that hands out DIEs actually hands out 
> DWARFDIE instances instead of returning a "DWARFDebugInfoEntry *" and also 
> having an out parameter that fills in the compile unit.

> 

>   Thoughts?


I like the idea about passing them around together especially as we already do 
it in a lot of case and it will have only a small overhead, but it don't help 
on the fact that the name to DIE indexes have to store a compile unit pointer 
(or a compile unit index). I am not sure how much we want to worry about the 
memory usage increase because I estimate

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

2015-08-25 Thread Greg Clayton via lldb-commits
clayborg added a comment.

For our DWARF in .o files, I have SymbolFileDWARFDebugMap which loads the DWARF 
from .o files. Each .o file is loaded in a completely unchanged version of 
SymbolFileDWARF. Any lldb::user_id_t that are generated use:

  lldb::user_id_t
  SymbolFileDWARF::MakeUserID (dw_offset_t die_offset) const
  {
  return GetID() | die_offset;
  }

For a normal DWARF file GetID() returns 0. When used under a 
SymbolFileDWARFDebugMap, we set the ID to the index of the DWARF file. This 
encodes the SymbolFileDWARF's index in SymbolFileDWARFDebugMap's array as the 
high 32 bits of any IDs that are passed around and allow us to hand out unique 
IDs where the DIE offset ORed with the SymbolFileDWARF index is the ID. The IDs 
are then trimmed down to the low 32 bits before the SymbolFileDWARF looks them 
up. Actually dw_offset_t is 32 bit, so even if you pass a 64 bit value to 
anything that looks up a DIE, it will get correctly truncated.

So this should be possible. If desired, I can first make a patch that 
implements the DWARFDIE stuff, then we can update this patch to deal with that 
after that is done?


http://reviews.llvm.org/D12291



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


Re: [Lldb-commits] [PATCH] D12184: [MIPS] Avoid breakpoint in delay slot

2015-08-25 Thread Jim Ingham via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Thanks, that looks good to me too.


Repository:
  rL LLVM

http://reviews.llvm.org/D12184



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


Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Dawn Perchik via lldb-commits
dawn abandoned this revision.
dawn added a comment.

Thank you both for your explanation and reviews.  After further investigation 
in light of this, it appears the problem most likely lies in the python API.  
That's an area I'm unfamiliar with however.  I'll open a bug and submit a patch 
to disable the offending test.


Repository:
  rL LLVM

http://reviews.llvm.org/D12303



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


[Lldb-commits] [lldb] r245961 - Adds support for hardware watchpoints on Arm targets.

2015-08-25 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Tue Aug 25 13:22:04 2015
New Revision: 245961

URL: http://llvm.org/viewvc/llvm-project?rev=245961&view=rev
Log:
Adds support for hardware watchpoints on Arm targets.

http://reviews.llvm.org/D9703

This updated patches correct problems in arm hardware watchpoint support patch 
posted earlier.

This patch has been tested on samsung chromebook (ARM - Linux) and PandaBoard 
using basic watchpoint test application.

Also it was tested on Nexus 7 Android device.

On chromebook linux we are able to set and clear all types of watchpoints but 
on android we end up getting a watchpoint packet error because we are not able 
to call hardware watchpoint ptrace functions successfully.


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

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp?rev=245961&r1=245960&r2=245961&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp 
Tue Aug 25 13:22:04 2015
@@ -13,12 +13,24 @@
 
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Error.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/RegisterValue.h"
 
 #include "Plugins/Process/Utility/RegisterContextLinux_arm.h"
 
 #define REG_CONTEXT_SIZE (GetGPRSize() + sizeof (m_fpr))
 
+#ifndef PTRACE_GETHBPREGS
+  #define PTRACE_GETHBPREGS 29
+  #define PTRACE_SETHBPREGS 30
+#endif
+#if !defined(PTRACE_TYPE_ARG3)
+  #define PTRACE_TYPE_ARG3 void *
+#endif
+#if !defined(PTRACE_TYPE_ARG4)
+  #define PTRACE_TYPE_ARG4 void *
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_linux;
@@ -138,6 +150,12 @@ NativeRegisterContextLinux_arm::NativeRe
 
 ::memset(&m_fpr, 0, sizeof (m_fpr));
 ::memset(&m_gpr_arm, 0, sizeof (m_gpr_arm));
+::memset(&m_hwp_regs, 0, sizeof (m_hwp_regs));
+
+// 16 is just a maximum value, query hardware for actual watchpoint count
+m_max_hwp_supported = 16;
+m_max_hbp_supported = 16;
+m_refresh_hwdebug_info = true;
 }
 
 uint32_t
@@ -360,4 +378,470 @@ NativeRegisterContextLinux_arm::IsFPR(un
 return (m_reg_info.first_fpr <= reg && reg <= m_reg_info.last_fpr);
 }
 
+uint32_t
+NativeRegisterContextLinux_arm::SetHardwareBreakpoint (lldb::addr_t addr, 
size_t size)
+{
+Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_WATCHPOINTS));
+
+if (log)
+log->Printf ("NativeRegisterContextLinux_arm::%s()", __FUNCTION__);
+
+Error error;
+
+// Read hardware breakpoint and watchpoint information.
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
+
+uint32_t control_value = 0, bp_index = 0;
+
+// Check if size has a valid hardware breakpoint length.
+// Thumb instructions are 2-bytes but we have no way here to determine
+// if target address is a thumb or arm instruction.
+// TODO: Add support for setting thumb mode hardware breakpoints
+if (size != 4 && size != 2)
+return LLDB_INVALID_INDEX32;
+
+// Setup control value
+// Make the byte_mask into a valid Byte Address Select mask
+control_value = 0xfu << 5;
+
+// Enable this breakpoint and make it stop in privileged or user mode;
+control_value |= 7;
+
+// Make sure bits 1:0 are clear in our address
+// This should be different once we support thumb here.
+addr &= ~((lldb::addr_t)3);
+
+// Iterate over stored hardware breakpoints
+// Find a free bp_index or update reference count if duplicate.
+bp_index = LLDB_INVALID_INDEX32;
+
+for (uint32_t i = 0; i < m_max_hbp_supported; i++)
+{
+if ((m_hbr_regs[i].control & 1) == 0)
+{
+bp_index = i;  // Mark last free slot
+}
+else if (m_hbr_regs[i].address == addr && m_hbr_regs[i].control == 
control_value)
+{
+bp_index = i;  // Mark duplicate index
+break;  // Stop searching here
+}
+}
+
+ if (bp_index == LLDB_INVALID_INDEX32)
+ return LLDB_INVALID_INDEX32;
+
+// Add new or update existing watchpoint
+if ((m_hbr_regs[bp_index].control & 1) == 0)
+{
+m_hbr_regs[bp_index].address = addr;
+m_hbr_regs[bp_index].control = control_value;
+m_hbr_regs[bp_index].refcount = 1;
+
+// PTRACE call to set corresponding hardware breakpoint register.
+error = WriteHardwareDebugRegs(eDREGTypeBREAK, bp_index);
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
+  

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

2015-08-25 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

If I understand you correctly then you are suggesting to create a class like 
SymbolFileDWARFDebugMap for handling object files with dwo files. I think that 
approach is practically have the same code flow as the current one (one symbol 
file which one stores a list of sub symbol files). The 2 main difference is 
having a separate top level symbol file class for it makes the abstraction a 
bit cleaner (we have to refer to the debug map symfile several place in 
SymbolFileDWARF) but also require more code where some of it is code 
duplication. With dwo files it is a bit more complicated to solve is because 
there is no easy way do find out if a file contains dwo entries or not and it 
is possible for an object file to have some compile unit with dwo entry and 
some compile unit what is present in the main symbol file (I don't think it is 
a common scenario).

If we would like to go in the direction with abstracting out the dwo handling 
more, then I would suggest to change the NameToDIE arrays to store 
lldb::user_id_t where the 32MSB represents the dwarf compile unit index and 
32LSB is the DIE offset. Then each function what currently find a (dwarf) 
compile unit based on die offset can use the compile unit index while the rest 
of the dwo handling can be abstracted out into the 
DWARCompileUnit/DWARFDebugInfoEntry classes (+ possibly a few more DWARF 
class). My only concern with this approach is that we start storing 2 different 
information in the higher bits of user_id_t what can cause problems. (Is there 
a reason we want to abstract this feature out considering that it is almost 
standard dwarf?)

All in all I don't want to have a separate top level symbol file (referenced by 
a SymbolVendor) for handling dwo files because I think it is more work to 
maintain it and don't give us too much benefits. Next to it I am happy with 
most possible approach.

If you would like to help me with implementing the split dwarf handling then I 
welcome any help but currently I can focus this issue in most of my time and 
would like to get it working (with 100% test pass rate) before mid September so 
I would like to try to avoid situations where we start waiting on each other.


http://reviews.llvm.org/D12291



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


[Lldb-commits] [PATCH] D12327: Treat cleanup errors separately from test failures

2015-08-25 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: clayborg, spyffe.
zturner added a subscriber: lldb-commits.

There is a certain class of test failures that arise as a result of errors that 
occur during cleanup.  For the most part, these don't indicate test failures 
and so it's useful to distinguish them from test failures.  This patch creates 
a new category of error, called a CleanupError, that is handled (and reported) 
independently of whether or not any individual tests failed.

This is especially important when there is a directory that contains multiple 
test suites, because previously a cleanup error on the first suite would 
automatically cause subsequent suites in the same directory to not run, as a 
result of exception propagation.

http://reviews.llvm.org/D12327

Files:
  test/dotest.py
  test/lldbtest.py
  test/unittest2/case.py
  test/unittest2/result.py

Index: test/unittest2/result.py
===
--- test/unittest2/result.py
+++ test/unittest2/result.py
@@ -42,6 +42,7 @@
 self.failures = []
 self.passes = []
 self.errors = []
+self.cleanup_errors = []
 self.testsRun = 0
 self.skipped = []
 self.expectedFailures = []
@@ -109,6 +110,13 @@
 self.errors.append((test, self._exc_info_to_string(err, test)))
 self._mirrorOutput = True
 
+def addCleanupError(self, test, err):
+"""Called when an error has occurred during cleanup. 'err' is a tuple of
+values as returned by sys.exc_info().
+"""
+self.cleanup_errors.append((test, self._exc_info_to_string(err, test)))
+self._mirrorOutput = True
+
 @failfast
 def addFailure(self, test, err):
 """Called when an error has occurred. 'err' is a tuple of values as
Index: test/unittest2/case.py
===
--- test/unittest2/case.py
+++ test/unittest2/case.py
@@ -383,9 +383,11 @@
 try:
 self.tearDown()
 except Exception:
-result.addError(self, sys.exc_info())
+result.addCleanupError(self, sys.exc_info())
 success = False
 
+self.dumpSessionInfo()
+
 cleanUpSuccess = self.doCleanups()
 success = success and cleanUpSuccess
 if success:
Index: test/lldbtest.py
===
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -1195,8 +1195,7 @@
 if doCleanup and not lldb.skip_build_and_cleanup:
 # First, let's do the platform-specific cleanup.
 module = builder_module()
-if not module.cleanup():
-raise Exception("Don't know how to do cleanup")
+module.cleanup()
 
 # Subclass might have specific cleanup function defined.
 if getattr(cls, "classCleanup", None):
@@ -1385,6 +1384,7 @@
 # initially.  If the test errored/failed, the session info
 # (self.session) is then dumped into a session specific file for
 # diagnosis.
+self.__cleanup_errored__ = False
 self.__errored__= False
 self.__failed__ = False
 self.__expected__   = False
@@ -1616,9 +1616,6 @@
 
 self.disableLogChannelsForCurrentTest()
 
-# Decide whether to dump the session info.
-self.dumpSessionInfo()
-
 # =
 # Various callbacks to allow introspection of test progress
 # =
@@ -1631,6 +1628,14 @@
 # Once by the Python unittest framework, and a second time by us.
 print >> sbuf, "ERROR"
 
+def markCleanupError(self):
+"""Callback invoked when an error occurs while a test is cleaning up."""
+self.__cleanup_errored__ = True
+with recording(self, False) as sbuf:
+# False because there's no need to write "CLEANUP_ERROR" to the stderr twice.
+# Once by the Python unittest framework, and a second time by us.
+print >> sbuf, "CLEANUP_ERROR"
+
 def markFailure(self):
 """Callback invoked when a failure (test assertion failure) occurred."""
 self.__failed__ = True
@@ -1729,6 +1734,9 @@
 if self.__errored__:
 pairs = lldb.test_result.errors
 prefix = 'Error'
+if self.__cleanup_errored__:
+pairs = lldb.test_result.cleanup_errors
+prefix = 'CleanupError'
 elif self.__failed__:
 pairs = lldb.test_result.failures
 prefix = 'Failure'
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -1685,6 +1685,17 @@
 if parsable:
 self.stream.write("FAIL: LLDB (%s

[Lldb-commits] [PATCH] D12328: Error checking correction in AArch64 hardware watchpoint code

2015-08-25 Thread Muhammad Omair Javaid via lldb-commits
omjavaid created this revision.
omjavaid added reviewers: tberghammer, clayborg.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: rengolin, aemerson.

This patch fixes a few areas where AArch64 hardware watchpoints were not 
emitting errors correctly.

This makes sure any ptrace failures are reflected in any packet responses from 
the server.

http://reviews.llvm.org/D12328

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp

Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
===
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -391,10 +391,15 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
 
-uint32_t control_value, bp_index;
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
+
+uint32_t control_value = 0, bp_index = 0;
 
 // Check if size has a valid hardware breakpoint length.
 if (size != 4)
@@ -436,7 +441,10 @@
 m_hbr_regs[bp_index].refcount = 1;
 
 // PTRACE call to set corresponding hardware breakpoint register.
-WriteHardwareDebugRegs(eDREGTypeBREAK);
+error = WriteHardwareDebugRegs(eDREGTypeBREAK);
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 }
 else
 m_hbr_regs[bp_index].refcount++;
@@ -452,8 +460,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 
 if (hw_idx >= m_max_hbp_supported)
 return false;
@@ -472,6 +485,11 @@
 
 // PTRACE call to clear corresponding hardware breakpoint register.
 WriteHardwareDebugRegs(eDREGTypeBREAK);
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
+
+return true;
 }
 
 return false;
@@ -485,8 +503,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 
 return m_max_hwp_supported;
 }
@@ -499,10 +522,15 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 		
-uint32_t control_value, wp_index;
+uint32_t control_value = 0, wp_index = 0;
 
 // Check if we are setting watchpoint other than read/write/access
 // Also update watchpoint flag to match AArch64 write-read bit configuration.
@@ -562,7 +590,10 @@
 m_hwp_regs[wp_index].refcount = 1;
 
 // PTRACE call to set corresponding watchpoint register.
-WriteHardwareDebugRegs(eDREGTypeWATCH);
+error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 }
 else
 m_hwp_regs[wp_index].refcount++;
@@ -578,8 +609,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return LLDB_INVALID_INDEX32;
 
 if (wp_index >= m_max_hwp_supported)
 return false;
@@ -598,7 +634,11 @@
 m_hwp_regs[wp_index].refcount = 0;
 
 // Ptrace call to update hardware debug registers
-WriteHardwareDebugRegs(eDREGTypeWATCH);
+error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+if (error.Fail())
+return false;
+
 return true;
 }
 
@@ -613,8 +653,13 @@
 if (log)
 log->Printf ("NativeRegisterContextLinux_arm64::%s()", __FUNCTION__);
 
+Error error;
+
 // Read hardware breakpoint and watchpoint information.
-ReadHardwareDebugInfo ();
+error = ReadHardwareDebugInfo ();
+
+if (error.Fail())
+return error;
 
 for (uint32_t i = 0; i < m_max_hwp_supported; i++)
 {
@@ -626,7 +671,10 @@
 m_hwp_regs[i].refcount = 0;
 
 // Ptrace call to update hardware debug registers
-WriteHardwareDebugRegs(eDREGTypeWATCH);
+error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+if (error.Fail())
+

[Lldb-commits] [PATCH] D12329: Skip test which is causing ERRORs in dotest.py on OSX after r237053

2015-08-25 Thread Dawn Perchik via lldb-commits
dawn created this revision.
dawn added reviewers: ted, clayborg.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

See llvm.org/pr24575

Repository:
  rL LLVM

http://reviews.llvm.org/D12329

Files:
  test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py

Index: test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
===
--- test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
+++ test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
@@ -12,6 +12,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipIfDarwin # llvm.org/pr24575: all ERRORs in dotest.py on OSX after this
 @python_api_test
 def test_disassemble_invalid_vst_1_64_raw_data(self):
 """Test disassembling invalid vst1.64 raw bytes with the API."""


Index: test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
===
--- test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
+++ test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
@@ -12,6 +12,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipIfDarwin # llvm.org/pr24575: all ERRORs in dotest.py on OSX after this
 @python_api_test
 def test_disassemble_invalid_vst_1_64_raw_data(self):
 """Test disassembling invalid vst1.64 raw bytes with the API."""
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Ted Woodward via lldb-commits
ted added a comment.

My guess is the target create is failing. This line in the test:

  target = self.dbg.CreateTargetWithFileAndTargetTriple ("", "thumbv7")
   

Seems to be the same as:

  target create -a thumbv7 ""

On my Linux box, I get this:

  (lldb) target create -a thumbv7 ""
  Current executable set to '' (arm).
  (lldb) target list
  Current targets:
  * target #0:  ( arch=arm--linux, platform=remote-linux )

My guess is LLDB on OSX doesn't have a platform that would handle a "thumbv7" 
target, so the target create fails.

Perhaps LLDB should stick with the selected platform if it's valid and it can't 
find a platform that is compatible with the target. Something like:

  if (!prefer_platform_arch && arch.IsValid())
  {
  if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
  {
  platform_sp = Platform::GetPlatformForArchitecture(arch, 
&platform_arch);
  if (!is_dummy_target && platform_sp)
  debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
  }
  }
  else if (platform_arch.IsValid())
  {
  // if "arch" isn't valid, yet "platform_arch" is, it means we have an 
executable file with
  // a single architecture which should be used
  ArchSpec fixed_platform_arch;
  if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, 
&fixed_platform_arch))
  {
  platform_sp = Platform::GetPlatformForArchitecture(platform_arch, 
&fixed_platform_arch);
  if (!is_dummy_target && platform_sp)
  debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
  }
  }
  if (!platform_sp)
  platform_sp = debugger.GetPlatformList().GetSelectedPlatform();

What do you think, Greg - return an error, or use the current (incompatible) 
platform?


Repository:
  rL LLVM

http://reviews.llvm.org/D12303



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


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

2015-08-25 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Let me get the DWARFDIE abstraction in and we can see where we are after I get 
this in as we will see more of what is possible to abstract when this is done.


http://reviews.llvm.org/D12291



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


Re: [Lldb-commits] [PATCH] D12327: Treat cleanup errors separately from test failures

2015-08-25 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 33131.
zturner added a comment.

Upload full diffs with context.


http://reviews.llvm.org/D12327

Files:
  test/dotest.py
  test/lldbtest.py
  test/unittest2/case.py
  test/unittest2/result.py

Index: test/unittest2/result.py
===
--- test/unittest2/result.py
+++ test/unittest2/result.py
@@ -42,6 +42,7 @@
 self.failures = []
 self.passes = []
 self.errors = []
+self.cleanup_errors = []
 self.testsRun = 0
 self.skipped = []
 self.expectedFailures = []
@@ -109,6 +110,13 @@
 self.errors.append((test, self._exc_info_to_string(err, test)))
 self._mirrorOutput = True
 
+def addCleanupError(self, test, err):
+"""Called when an error has occurred during cleanup. 'err' is a tuple of
+values as returned by sys.exc_info().
+"""
+self.cleanup_errors.append((test, self._exc_info_to_string(err, test)))
+self._mirrorOutput = True
+
 @failfast
 def addFailure(self, test, err):
 """Called when an error has occurred. 'err' is a tuple of values as
Index: test/unittest2/case.py
===
--- test/unittest2/case.py
+++ test/unittest2/case.py
@@ -383,9 +383,11 @@
 try:
 self.tearDown()
 except Exception:
-result.addError(self, sys.exc_info())
+result.addCleanupError(self, sys.exc_info())
 success = False
 
+self.dumpSessionInfo()
+
 cleanUpSuccess = self.doCleanups()
 success = success and cleanUpSuccess
 if success:
Index: test/lldbtest.py
===
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -1195,8 +1195,7 @@
 if doCleanup and not lldb.skip_build_and_cleanup:
 # First, let's do the platform-specific cleanup.
 module = builder_module()
-if not module.cleanup():
-raise Exception("Don't know how to do cleanup")
+module.cleanup()
 
 # Subclass might have specific cleanup function defined.
 if getattr(cls, "classCleanup", None):
@@ -1385,6 +1384,7 @@
 # initially.  If the test errored/failed, the session info
 # (self.session) is then dumped into a session specific file for
 # diagnosis.
+self.__cleanup_errored__ = False
 self.__errored__= False
 self.__failed__ = False
 self.__expected__   = False
@@ -1616,9 +1616,6 @@
 
 self.disableLogChannelsForCurrentTest()
 
-# Decide whether to dump the session info.
-self.dumpSessionInfo()
-
 # =
 # Various callbacks to allow introspection of test progress
 # =
@@ -1631,6 +1628,14 @@
 # Once by the Python unittest framework, and a second time by us.
 print >> sbuf, "ERROR"
 
+def markCleanupError(self):
+"""Callback invoked when an error occurs while a test is cleaning up."""
+self.__cleanup_errored__ = True
+with recording(self, False) as sbuf:
+# False because there's no need to write "CLEANUP_ERROR" to the stderr twice.
+# Once by the Python unittest framework, and a second time by us.
+print >> sbuf, "CLEANUP_ERROR"
+
 def markFailure(self):
 """Callback invoked when a failure (test assertion failure) occurred."""
 self.__failed__ = True
@@ -1729,6 +1734,9 @@
 if self.__errored__:
 pairs = lldb.test_result.errors
 prefix = 'Error'
+if self.__cleanup_errored__:
+pairs = lldb.test_result.cleanup_errors
+prefix = 'CleanupError'
 elif self.__failed__:
 pairs = lldb.test_result.failures
 prefix = 'Failure'
Index: test/dotest.py
===
--- test/dotest.py
+++ test/dotest.py
@@ -1685,6 +1685,17 @@
 if parsable:
 self.stream.write("FAIL: LLDB (%s) :: %s\n" % (self._config_string(test), str(test)))
 
+def addCleanupError(self, test, err):
+global sdir_has_content
+global parsable
+sdir_has_content = True
+super(LLDBTestResult, self).addCleanupError(test, err)
+method = getattr(test, "markCleanupError", None)
+if method:
+method()
+if parsable:
+self.stream.write("CLEANUP ERROR: LLDB (%s) :: %s\n" % (self._config_string(test), str(test)))
+
 def addFailure(self, test, err):
 global sdir_has_content
  

[Lldb-commits] [lldb] r245984 - XFAIL TestQuoting on Windows.

2015-08-25 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Aug 25 17:25:33 2015
New Revision: 245984

URL: http://llvm.org/viewvc/llvm-project?rev=245984&view=rev
Log:
XFAIL TestQuoting on Windows.

A couple of edge cases are broken with regards to quote handling.

Fixing this is tracked by http://llvm.org/pr24557

Modified:
lldb/trunk/test/settings/quoting/TestQuoting.py

Modified: lldb/trunk/test/settings/quoting/TestQuoting.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/settings/quoting/TestQuoting.py?rev=245984&r1=245983&r2=245984&view=diff
==
--- lldb/trunk/test/settings/quoting/TestQuoting.py (original)
+++ lldb/trunk/test/settings/quoting/TestQuoting.py Tue Aug 25 17:25:33 2015
@@ -19,42 +19,41 @@ class SettingsCommandTestCase(TestBase):
 def test_no_quote(self):
 self.do_test_args("a b c", "a\0b\0c\0")
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_single_quote(self):
 self.do_test_args("'a b c'", "a b c\0")
 
 def test_double_quote(self):
 self.do_test_args('"a b c"', "a b c\0")
 
-def test_double_quote(self):
-self.do_test_args('"a b c"', 'a b c\0')
-
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_single_quote_escape(self):
 self.do_test_args("'a b\\' c", "a b\\\0c\0")
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_double_quote_escape(self):
 self.do_test_args('"a b\\" c"', 'a b" c\0')
 
-def test_double_quote_escape(self):
-self.do_test_args('"a b\\" c"', 'a b" c\0')
-
-def test_double_quote_escape2(self):
-self.do_test_args('"a b" c', 'a b\\\0c\0')
-
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_double_quote_escape2(self):
 self.do_test_args('"a b" c', 'a b\\\0c\0')
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_single_in_double(self):
 self.do_test_args('"a\'b"', "a'b\0")
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_double_in_single(self):
 self.do_test_args("'a\"b'", 'a"b\0')
 
 def test_combined(self):
 self.do_test_args('"a b"c\'d e\'', 'a bcd e\0')
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_bare_single(self):
 self.do_test_args("a\\'b", "a'b\0")
 
+@expectedFailureWindows("http://llvm.org/pr24557";)
 def test_bare_double(self):
 self.do_test_args('a\\"b', 'a"b\0')
 


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


[Lldb-commits] [lldb] r245983 - Fix a bunch of portability issues in test executables.

2015-08-25 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Aug 25 17:25:21 2015
New Revision: 245983

URL: http://llvm.org/viewvc/llvm-project?rev=245983&view=rev
Log:
Fix a bunch of portability issues in test executables.

Added:
lldb/trunk/test/expression_command/expr-in-syscall/main.cpp
  - copied, changed from r245961, 
lldb/trunk/test/expression_command/expr-in-syscall/main.c
lldb/trunk/test/functionalities/process_attach/main.cpp
  - copied, changed from r245961, 
lldb/trunk/test/functionalities/process_attach/main.c
lldb/trunk/test/functionalities/thread/state/main.cpp
  - copied, changed from r245961, 
lldb/trunk/test/functionalities/thread/state/main.c
Removed:
lldb/trunk/test/expression_command/expr-in-syscall/main.c
lldb/trunk/test/functionalities/process_attach/main.c
lldb/trunk/test/functionalities/thread/state/main.c
Modified:
lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
lldb/trunk/test/expression_command/expr-in-syscall/Makefile
lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py
lldb/trunk/test/functionalities/process_attach/Makefile
lldb/trunk/test/functionalities/register/main.cpp
lldb/trunk/test/functionalities/signal/TestSendSignal.py
lldb/trunk/test/functionalities/thread/exit_during_break/main.cpp
lldb/trunk/test/functionalities/thread/exit_during_step/main.cpp
lldb/trunk/test/functionalities/thread/state/Makefile
lldb/trunk/test/functionalities/thread/state/TestThreadStates.py
lldb/trunk/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
lldb/trunk/test/lang/c/tls_globals/TestTlsGlobals.py

Modified: 
lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py?rev=245983&r1=245982&r2=245983&view=diff
==
--- lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py 
(original)
+++ lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py 
Tue Aug 25 17:25:21 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test calling a function that hits a signal set to auto-restart, make sure the 
call completes.
 """
 

Modified: lldb/trunk/test/expression_command/expr-in-syscall/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/expr-in-syscall/Makefile?rev=245983&r1=245982&r2=245983&view=diff
==
--- lldb/trunk/test/expression_command/expr-in-syscall/Makefile (original)
+++ lldb/trunk/test/expression_command/expr-in-syscall/Makefile Tue Aug 25 
17:25:21 2015
@@ -1,5 +1,5 @@
 LEVEL = ../../make
 
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Removed: lldb/trunk/test/expression_command/expr-in-syscall/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/expr-in-syscall/main.c?rev=245982&view=auto
==
--- lldb/trunk/test/expression_command/expr-in-syscall/main.c (original)
+++ lldb/trunk/test/expression_command/expr-in-syscall/main.c (removed)
@@ -1,11 +0,0 @@
-#include 
-
-volatile int release_flag = 0;
-
-int main(int argc, char const *argv[])
-{
-while (! release_flag) // Wait for debugger to attach
-sleep(3);
-
-return 0;
-}

Copied: lldb/trunk/test/expression_command/expr-in-syscall/main.cpp (from 
r245961, lldb/trunk/test/expression_command/expr-in-syscall/main.c)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/expr-in-syscall/main.cpp?p2=lldb/trunk/test/expression_command/expr-in-syscall/main.cpp&p1=lldb/trunk/test/expression_command/expr-in-syscall/main.c&r1=245961&r2=245983&rev=245983&view=diff
==
--- lldb/trunk/test/expression_command/expr-in-syscall/main.c (original)
+++ lldb/trunk/test/expression_command/expr-in-syscall/main.cpp Tue Aug 25 
17:25:21 2015
@@ -1,11 +1,12 @@
-#include 
+#include 
+#include 
 
 volatile int release_flag = 0;
 
 int main(int argc, char const *argv[])
 {
 while (! release_flag) // Wait for debugger to attach
-sleep(3);
+std::this_thread::sleep_for(std::chrono::seconds(3));
 
 return 0;
 }

Modified: lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py?rev=245983&r1=245982&r2=245983&view=diff
==
--- lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py (original)
+++ lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py Tue Aug 25 
17:25:21 2015
@@ -1,4 +1,4 @@
-"""
+"""
 Test that breakpoint by symbol name works correctly with dynamic libs.
 """
 
@@ -69,

[Lldb-commits] [lldb] r245993 - Rename all functionalities/data-formatter test case with radar bug numbers in them to more meaningful names

2015-08-25 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Tue Aug 25 18:55:10 2015
New Revision: 245993

URL: http://llvm.org/viewvc/llvm-project?rev=245993&view=rev
Log:
Rename all functionalities/data-formatter test case with radar bug numbers in 
them to more meaningful names


Added:
lldb/trunk/test/functionalities/data-formatter/boolreference/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11773899/
lldb/trunk/test/functionalities/data-formatter/compactvectors/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/

lldb/trunk/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-proper-plurals/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-3534688/
lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-13338477/

lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py
lldb/trunk/test/functionalities/data-formatter/hexcaps/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/

lldb/trunk/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
lldb/trunk/test/functionalities/data-formatter/nsarraysynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11086338/

lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py
lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11988289/

lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 
11988289.py
lldb/trunk/test/functionalities/data-formatter/nssetsynth/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12529957/

lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12529957/TestRdar12529957.py
lldb/trunk/test/functionalities/data-formatter/ostypeformatting/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-11628688/
lldb/trunk/test/functionalities/data-formatter/summary-string-onfail/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9974002/
lldb/trunk/test/functionalities/data-formatter/synthcapping/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10887661/

lldb/trunk/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py
lldb/trunk/test/functionalities/data-formatter/synthupdate/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12437442/

lldb/trunk/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py
lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/
  - copied from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9973865/

lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
  - copied, changed from r245991, 
lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py
Removed:

lldb/trunk/test/functionalities/data-formatter/compactvectors/Test-rdar-10642615.py

lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/Test-rdar-13338477.py
lldb/trunk/test/functionalities/data-formatter/hexcaps/Test-rdar-10449092.py

lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestRdar11086338.py
lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestRdar 
11988289.py

lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestRdar12529957.py
lldb/trunk/test/functionalities/data-formatter/rdar-10449092/
lldb/trunk/test/functionalities/data-formatter/rdar-10642615/
lldb/trunk/test/functionalities/data-form

Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Dawn Perchik via lldb-commits
dawn added a comment.

> My guess is LLDB on OSX doesn't have a platform that would handle a "thumbv7" 
> target, so the target create fails.


It looks OK to me.  It does:

  (lldb) target create -a thumbv7 ""
  Current executable set to '' (thumbv7).
  (lldb) target list
  Current targets:
  * target #0:  ( arch=thumbv7-apple-ios, platform=remote-ios )

I put printfs in lldb and ran the tests and I can see that the platform_sp is 
getting set.  This test passes - it's all the ones that follow it that fails.  
Your change in r237053 somehow caused the python API to be left in a bad state 
to where no other tests can run.  I opened llvm.org/pr24575 for this and have a 
new patch on review http://reviews.llvm.org/D12329 to skip the test.


Repository:
  rL LLVM

http://reviews.llvm.org/D12303



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


Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Dawn Perchik via lldb-commits
dawn added a comment.

Hi Ted, 
Your patch is causing it to get set to the dummy target in the 1st call to 
CreateTargetInternal, so in the recursive call, is_dummy_target is true, so we 
get the new platform but don't set it.  Removing the tests for 
"!is_dummy_target &&" in your patch fixes the problem.  Would you go along with 
that as a fix?


Repository:
  rL LLVM

http://reviews.llvm.org/D12303



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


Re: [Lldb-commits] [PATCH] D12303: Fix for dotest.py ERRORs on OSX caused by svn rev.237053.

2015-08-25 Thread Dawn Perchik via lldb-commits
dawn removed rL LLVM as the repository for this revision.
dawn updated this revision to Diff 33172.
dawn added a comment.

I'm submitting this revised patch to show the alternate fix described in my 
previous comment.  Consider this patch as a proposal; if nothing else I'd like 
to understand why the checks for is_dummy_target were added in svn rev.237053.

- what's new in this diff -

This patch keeps the resetting behavior in rev.237053 while still fixing the 
mix-matched platform and dummy target problem that is leaving the python API in 
a bad state.  An additional change was made to check for user_exe_path[0] since 
this is common practice elsewhere in the code.


http://reviews.llvm.org/D12303

Files:
  source/Target/TargetList.cpp

Index: source/Target/TargetList.cpp
===
--- source/Target/TargetList.cpp
+++ source/Target/TargetList.cpp
@@ -298,7 +298,7 @@
 if (!platform_sp->IsCompatibleArchitecture(arch, false, 
&platform_arch))
 {
 platform_sp = Platform::GetPlatformForArchitecture(arch, 
&platform_arch);
-if (!is_dummy_target && platform_sp)
+if (platform_sp)
 debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
 }
 }
@@ -310,7 +310,7 @@
 if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, 
&fixed_platform_arch))
 {
 platform_sp = Platform::GetPlatformForArchitecture(platform_arch, 
&fixed_platform_arch);
-if (!is_dummy_target && platform_sp)
+if (platform_sp)
 debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
 }
 }
@@ -476,7 +476,7 @@
 // Set argv0 with what the user typed, unless the user specified a
 // directory. If the user specified a directory, then it is probably a
 // bundle that was resolved and we need to use the resolved bundle path
-if (user_exe_path)
+if (user_exe_path && user_exe_path[0])
 {
 // Use exactly what the user typed as the first argument when we 
exec or posix_spawn
 if (user_exe_path_is_bundle && resolved_bundle_exe_path[0])


Index: source/Target/TargetList.cpp
===
--- source/Target/TargetList.cpp
+++ source/Target/TargetList.cpp
@@ -298,7 +298,7 @@
 if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch))
 {
 platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch);
-if (!is_dummy_target && platform_sp)
+if (platform_sp)
 debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
 }
 }
@@ -310,7 +310,7 @@
 if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch))
 {
 platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch);
-if (!is_dummy_target && platform_sp)
+if (platform_sp)
 debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
 }
 }
@@ -476,7 +476,7 @@
 // Set argv0 with what the user typed, unless the user specified a
 // directory. If the user specified a directory, then it is probably a
 // bundle that was resolved and we need to use the resolved bundle path
-if (user_exe_path)
+if (user_exe_path && user_exe_path[0])
 {
 // Use exactly what the user typed as the first argument when we exec or posix_spawn
 if (user_exe_path_is_bundle && resolved_bundle_exe_path[0])
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r246004 - In SendContinuePacketAndWaitForResponse there is a special bit of

2015-08-25 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Aug 25 23:07:30 2015
New Revision: 246004

URL: http://llvm.org/viewvc/llvm-project?rev=246004&view=rev
Log:
In SendContinuePacketAndWaitForResponse there is a special bit of
code that looks for a second stop-reply packet in response to an
interrupt (control-c).  This is to handle the case where where a
stop packet is making its way up to lldb right as lldb decides to
interrupt the inferior.  If the inferior is running and we interrupt
it, we'd expect a T11 type response meaning that the inferior halted
because of the interrupt.  But if the interrupt gets a T05 type
response instead, meaning that we stopped execution by hitting a
breakpoint or whatever, then the interrupt was received while the
inferior was already paused and so it is treated as a "?" packet
-- the remote stub will send the stop message a second time.

There's a timeout where we wait to get this second stop reply packet
in SendContinuePacketAndWaitForResponse, currently 1ms.  For a slow
remote target, it may take longer than that to send the second stop
reply packet.  If that happens, then lldb will use that second stop
reply packet as the response for the next packet request it makes 
to the remote stub.  The two will be out of sync by one packet for
the rest of the debug session and it's going to go badly from then on.

I've seen times as slow as 46ms, and given the severity of missing that
second stop reply packet, I'm increasing the timeout to 100ms, or 0.1sec.
 


Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=246004&r1=246003&r2=246004&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Tue Aug 25 23:07:30 2015
@@ -1133,10 +1133,10 @@ GDBRemoteCommunicationClient::SendContin
 continue_after_async = false;
 
 // We didn't get a SIGINT or SIGSTOP, so try 
for a
-// very brief time (1 ms) to get another stop 
reply
+// very brief time (0.1s) to get another stop 
reply
 // packet to make sure it doesn't get in the 
way
 StringExtractorGDBRemote 
extra_stop_reply_packet;
-uint32_t timeout_usec = 1000;
+uint32_t timeout_usec = 10;
 if (ReadPacket (extra_stop_reply_packet, 
timeout_usec, false) == PacketResult::Success)
 {
 switch (extra_stop_reply_packet.GetChar())


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


Re: [Lldb-commits] [lldb] r245993 - Rename all functionalities/data-formatter test case with radar bug numbers in them to more meaningful names

2015-08-25 Thread Zachary Turner via lldb-commits
Awesome, thanks so much Enrico!

On Tue, Aug 25, 2015 at 4:56 PM Enrico Granata via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: enrico
> Date: Tue Aug 25 18:55:10 2015
> New Revision: 245993
>
> URL: http://llvm.org/viewvc/llvm-project?rev=245993&view=rev
> Log:
> Rename all functionalities/data-formatter test case with radar bug numbers
> in them to more meaningful names
>
>
> Added:
> lldb/trunk/test/functionalities/data-formatter/boolreference/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11773899/
> lldb/trunk/test/functionalities/data-formatter/compactvectors/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10642615/
>
> lldb/trunk/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
>
> lldb/trunk/test/functionalities/data-formatter/data-formatter-proper-plurals/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-3534688/
>
> lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-13338477/
>
> lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-13338477.py
> lldb/trunk/test/functionalities/data-formatter/hexcaps/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10449092/
>
> lldb/trunk/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
> lldb/trunk/test/functionalities/data-formatter/nsarraysynth/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11086338/
>
> lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py
> lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11988289/
>
> lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar
> 11988289.py
> lldb/trunk/test/functionalities/data-formatter/nssetsynth/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-12529957/
>
> lldb/trunk/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-12529957/TestRdar12529957.py
> lldb/trunk/test/functionalities/data-formatter/ostypeformatting/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-11628688/
> lldb/trunk/test/functionalities/data-formatter/summary-string-onfail/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-9974002/
> lldb/trunk/test/functionalities/data-formatter/synthcapping/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10887661/
>
> lldb/trunk/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py
> lldb/trunk/test/functionalities/data-formatter/synthupdate/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-12437442/
>
> lldb/trunk/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py
> lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/
>   - copied from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-9973865/
>
> lldb/trunk/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
>   - copied, changed from r245991,
> lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py
> Removed:
>
> lldb/trunk/test/functionalities/data-formatter/compactvectors/Test-rdar-10642615.py
>
> lldb/trunk/test/functionalities/data-formatter/data-formatter-ptr-to-array/Test-rdar-13338477.py
>
> lldb/trunk/test/functionalities/data-formatter/hexcaps/Test-rdar-10449092.py
>
> lldb/trunk/test/functionalities/data-formatter/nsarraysynth/TestRdar11086338.py
>
> lldb/trunk/test/functionalities/data-formatter/nsdictionarysynth/TestRdar
> 11988289.py
>
> lldb/trunk/test/functio

[Lldb-commits] [lldb] r246015 - [MIPS] Avoid breakpoint in delay slot

2015-08-25 Thread Bhushan D. Attarde via lldb-commits
Author: bhushan.attarde
Date: Wed Aug 26 01:04:54 2015
New Revision: 246015

URL: http://llvm.org/viewvc/llvm-project?rev=246015&view=rev
Log:
[MIPS] Avoid breakpoint in delay slot

SUMMARY:
This patch implements Target::GetBreakableLoadAddress() method that takes 
an address
and checks for any reason there is a better address than this to put a 
breakpoint on.
If there is then return that address.
MIPS uses this method to avoid breakpoint in delay slot.

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

Modified:
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=246015&r1=246014&r2=246015&view=diff
==
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Wed Aug 26 01:04:54 2015
@@ -142,6 +142,9 @@ public:
 virtual bool
 DoesBranch () = 0;
 
+virtual bool
+HasDelaySlot ();
+
 virtual size_t
 Decode (const Disassembler &disassembler, 
 const DataExtractor& data,
@@ -266,6 +269,9 @@ public:
 virtual bool
 DoesBranch ();
 
+virtual bool
+HasDelaySlot ();
+
 virtual void
 CalculateMnemonicOperandsAndComment (const ExecutionContext* exe_ctx)
 {

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=246015&r1=246014&r2=246015&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Wed Aug 26 01:04:54 2015
@@ -920,6 +920,14 @@ public:
 lldb::addr_t
 GetOpcodeLoadAddress (lldb::addr_t load_addr, lldb::AddressClass 
addr_class = lldb::eAddressClassInvalid) const;
 
+// Get load_addr as breakable load address for this target.
+// Take a addr and check if for any reason there is a better address than 
this to put a breakpoint on.
+// If there is then return that address.
+// For MIPS, if instruction at addr is a delay slot instruction then this 
method will find the address of its
+// previous instruction and return that address.
+lldb::addr_t
+GetBreakableLoadAddress (lldb::addr_t addr);
+
 protected:
 //--
 /// Implementing of ModuleList::Notifier.

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=246015&r1=246014&r2=246015&view=diff
==
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Wed Aug 26 01:04:54 2015
@@ -674,6 +674,13 @@ Instruction::DumpEmulation (const ArchSp
 return false;
 }
 
+bool
+Instruction::HasDelaySlot ()
+{
+// Default is false.
+return false;
+}
+
 OptionValueSP
 Instruction::ReadArray (FILE *in_file, Stream *out_stream, OptionValue::Type 
data_type)
 {
@@ -1318,6 +1325,13 @@ PseudoInstruction::DoesBranch ()
 return false;
 }
 
+bool
+PseudoInstruction::HasDelaySlot ()
+{
+// This is NOT a valid question for a pseudo instruction.
+return false;
+}
+
 size_t
 PseudoInstruction::Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=246015&r1=246014&r2=246015&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Wed Aug 
26 01:04:54 2015
@@ -52,6 +52,7 @@ public:
 Instruction (address, addr_class),
 m_disasm_sp (disasm.shared_from_this()),
 m_does_branch (eLazyBoolCalculate),
+m_has_delay_slot (eLazyBoolCalculate),
 m_is_valid (false),
 m_using_file_addr (false)
 {
@@ -99,6 +100,43 @@ public:
 return m_does_branch == eLazyBoolYes;
 }
 
+virtual bool
+HasDelaySlot ()
+{
+if (m_has_delay_slot == eLazyBoolCalculate)
+{
+GetDisassemblerLLVMC().Lock(this, NULL)