Re: [Lldb-commits] [PATCH] D16284: Fix Makefile build

2016-01-18 Thread Keno Fischer via lldb-commits
loladiro accepted this revision.
loladiro added subscribers: clayborg, hans.
loladiro added a comment.
This revision is now accepted and ready to land.

LGTM.

The Makefile system will be removed from trunk very soon, so it might not 
necessarily make sense there, but I think it would be good to get this applied 
to release-38. @clayborg @hans how would you like to handle that? Apply this to 
trunk and backport?


http://reviews.llvm.org/D16284



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


[Lldb-commits] [lldb] r258038 - [RenderScript] Remove mips specific expressions

2016-01-18 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Mon Jan 18 03:16:02 2016
New Revision: 258038

URL: http://llvm.org/viewvc/llvm-project?rev=258038&view=rev
Log:
[RenderScript] Remove mips specific expressions

Reverts earlier commit r254910, which used function pointers for jitted 
expressions
to avoid a Mips64 compiler bug. Bug has since been fixed, and compiler longer 
issues the problem instruction.

Author: Dean De Leo 

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=258038&r1=258037&r2=258038&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 Mon Jan 18 03:16:02 2016
@@ -1374,136 +1374,61 @@ RenderScriptRuntime::EvalRSExpression(co
 return true;
 }
 
-namespace // anonymous
+// Used to index expression format strings
+enum ExpressionStrings
 {
-// max length of an expanded expression
-const int jit_max_expr_size = 768;
-
-// Format strings containing the expressions we may need to evaluate.
-const char runtimeExpressions[][256] =
-{
- // Mangled GetOffsetPointer(Allocation*, xoff, yoff, zoff, lod, cubemap)
- 
"(int*)_Z12GetOffsetPtrPKN7android12renderscript10AllocationE23RsAllocationCubemapFace(0x%lx,
 %u, %u, %u, 0, 0)",
-
- // Type* rsaAllocationGetType(Context*, Allocation*)
- "(void*)rsaAllocationGetType(0x%lx, 0x%lx)",
-
- // rsaTypeGetNativeData(Context*, Type*, void* typeData, size)
- // Pack the data in the following way mHal.state.dimX; mHal.state.dimY; 
mHal.state.dimZ;
- // mHal.state.lodCount; mHal.state.faces; mElement; into typeData
- // Need to specify 32 or 64 bit for uint_t since this differs between 
devices
- "uint%u_t data[6]; (void*)rsaTypeGetNativeData(0x%lx, 0x%lx, data, 6); 
data[0]", // X dim
- "uint%u_t data[6]; (void*)rsaTypeGetNativeData(0x%lx, 0x%lx, data, 6); 
data[1]", // Y dim
- "uint%u_t data[6]; (void*)rsaTypeGetNativeData(0x%lx, 0x%lx, data, 6); 
data[2]", // Z dim
- "uint%u_t data[6]; (void*)rsaTypeGetNativeData(0x%lx, 0x%lx, data, 6); 
data[5]", // Element ptr
-
- // rsaElementGetNativeData(Context*, Element*, uint32_t* elemData,size)
- // Pack mType; mKind; mNormalized; mVectorSize; NumSubElements into 
elemData
- "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%lx, 0x%lx, data, 5); 
data[0]", // Type
- "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%lx, 0x%lx, data, 5); 
data[1]", // Kind
- "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%lx, 0x%lx, data, 5); 
data[3]", // Vector Size
- "uint32_t data[5]; (void*)rsaElementGetNativeData(0x%lx, 0x%lx, data, 5); 
data[4]", // Field Count
-
-  // rsaElementGetSubElements(RsContext con, RsElement elem, uintptr_t 
*ids, const char **names,
-  // size_t *arraySizes, uint32_t dataSize)
-  // Needed for Allocations of structs to gather details about 
fields/Subelements
- "void* ids[%u]; const char* names[%u]; size_t arr_size[%u];"
- "(void*)rsaElementGetSubElements(0x%lx, 0x%lx, ids, names, arr_size, %u); 
ids[%u]", // Element* of field
-
- "void* ids[%u]; const char* names[%u]; size_t arr_size[%u];"
- "(void*)rsaElementGetSubElements(0x%lx, 0x%lx, ids, names, arr_size, %u); 
names[%u]",   // Name of field
-
- "void* ids[%u]; const char* names[%u]; size_t arr_size[%u];"
- "(void*)rsaElementGetSubElements(0x%lx, 0x%lx, ids, names, arr_size, %u); 
arr_size[%u]" // Array size of field
-};
-
-
-// Temporary workaround for MIPS, until the compiler emits the JAL 
instruction when invoking directly the function.
-// At the moment, when evaluating an expression involving a function call, 
the LLVM codegen for Mips  emits a JAL
-// instruction, which is able to jump in the range +/- 128MB with respect 
to the current program counter ($pc). If
-// the requested function happens to reside outside the above region, the 
function address will be truncated and the
-// function invocation will fail. This is a problem in the RS plugin as we 
rely on the RS API to probe the number and
-// the nature of allocations. A proper solution in the MIPS compiler is 
currently being investigated. As temporary
-// work around for this context, we'll invoke the RS API through function 
pointers, which cause the compiler to emit a
-// register based JALR instruction.
-const char runtimeExpressions_mips[][512] =

[Lldb-commits] [lldb] r258040 - Unconditionally accept symbol sizes from elf

2016-01-18 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jan 18 04:38:34 2016
New Revision: 258040

URL: http://llvm.org/viewvc/llvm-project?rev=258040&view=rev
Log:
Unconditionally accept symbol sizes from elf

The ELF symbol table always contain the size of the symbols so we
don't have to try to guess them based on the address of the next
symbol (it is needed for mach-o).

The change fixes an issue when a symbol is removed after a 0 size
symbol (e.g. because the second one is not public) what previously
caused the symbol lookup algorithm to end up with showing the 0 size
symbol even for the later addresses (what are not part of any symbol).
That symbol lookup error can confuse the user and also confuses the
current stack unwinder.

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

Modified:
lldb/trunk/include/lldb/Symbol/Symbol.h
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Symbol/Symbol.cpp
lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/include/lldb/Symbol/Symbol.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=258040&r1=258039&r2=258040&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Mon Jan 18 04:38:34 2016
@@ -383,6 +383,9 @@ public:
 bool prefer_file_cache,
 Stream &strm);
 
+bool
+ContainsFileAddress (lldb::addr_t file_addr) const;
+
 protected:
 // This is the internal guts of ResolveReExportedSymbol, it assumes 
reexport_name is not null, and that module_spec
 // is valid.  We track the modules we've already seen to make sure we 
don't get caught in a cycle.

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=258040&r1=258039&r2=258040&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jan 18 
04:38:34 2016
@@ -2295,7 +2295,7 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 symbol_section_sp,  // Section in which this symbol is defined 
or null.
 symbol_value,   // Offset in section or symbol value.
 symbol.st_size),// Size in bytes of this symbol.
-symbol.st_size != 0,// Size is valid if it is not 0
+true,   // Symbol size is valid
 has_suffix, // Contains linker annotations?
 flags); // Symbol flags.
 symtab->AddSymbol(dc_symbol);
@@ -2304,7 +2304,9 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 }
 
 unsigned
-ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, user_id_t start_id, 
lldb_private::Section *symtab)
+ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
+user_id_t start_id,
+lldb_private::Section *symtab)
 {
 if (symtab->GetObjectFile() != this)
 {

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=258040&r1=258039&r2=258040&view=diff
==
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Mon Jan 18 04:38:34 2016
@@ -737,3 +737,10 @@ Symbol::GetDisassembly (const ExecutionC
 }
 return false;
 }
+
+bool
+Symbol::ContainsFileAddress (lldb::addr_t file_addr) const
+{
+return m_addr_range.ContainsFileAddress(file_addr);
+}
+

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=258040&r1=258039&r2=258040&view=diff
==
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Mon Jan 18 04:38:34 2016
@@ -971,9 +971,11 @@ Symtab::InitAddressIndexes()
 if (end_section_file_addr > symbol_file_addr)
 {
 Symbol &symbol = m_symbols[entry.data];
-
-symbol.SetByteSize(end_section_file_addr - 
symbol_file_addr);
-symbol.SetSizeIsSynthesized(true);
+if (!symbol.GetByteSizeIsValid())
+{
+symbol.SetByteSize(end_section_file_addr - 
symbol_file_addr);
+symbol.SetSizeIsSynthesized(true);
+}
 }
 }
 }
@@ -1039,18 +1041,15 @@ Symtab::FindSymbolContainingFileAddress
 return info.match_symbol;
 }
 
-const size_t symbol_byte_size

Re: [Lldb-commits] [PATCH] D16186: Unconditionally accept symbol sizes from elf

2016-01-18 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL258040: Unconditionally accept symbol sizes from elf 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D16186?vs=44981&id=45160#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16186

Files:
  lldb/trunk/include/lldb/Symbol/Symbol.h
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/trunk/source/Symbol/Symbol.cpp
  lldb/trunk/source/Symbol/Symtab.cpp

Index: lldb/trunk/source/Symbol/Symbol.cpp
===
--- lldb/trunk/source/Symbol/Symbol.cpp
+++ lldb/trunk/source/Symbol/Symbol.cpp
@@ -737,3 +737,10 @@
 }
 return false;
 }
+
+bool
+Symbol::ContainsFileAddress (lldb::addr_t file_addr) const
+{
+return m_addr_range.ContainsFileAddress(file_addr);
+}
+
Index: lldb/trunk/source/Symbol/Symtab.cpp
===
--- lldb/trunk/source/Symbol/Symtab.cpp
+++ lldb/trunk/source/Symbol/Symtab.cpp
@@ -971,9 +971,11 @@
 if (end_section_file_addr > symbol_file_addr)
 {
 Symbol &symbol = m_symbols[entry.data];
-
-symbol.SetByteSize(end_section_file_addr - symbol_file_addr);
-symbol.SetSizeIsSynthesized(true);
+if (!symbol.GetByteSizeIsValid())
+{
+symbol.SetByteSize(end_section_file_addr - symbol_file_addr);
+symbol.SetSizeIsSynthesized(true);
+}
 }
 }
 }
@@ -1039,18 +1041,15 @@
 return info.match_symbol;
 }
 
-const size_t symbol_byte_size = info.match_symbol->GetByteSize();
-
-if (symbol_byte_size == 0)
+if (!info.match_symbol->GetByteSizeIsValid())
 {
-// We weren't able to find the size of the symbol so lets just go 
-// with that match we found in our search...
+// The matched symbol dosn't have a valid byte size so lets just go with that match...
 return info.match_symbol;
 }
 
 // We were able to figure out a symbol size so lets make sure our 
 // offset puts "file_addr" in the symbol's address range.
-if (info.match_offset < symbol_byte_size)
+if (info.match_offset < info.match_symbol->GetByteSize())
 return info.match_symbol;
 }
 return nullptr;
@@ -1066,7 +1065,11 @@
 
 const FileRangeToIndexMap::Entry *entry = m_file_addr_to_index.FindEntryThatContains(file_addr);
 if (entry)
-return SymbolAtIndex(entry->data);
+{
+Symbol* symbol = SymbolAtIndex(entry->data);
+if (symbol->ContainsFileAddress(file_addr))
+return symbol;
+}
 return nullptr;
 }
 
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
@@ -2295,16 +2295,18 @@
 symbol_section_sp,  // Section in which this symbol is defined or null.
 symbol_value,   // Offset in section or symbol value.
 symbol.st_size),// Size in bytes of this symbol.
-symbol.st_size != 0,// Size is valid if it is not 0
+true,   // Symbol size is valid
 has_suffix, // Contains linker annotations?
 flags); // Symbol flags.
 symtab->AddSymbol(dc_symbol);
 }
 return i;
 }
 
 unsigned
-ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, user_id_t start_id, lldb_private::Section *symtab)
+ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
+user_id_t start_id,
+lldb_private::Section *symtab)
 {
 if (symtab->GetObjectFile() != this)
 {
Index: lldb/trunk/include/lldb/Symbol/Symbol.h
===
--- lldb/trunk/include/lldb/Symbol/Symbol.h
+++ lldb/trunk/include/lldb/Symbol/Symbol.h
@@ -383,6 +383,9 @@
 bool prefer_file_cache,
 Stream &strm);
 
+bool
+ContainsFileAddress (lldb::addr_t file_addr) const;
+
 protected:
 // This is the internal guts of ResolveReExportedSymbol, it assumes reexport_name is not null, and that module_spec
 // is valid.  We track the modules we've already seen to make sure we don't get caught in a cycle.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r258043 - Revert "Unconditionally accept symbol sizes from elf"

2016-01-18 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Mon Jan 18 05:49:18 2016
New Revision: 258043

URL: http://llvm.org/viewvc/llvm-project?rev=258043&view=rev
Log:
Revert "Unconditionally accept symbol sizes from elf"

It causes issues for i386 when compiling with gcc-4.9.2

This reverts commit e248214a3eab8e244095f97d1996c991cb988cc4.

Modified:
lldb/trunk/include/lldb/Symbol/Symbol.h
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Symbol/Symbol.cpp
lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/include/lldb/Symbol/Symbol.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=258043&r1=258042&r2=258043&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Mon Jan 18 05:49:18 2016
@@ -383,9 +383,6 @@ public:
 bool prefer_file_cache,
 Stream &strm);
 
-bool
-ContainsFileAddress (lldb::addr_t file_addr) const;
-
 protected:
 // This is the internal guts of ResolveReExportedSymbol, it assumes 
reexport_name is not null, and that module_spec
 // is valid.  We track the modules we've already seen to make sure we 
don't get caught in a cycle.

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=258043&r1=258042&r2=258043&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jan 18 
05:49:18 2016
@@ -2295,7 +2295,7 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 symbol_section_sp,  // Section in which this symbol is defined 
or null.
 symbol_value,   // Offset in section or symbol value.
 symbol.st_size),// Size in bytes of this symbol.
-true,   // Symbol size is valid
+symbol.st_size != 0,// Size is valid if it is not 0
 has_suffix, // Contains linker annotations?
 flags); // Symbol flags.
 symtab->AddSymbol(dc_symbol);
@@ -2304,9 +2304,7 @@ ObjectFileELF::ParseSymbols (Symtab *sym
 }
 
 unsigned
-ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
-user_id_t start_id,
-lldb_private::Section *symtab)
+ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, user_id_t start_id, 
lldb_private::Section *symtab)
 {
 if (symtab->GetObjectFile() != this)
 {

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=258043&r1=258042&r2=258043&view=diff
==
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Mon Jan 18 05:49:18 2016
@@ -737,10 +737,3 @@ Symbol::GetDisassembly (const ExecutionC
 }
 return false;
 }
-
-bool
-Symbol::ContainsFileAddress (lldb::addr_t file_addr) const
-{
-return m_addr_range.ContainsFileAddress(file_addr);
-}
-

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=258043&r1=258042&r2=258043&view=diff
==
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Mon Jan 18 05:49:18 2016
@@ -971,11 +971,9 @@ Symtab::InitAddressIndexes()
 if (end_section_file_addr > symbol_file_addr)
 {
 Symbol &symbol = m_symbols[entry.data];
-if (!symbol.GetByteSizeIsValid())
-{
-symbol.SetByteSize(end_section_file_addr - 
symbol_file_addr);
-symbol.SetSizeIsSynthesized(true);
-}
+
+symbol.SetByteSize(end_section_file_addr - 
symbol_file_addr);
+symbol.SetSizeIsSynthesized(true);
 }
 }
 }
@@ -1041,15 +1039,18 @@ Symtab::FindSymbolContainingFileAddress
 return info.match_symbol;
 }
 
-if (!info.match_symbol->GetByteSizeIsValid())
+const size_t symbol_byte_size = info.match_symbol->GetByteSize();
+
+if (symbol_byte_size == 0)
 {
-// The matched symbol dosn't have a valid byte size so lets just 
go with that match...
+// We weren't able to find the size of the symbol so lets just go 
+// with that match we found in our search...
 return info.match_symbol;
 }
 
 // We wer

[Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private

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

The dependencies of our libraries (only liblldb, really) we marked as public, 
which caused all
their dependencies to be repeated when linking any executables to them. This is 
a problem because
then all the .a files would be linked twice, once to liblldb and once again to 
lldb. I am not
sure why, but for some reason this only surfaced when doing a 
LLVM_LINK_LLVM_DYLIB=ON build,
where we ended having two copies of some symbols and different parts of code 
referring to
different copies.

Setting the dependencies as private required a fixup of the argdumper link 
command, as it was not
actually linking to liblldb (it was referring to symbols from the lldb_private 
namespace, which
are not exposed in liblldb), but rather to the individual component libraries 
(where these
symbols are still available). Since these symbols are now not added to the 
command line as
dependencies of liblldb, I needed to add them explicitly.

http://reviews.llvm.org/D16293

Files:
  cmake/modules/AddLLDB.cmake
  tools/argdumper/CMakeLists.txt

Index: tools/argdumper/CMakeLists.txt
===
--- tools/argdumper/CMakeLists.txt
+++ tools/argdumper/CMakeLists.txt
@@ -1,8 +1,16 @@
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
 add_lldb_executable(lldb-argdumper
   argdumper.cpp
   )
 
-target_link_libraries(lldb-argdumper liblldb)
+if (LLDB_LINKER_SUPPORTS_GROUPS)
+  target_link_libraries(lldb-argdumper -Wl,--start-group ${LLDB_USED_LIBS} 
-Wl,--end-group)
+else()
+  target_link_libraries(lldb-argdumper ${LLDB_USED_LIBS})
+endif()
+llvm_config(lldb-argdumper ${LLVM_LINK_COMPONENTS})
+
 
 install(TARGETS lldb-argdumper
   RUNTIME DESTINATION bin)
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -4,7 +4,7 @@
   endif()
 
   if(${targetkind} MATCHES "SHARED")
-set(LINK_KEYWORD ${cmake_2_8_12_PUBLIC})
+set(LINK_KEYWORD ${cmake_2_8_12_PRIVATE})
   endif()
 
   if(${targetkind} MATCHES "SHARED" OR ${targetkind} MATCHES "EXE")
@@ -62,10 +62,10 @@
 
 if (PARAM_SHARED)
   if (LLDB_LINKER_SUPPORTS_GROUPS)
-target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+target_link_libraries(${name} ${cmake_2_8_12_PRIVATE}
 -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
   else()
-target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} 
${CLANG_USED_LIBS})
+target_link_libraries(${name} ${cmake_2_8_12_PRIVATE} 
${CLANG_USED_LIBS})
   endif()
 endif()
 llvm_config(${name} ${LLVM_LINK_COMPONENTS})


Index: tools/argdumper/CMakeLists.txt
===
--- tools/argdumper/CMakeLists.txt
+++ tools/argdumper/CMakeLists.txt
@@ -1,8 +1,16 @@
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
 add_lldb_executable(lldb-argdumper
   argdumper.cpp
   )
 
-target_link_libraries(lldb-argdumper liblldb)
+if (LLDB_LINKER_SUPPORTS_GROUPS)
+  target_link_libraries(lldb-argdumper -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+else()
+  target_link_libraries(lldb-argdumper ${LLDB_USED_LIBS})
+endif()
+llvm_config(lldb-argdumper ${LLVM_LINK_COMPONENTS})
+
 
 install(TARGETS lldb-argdumper
   RUNTIME DESTINATION bin)
Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -4,7 +4,7 @@
   endif()
 
   if(${targetkind} MATCHES "SHARED")
-set(LINK_KEYWORD ${cmake_2_8_12_PUBLIC})
+set(LINK_KEYWORD ${cmake_2_8_12_PRIVATE})
   endif()
 
   if(${targetkind} MATCHES "SHARED" OR ${targetkind} MATCHES "EXE")
@@ -62,10 +62,10 @@
 
 if (PARAM_SHARED)
   if (LLDB_LINKER_SUPPORTS_GROUPS)
-target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+target_link_libraries(${name} ${cmake_2_8_12_PRIVATE}
 -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
   else()
-target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_USED_LIBS})
+target_link_libraries(${name} ${cmake_2_8_12_PRIVATE} ${CLANG_USED_LIBS})
   endif()
 endif()
 llvm_config(${name} ${LLVM_LINK_COMPONENTS})
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private

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

I don't quite know how windows linking works, so please give this a run to make 
sure it does not break anything for you.


http://reviews.llvm.org/D16293



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


[Lldb-commits] [lldb] r258048 - Guard against application of an XFAIL decorator on a class

2016-01-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 18 08:45:35 2016
New Revision: 258048

URL: http://llvm.org/viewvc/llvm-project?rev=258048&view=rev
Log:
Guard against application of an XFAIL decorator on a class

This does not work and causes the class to be silently skipped, which is a bad 
idea. This makes
sure it cannot happen accidentaly. I've played with the idea of actually making 
the decorator
work at class level, but it proved too magic to do at this moment.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258048&r1=258047&r2=258048&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jan 18 08:45:35 
2016
@@ -593,6 +593,8 @@ def not_remote_testsuite_ready(func):
 
 def expectedFailure(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
+if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+raise Exception("Decorator can only be used to decorate a test 
method")
 @wraps(func)
 def wrapper(*args, **kwargs):
 from unittest2 import case


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


[Lldb-commits] [lldb] r258049 - Remove skipIfLinuxClang decorator

2016-01-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jan 18 09:01:14 2016
New Revision: 258049

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

it isn't used in the code anymore, and we're trying to cut down on the 
decorators.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258049&r1=258048&r2=258049&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jan 18 09:01:14 
2016
@@ -1056,24 +1056,6 @@ def skipUnlessPlatform(oslist):
 return unittest2.skipUnless(getPlatform() in oslist,
 "requires on of %s" % (", ".join(oslist)))
 
-def skipIfLinuxClang(func):
-"""Decorate the item to skip tests that should be skipped if building on 
-   Linux with clang.
-"""
-if isinstance(func, type) and issubclass(func, unittest2.TestCase):
-raise Exception("@skipIfLinuxClang can only be used to decorate a test 
method")
-@wraps(func)
-def wrapper(*args, **kwargs):
-from unittest2 import case
-self = args[0]
-compiler = self.getCompiler()
-platform = self.getPlatform()
-if "clang" in compiler and platform == "linux":
-self.skipTest("skipping because Clang is used on Linux")
-else:
-func(*args, **kwargs)
-return wrapper
-
 # provide a function to skip on defined oslist, compiler version, and archs
 # if none is specified for any argument, that argument won't be checked and 
thus means for all
 # for example,


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


Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

2016-01-18 Thread Ravitheja Addepally via lldb-commits
ravitheja updated this revision to Diff 45185.
ravitheja added a comment.

Changes according to http://reviews.llvm.org/D16151


http://reviews.llvm.org/D16107

Files:
  
packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
  
packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
  packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.h

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.h
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -10,6 +10,7 @@
 #ifndef liblldb_ObjectFileELF_h_
 #define liblldb_ObjectFileELF_h_
 
+#include 
 // C Includes
 #include 
 
@@ -231,6 +232,7 @@
 typedef DynamicSymbolColl::const_iterator   DynamicSymbolCollConstIter;
 
 typedef std::map FileAddressToAddressClassMap;
+typedef std::function SetDataFunction;
 
 /// Version of this reader common to all plugins based on this class.
 static const uint32_t m_plugin_version = 1;
@@ -279,7 +281,7 @@
 // Parses the ELF program headers.
 static size_t
 GetProgramHeaderInfo(ProgramHeaderColl &program_headers,
- lldb_private::DataExtractor &data,
+ const SetDataFunction set_data,
  const elf::ELFHeader &header);
 
 // Finds PT_NOTE segments and calculates their crc sum.
@@ -302,7 +304,7 @@
 /// Parses the elf section headers and returns the uuid, debug link name, crc, archspec.
 static size_t
 GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
- lldb_private::DataExtractor &data,
+ const SetDataFunction set_data,
  const elf::ELFHeader &header,
  lldb_private::UUID &uuid,
  std::string &gnu_debuglink_file,
@@ -437,6 +439,13 @@
 
 static lldb_private::Error
 RefineModuleDetailsFromNote (lldb_private::DataExtractor &data, lldb_private::ArchSpec &arch_spec, lldb_private::UUID &uuid);
+
+
+static lldb::offset_t
+SetData(const lldb_private::DataExtractor &src, lldb_private::DataExtractor &dst, lldb::offset_t offset, lldb::offset_t length);
+
+lldb::offset_t
+SetDataWithReadMemoryFallback(lldb_private::DataExtractor &dst, lldb::offset_t offset, lldb::offset_t length);
 };
 
 #endif // liblldb_ObjectFileELF_h_
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -729,7 +729,10 @@
 SectionHeaderColl section_headers;
 lldb_private::UUID &uuid = spec.GetUUID();
 
-GetSectionHeaderInfo(section_headers, data, header, uuid, gnu_debuglink_file, gnu_debuglink_crc, spec.GetArchitecture ());
+using namespace std::placeholders;
+const SetDataFunction set_data = std::bind(&ObjectFileELF::SetData, std::cref(data), _1, _2, _3);
+GetSectionHeaderInfo(section_headers, set_data, header, uuid, gnu_debuglink_file, gnu_debuglink_crc, spec.GetArchitecture ());
+
 
 llvm::Triple &spec_triple = spec.GetArchitecture ().GetTriple ();
 
@@ -759,7 +762,7 @@
 data.SetData(data_sp);
 }
 ProgramHeaderColl program_headers;
-GetProgramHeaderInfo(program_headers, data, header);
+GetProgramHeaderInfo(program_headers, set_data, header);
 
 size_t segment_data_end = 0;
 for (ProgramHeaderCollConstIter I = program_headers.begin();
@@ -1256,7 +1259,7 @@
 //--
 size_t
 ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers,
-DataExtractor &object_data,
+const SetDataFunction set_data,
 const ELFHeader &header)
 {
 // We have already parsed the program headers
@@ -1274,7 +1277,7 @@
 const size_t ph_size = header.e_phnum * header.e_phentsize;
 const elf_off ph_offset = header.e_phoff;
 DataExtractor data;
-if (data.SetData(object_data, ph_offset, ph_size) != ph_size)
+if (set_data(data, ph_offset, ph_size) != ph_size)
 return 0;
 
 uint32_t idx;
@@ -1298,7 +1301,10 @@
 size_t
 ObjectFileELF::ParseProgramHeaders()
 {
-return GetProgramHeaderInfo(m_program_headers, m_data, m_header);
+using namespace std::placeholders;
+return GetProgramHeaderInfo(m_program_hea

Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

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

I think this looks *much* nicer than the previous version.

I personally would replace the `std::function` dance with something simpler 
such as `bool use_memory_fallback`, but I guess that's a matter of taste.



Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.h:13
@@ -12,2 +12,3 @@
 
+#include 
 // C Includes

Please put this right before 


Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.h:284
@@ -281,3 +283,3 @@
 GetProgramHeaderInfo(ProgramHeaderColl &program_headers,
- lldb_private::DataExtractor &data,
+ const SetDataFunction set_data,
  const elf::ELFHeader &header);

const non-reference arguments are somewhat pointless. Did you forget a 
reference here?


Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.h:307
@@ -304,3 +306,3 @@
 GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
- lldb_private::DataExtractor &data,
+ const SetDataFunction set_data,
  const elf::ELFHeader &header,

same here


http://reviews.llvm.org/D16107



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


Re: [Lldb-commits] [PATCH] D14111: Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation

2016-01-18 Thread Bhushan Attarde via lldb-commits
bhushan added a reviewer: clayborg.
bhushan added a comment.

Hi Greg,

Can you have look into this? This patch is important to clear expression 
related tests for MIPS.


Repository:
  rL LLVM

http://reviews.llvm.org/D14111



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


Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private

2016-01-18 Thread Zachary Turner via lldb-commits
It's a holiday over here today, so i can't look at this until tomorrow.

On Mon, Jan 18, 2016 at 6:04 AM Pavel Labath  wrote:

> labath added a comment.
>
> I don't quite know how windows linking works, so please give this a run to
> make sure it does not break anything for you.
>
>
> http://reviews.llvm.org/D16293
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r258080 - Update for llvm change. NFC.

2016-01-18 Thread Rafael Espindola via lldb-commits
Author: rafael
Date: Mon Jan 18 14:57:54 2016
New Revision: 258080

URL: http://llvm.org/viewvc/llvm-project?rev=258080&view=rev
Log:
Update for llvm change. NFC.

Modified:
lldb/trunk/source/Expression/IRMemoryMap.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=258080&r1=258079&r2=258080&view=diff
==
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Mon Jan 18 14:57:54 2016
@@ -77,7 +77,7 @@ IRMemoryMap::FindSpace (size_t size, boo
 auto back = m_allocations.rbegin();
 lldb::addr_t addr = back->first;
 size_t alloc_size = back->second.m_size;
-ret = llvm::RoundUpToAlignment(addr+alloc_size, 4096);
+ret = llvm::alignTo(addr+alloc_size, 4096);
 }
 
 return ret;

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=258080&r1=258079&r2=258080&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jan 18 
14:57:54 2016
@@ -283,7 +283,7 @@ ELFNote::Parse(const DataExtractor &data
 }
 }
 
-const char *cstr = data.GetCStr(offset, llvm::RoundUpToAlignment 
(n_namesz, 4));
+const char *cstr = data.GetCStr(offset, llvm::alignTo (n_namesz, 4));
 if (cstr == NULL)
 {
 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYMBOLS));
@@ -1449,7 +1449,7 @@ ObjectFileELF::RefineModuleDetailsFromNo
 // this ELF targets.
 if(note.n_descsz)
 {
-const char *cstr = data.GetCStr(&offset, 
llvm::RoundUpToAlignment (note.n_descsz, 4));
+const char *cstr = data.GetCStr(&offset, llvm::alignTo 
(note.n_descsz, 4));
 (void)cstr;
 }
 }
@@ -1635,7 +1635,7 @@ ObjectFileELF::GetSectionHeaderInfo(Sect
 {
 lldb::offset_t gnu_debuglink_offset = 0;
 gnu_debuglink_file = data.GetCStr 
(&gnu_debuglink_offset);
-gnu_debuglink_offset = llvm::RoundUpToAlignment 
(gnu_debuglink_offset, 4);
+gnu_debuglink_offset = llvm::alignTo 
(gnu_debuglink_offset, 4);
 data.GetU32 (&gnu_debuglink_offset, 
&gnu_debuglink_crc, 1);
 }
 }
@@ -2430,7 +2430,7 @@ GetPltEntrySizeAndOffset(const ELFSectio
 // Clang 3.3 sets entsize to 4 for 32-bit binaries, but the plt entries 
are 16 bytes.
 // So round the entsize up by the alignment if addralign is set.
 elf_xword plt_entsize = plt_hdr->sh_addralign ?
-llvm::RoundUpToAlignment (plt_hdr->sh_entsize, plt_hdr->sh_addralign) 
: plt_hdr->sh_entsize;
+llvm::alignTo (plt_hdr->sh_entsize, plt_hdr->sh_addralign) : 
plt_hdr->sh_entsize;
 
 if (plt_entsize == 0)
 {

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h?rev=258080&r1=258079&r2=258080&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h Mon Jan 18 
14:57:54 2016
@@ -56,7 +56,7 @@ struct ELFNote
 size_t
 GetByteSize() const
 {
-return 12 + llvm::RoundUpToAlignment (n_namesz, 4) + 
llvm::RoundUpToAlignment (n_descsz, 4);
+return 12 + llvm::alignTo (n_namesz, 4) + llvm::alignTo (n_descsz, 4);
 }
 };
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp?rev=258080&r1=258079&r2=258080&view=diff
==
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp Mon Jan 18 
14:57:54 2016
@@ -517,7 +517,7 @@ ProcessElfCore::ParseThreadContextsFromN
 
 size_t note_start, note_size;
 note_start = offset;
-note_size = llvm::RoundUpToAlignment(note.n_descsz, 4);
+note_size = llvm::alignTo(note.n_descsz, 4);
 
 // Store the NOTE information in the current thread
 DataExtractor note_data (segment_data, note_start, note_size);


___