Re: [Lldb-commits] [PATCH] D15562: Add AccessModifierOffset to clang-format style

2015-12-17 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255882: Add AccessModifierOffset to clang-format style 
(authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D15562?vs=42988&id=43106#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15562

Files:
  lldb/trunk/.clang-format

Index: lldb/trunk/.clang-format
===
--- lldb/trunk/.clang-format
+++ lldb/trunk/.clang-format
@@ -6,3 +6,4 @@
 AllowShortFunctionsOnASingleLine: Inline
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 IndentCaseLabels: true
+AccessModifierOffset: -4


Index: lldb/trunk/.clang-format
===
--- lldb/trunk/.clang-format
+++ lldb/trunk/.clang-format
@@ -6,3 +6,4 @@
 AllowShortFunctionsOnASingleLine: Inline
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 IndentCaseLabels: true
+AccessModifierOffset: -4
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255882 - Add AccessModifierOffset to clang-format style

2015-12-17 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Dec 17 03:19:36 2015
New Revision: 255882

URL: http://llvm.org/viewvc/llvm-project?rev=255882&view=rev
Log:
Add AccessModifierOffset to clang-format style

Summary:
As we override the indent option of the LLVM style, we need to override the 
access modifier
offset as well. Otherwise, classes will be formatted like such
class A
{
  public:
int foo;
};
which is not used anywhere in LLDB. This option makes clang-format style more 
similar to LLDB and
brings it closer to the original intention of LLVM style, which was to not 
indent access
modifiers.

Reviewers: zturner, tfiala

Subscribers: lldb-commits

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

Modified:
lldb/trunk/.clang-format

Modified: lldb/trunk/.clang-format
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/.clang-format?rev=255882&r1=255881&r2=255882&view=diff
==
--- lldb/trunk/.clang-format (original)
+++ lldb/trunk/.clang-format Thu Dec 17 03:19:36 2015
@@ -6,3 +6,4 @@ AlwaysBreakAfterDefinitionReturnType: tr
 AllowShortFunctionsOnASingleLine: Inline
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 IndentCaseLabels: true
+AccessModifierOffset: -4


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


[Lldb-commits] [lldb] r255885 - XFAIL some tests failing for Windows -> Android

2015-12-17 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Dec 17 04:58:35 2015
New Revision: 255885

URL: http://llvm.org/viewvc/llvm-project?rev=255885&view=rev
Log:
XFAIL some tests failing for Windows -> Android

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py?rev=255885&r1=255884&r2=255885&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
 Thu Dec 17 04:58:35 2015
@@ -8,6 +8,7 @@ class TestMacros(TestBase):
 
 @expectedFailureClang("clang does not emit .debug_macro[.dwo] sections.")
 @expectedFailureDwo("GCC produces multiple .debug_macro.dwo sections and 
the spec is unclear as to what it means")
+@expectedFailureAll(hostoslist=["windows"], compiler="gcc", 
triple='.*-android')
 def test_expr_with_macros(self):
 self.build()
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py?rev=255885&r1=255884&r2=255885&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
 Thu Dec 17 04:58:35 2015
@@ -10,6 +10,7 @@ class TestPlatformProcessConnect(gdbremo
 @llgs_test
 @no_debug_info_test
 @skipIf(remote=False)
+@expectedFailureAll(hostoslist=["windows"], triple='.*-android')
 def test_platform_process_connect(self):
 self.build()
 self.init_llgs_test(False)


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


Re: [Lldb-commits] [PATCH] D15576: Inspect global static const variables

2015-12-17 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.

LGTM (next time please upload the diff with full context)


Repository:
  rL LLVM

http://reviews.llvm.org/D15576



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


[Lldb-commits] [lldb] r255887 - Inspect DW_AT_const_value global static const variables

2015-12-17 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Thu Dec 17 05:59:47 2015
New Revision: 255887

URL: http://llvm.org/viewvc/llvm-project?rev=255887&view=rev
Log:
Inspect DW_AT_const_value global static const variables

This patch adds support for printing global static const variables which are 
given a DW_AT_const_value DWARF tag by clang.

Fix for bug https://llvm.org/bugs/show_bug.cgi?id=25653

Reviewers: clayborg, tberghammer
Subscribers: emaste, lldb-commits
Differential Revision: http://reviews.llvm.org/D15576

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py?rev=255887&r1=255886&r2=255887&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
 Thu Dec 17 05:59:47 2015
@@ -52,6 +52,7 @@ class GlobalVariablesTestCase(TestBase):
 # Check that GLOBAL scopes are indicated for the variables.
 self.expect("frame variable --show-types --scope --show-globals 
--no-args", VARIABLES_DISPLAYED_CORRECTLY,
 substrs = ['GLOBAL: (int) g_file_global_int = 42',
+   'STATIC: (const int) g_file_static_int = 2',
'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"',
'STATIC: (const char *) g_file_static_cstr',

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c?rev=255887&r1=255886&r2=255887&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c 
Thu Dec 17 05:59:47 2015
@@ -10,13 +10,14 @@
 
 int g_common_1; // Not initialized on purpose to cause it to be undefined 
external in .o file
 int g_file_global_int = 42;
+static const int g_file_static_int = 2;
 const char *g_file_global_cstr = "g_file_global_cstr";
 static const char *g_file_static_cstr = "g_file_static_cstr";
 
 extern int g_a;
 int main (int argc, char const *argv[])
 {
-g_common_1 = g_file_global_int / 2;
+g_common_1 = g_file_global_int / g_file_static_int;
 static const char *g_func_static_cstr = "g_func_static_cstr";
 printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
 return g_file_global_int + g_a + g_common_1; // Set break point at this 
line.   break $source:$line; continue; var -global g_a -global g_global_int

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=255887&r1=255886&r2=255887&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Dec 17 05:59:47 2015
@@ -1135,6 +1135,7 @@ ValueObject::GetData (DataExtractor& dat
 if (m_data.GetByteSize())
 {
 data = m_data;
+error.Clear();
 return data.GetByteSize();
 }
 else

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=255887&r1=255886&r2=255887&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Thu Dec 17 
05:59:47 2015
@@ -815,7 +815,7 @@ DWARFCompileUnit::IndexPrivate (DWARFCom
 bool is_declaration = false;
 //bool is_artificial = false;
 bool has_address = false;
-bool has_location = false;
+bool has_location_or_const_value = false;
 bool is_global_or_static_variable = false;
 
 DWARFFormValue specification_die_form;
@@ -860,7 +860,8 @@ DWARFCompileUnit::IndexPrivate (DWARFCom
 break;
 
 case DW_AT_location:
-has_location = true;
+case DW_AT_const_value:
+has_location_or_const_value = true;
   

Re: [Lldb-commits] [PATCH] D15576: Inspect global static const variables

2015-12-17 Thread Ewan Crawford via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255887: Inspect DW_AT_const_value global static const 
variables (authored by EwanCrawford).

Changed prior to commit:
  http://reviews.llvm.org/D15576?vs=43017&id=43119#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15576

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
  lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
  lldb/trunk/source/Core/ValueObject.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/trunk/source/Core/ValueObject.cpp
===
--- lldb/trunk/source/Core/ValueObject.cpp
+++ lldb/trunk/source/Core/ValueObject.cpp
@@ -1135,6 +1135,7 @@
 if (m_data.GetByteSize())
 {
 data = m_data;
+error.Clear();
 return data.GetByteSize();
 }
 else
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
@@ -4260,7 +4260,10 @@
 }
 else
 {
-scope = eValueTypeVariableLocal;
+if (location_is_const_value_data)
+scope = eValueTypeVariableStatic;
+else
+scope = eValueTypeVariableLocal;
 }
 }
 
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -815,7 +815,7 @@
 bool is_declaration = false;
 //bool is_artificial = false;
 bool has_address = false;
-bool has_location = false;
+bool has_location_or_const_value = false;
 bool is_global_or_static_variable = false;
 
 DWARFFormValue specification_die_form;
@@ -860,7 +860,8 @@
 break;
 
 case DW_AT_location:
-has_location = true;
+case DW_AT_const_value:
+has_location_or_const_value = true;
 if (tag == DW_TAG_variable)
 {
 const DWARFDebugInfoEntry* parent_die = 
die.GetParent();
@@ -1035,7 +1036,7 @@
 break;
 
 case DW_TAG_variable:
-if (name && has_location && is_global_or_static_variable)
+if (name && has_location_or_const_value && 
is_global_or_static_variable)
 {
 globals.Insert (ConstString(name), DIERef(cu_offset, 
die.GetOffset()));
 // Be sure to include variables by their mangled and demangled
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -10,13 +10,14 @@
 
 int g_common_1; // Not initialized on purpose to cause it to be undefined 
external in .o file
 int g_file_global_int = 42;
+static const int g_file_static_int = 2;
 const char *g_file_global_cstr = "g_file_global_cstr";
 static const char *g_file_static_cstr = "g_file_static_cstr";
 
 extern int g_a;
 int main (int argc, char const *argv[])
 {
-g_common_1 = g_file_global_int / 2;
+g_common_1 = g_file_global_int / g_file_static_int;
 static const char *g_func_static_cstr = "g_func_static_cstr";
 printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
 return g_file_global_int + g_a + g_common_1; // Set break point at this 
line.   break $source:$line; continue; var -global g_a -global g_global_int
Index: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -52,6 +52,7 @@
 # Check that GLOBAL scopes are indicated for the variables.
 self.expect("frame variable --show-types --scope --show-globals 
--no-args", VARIABLES_DISPLAYED_CORRECTLY,
 substrs = ['GLOBAL: (int) g_file_global_int = 42',
+   'STATIC: (const int) g_file_static_int = 2',
'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"',
'

Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Ilia K via lldb-commits
ki.stfu requested changes to this revision.
ki.stfu added a comment.
This revision now requires changes to proceed.

clang-format your changes please (there are many deviations from the coding 
style)

I'll check it on Linux and say if everything is OK.



Comment at: source/Commands/CommandObjectTarget.cpp:1510
@@ -1503,2 +1509,3 @@
 
-for (uint32_t i=0; iGetNumCompileUnits();
+for (int i = 0; i < ncus; i++)
 {

use size_t


Comment at: source/Commands/CommandObjectTarget.cpp:1541-1542
@@ +1540,4 @@
+CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i));
+if (!cu_sp)
+continue;
+CompileUnit *cu = cu_sp.get();

Isn't it always false?


Comment at: source/Commands/CommandObjectTarget.cpp:1543
@@ +1542,3 @@
+continue;
+CompileUnit *cu = cu_sp.get();
+const FileSpecList &cu_file_list = cu->GetSupportFiles();

You don't need a raw pointer here, just use cu_sp.get() on line #1587


Comment at: source/Commands/CommandObjectTarget.cpp:1576
@@ +1575,3 @@
+assert(lldb_private::FileSpec::Equal(cu_file_spec, 
line_entry.file, has_path));
+if (cu_header_printed == false)
+{

!cu_header_printed


Comment at: source/Commands/CommandObjectTarget.cpp:1594-1596
@@ +1593,5 @@
+// Anymore after this one?
+start_idx++;
+start_idx = cu->FindLineEntry(start_idx, line, 
&cu_file_spec,
+  /*exact=*/true, 
&line_entry);
+} while (start_idx != UINT32_MAX);

combine it together:
```
cu->FindLineEntry(start_idx + 1, ...)
```


Comment at: source/Commands/CommandObjectTarget.cpp:2689
@@ +2688,3 @@
+default:
+error.SetErrorStringWithFormat ("unrecognized option %c.", 
short_option);
+break;

Please use the most popular pattern:
```
error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
```


Comment at: tools/lldb-mi/MICmdCmdSymbol.cpp:85
@@ -84,7 +84,3 @@
 const CMIUtilString &strFilePath(pArgFile->GetValue());
-// FIXME: this won't work for header files!  To try and use existing
-// commands to get this to work for header files would be too slow.
-// Instead, this code should be rewritten to use APIs and/or support
-// should be added to lldb which would work for header files.
-const CMIUtilString strCmd(CMIUtilString::Format("target modules dump 
line-table \"%s\"", strFilePath.AddSlashes().c_str()));
+const CMIUtilString strCmd(CMIUtilString::Format("target modules dump 
lines -u false -e true -r false \"%s\"", strFilePath.AddSlashes().c_str()));
 

Could you use long-options here?


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Ilia K via lldb-commits
ki.stfu added inline comments.


Comment at: 
packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h:20
@@ -19,3 +19,3 @@
 {
-return a + b;
+return a + b; // FUNC_mfunc
 }

and could you pick it up at 1 line above?


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15566: Patch cmake to allow detection of python 2.7.9+

2015-12-17 Thread Aidan Dodds via lldb-commits
ADodds added a comment.

Its currently present in the official 2.7.10 windows x64 python distro from 
python.org.

Its also present in some of the prebuilds I have been using from here:
http://p-nand-q.com/python/building-python-27-with-vs2010.html

I can only assume that perhaps it signifies that this is a x64 build as it 
doesnt seem to be present on x86 distros.


Repository:
  rL LLVM

http://reviews.llvm.org/D15566



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


[Lldb-commits] [lldb] r255893 - Patch cmake to allow detection of python 2.7.9+

2015-12-17 Thread Aidan Dodds via lldb-commits
Author: aidandodds
Date: Thu Dec 17 08:13:39 2015
New Revision: 255893

URL: http://llvm.org/viewvc/llvm-project?rev=255893&view=rev
Log:
Patch cmake to allow detection of python 2.7.9+

Some distributions of python have their version defined as follows in 
patchlevel.h (note the '+'):
#define PY_VERSION "2.7.9+"
The '+' char needs to be stripped by the cmake regex so that LLDBs python lib 
detection is successful.

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

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=255893&r1=255892&r2=255893&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Dec 17 08:13:39 2015
@@ -71,8 +71,8 @@ function(find_python_libs_windows)
   if(EXISTS "${PYTHON_INCLUDE_DIRS}/patchlevel.h")
 file(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h" python_version_str
  REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
-string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
- PYTHONLIBS_VERSION_STRING "${python_version_str}")
+string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"+]+)[+]?\".*" 
"\\1"
+ PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" 
PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
 unset(python_version_str)


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


Re: [Lldb-commits] [PATCH] D15566: Patch cmake to allow detection of python 2.7.9+

2015-12-17 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255893: Patch cmake to allow detection of python 2.7.9+ 
(authored by aidandodds).

Changed prior to commit:
  http://reviews.llvm.org/D15566?vs=42994&id=43127#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15566

Files:
  lldb/trunk/cmake/modules/LLDBConfig.cmake

Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -71,8 +71,8 @@
   if(EXISTS "${PYTHON_INCLUDE_DIRS}/patchlevel.h")
 file(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h" python_version_str
  REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
-string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
- PYTHONLIBS_VERSION_STRING "${python_version_str}")
+string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"+]+)[+]?\".*" 
"\\1"
+ PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" 
PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
 unset(python_version_str)


Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -71,8 +71,8 @@
   if(EXISTS "${PYTHON_INCLUDE_DIRS}/patchlevel.h")
 file(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h" python_version_str
  REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
-string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
- PYTHONLIBS_VERSION_STRING "${python_version_str}")
+string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"+]+)[+]?\".*" "\\1"
+ PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
 unset(python_version_str)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r255904 - [RenderScript] Support all RS allocation types

2015-12-17 Thread Ewan Crawford via lldb-commits
Author: ewancrawford
Date: Thu Dec 17 10:40:05 2015
New Revision: 255904

URL: http://llvm.org/viewvc/llvm-project?rev=255904&view=rev
Log:
[RenderScript] Support all RS allocation types 

Currently we can just inspect the details of the most common allocation types.
This patch allows us to support all the types defined by the RS runtime in its 
`RsDataType` enum.
Including handlers, matrices and packed graphical data.

Modified:

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

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=255904&r1=255903&r2=255904&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
 Thu Dec 17 10:40:05 2015
@@ -168,7 +168,29 @@ struct RenderScriptRuntime::Element
 RS_TYPE_UNSIGNED_16,
 RS_TYPE_UNSIGNED_32,
 RS_TYPE_UNSIGNED_64,
-RS_TYPE_BOOLEAN
+RS_TYPE_BOOLEAN,
+
+RS_TYPE_UNSIGNED_5_6_5,
+RS_TYPE_UNSIGNED_5_5_5_1,
+RS_TYPE_UNSIGNED_4_4_4_4,
+
+RS_TYPE_MATRIX_4X4,
+RS_TYPE_MATRIX_3X3,
+RS_TYPE_MATRIX_2X2,
+
+RS_TYPE_ELEMENT = 1000,
+RS_TYPE_TYPE,
+RS_TYPE_ALLOCATION,
+RS_TYPE_SAMPLER,
+RS_TYPE_SCRIPT,
+RS_TYPE_MESH,
+RS_TYPE_PROGRAM_FRAGMENT,
+RS_TYPE_PROGRAM_VERTEX,
+RS_TYPE_PROGRAM_RASTER,
+RS_TYPE_PROGRAM_STORE,
+RS_TYPE_FONT,
+
+RS_TYPE_INVALID = 1
 };
 
 std::vector children;   // Child Element 
fields for structs
@@ -302,7 +324,28 @@ const char* RenderScriptRuntime::Allocat
 {"ushort", "ushort2", "ushort3", "ushort4"},
 {"uint", "uint2", "uint3", "uint4"},
 {"ulong", "ulong2", "ulong3", "ulong4"},
-{"bool", "bool2", "bool3", "bool4"}
+{"bool", "bool2", "bool3", "bool4"},
+{"packed_565", "packed_565", "packed_565", "packed_565"},
+{"packed_5551", "packed_5551", "packed_5551", "packed_5551"},
+{"packed_", "packed_", "packed_", "packed_"},
+{"rs_matrix4x4", "rs_matrix4x4", "rs_matrix4x4", "rs_matrix4x4"},
+{"rs_matrix3x3", "rs_matrix3x3", "rs_matrix3x3", "rs_matrix3x3"},
+{"rs_matrix2x2", "rs_matrix2x2", "rs_matrix2x2", "rs_matrix2x2"},
+
+// Handlers
+{"RS Element", "RS Element", "RS Element", "RS Element"},
+{"RS Type", "RS Type", "RS Type", "RS Type"},
+{"RS Allocation", "RS Allocation", "RS Allocation", "RS Allocation"},
+{"RS Sampler", "RS Sampler", "RS Sampler", "RS Sampler"},
+{"RS Script", "RS Script", "RS Script", "RS Script"},
+
+// Deprecated
+{"RS Mesh", "RS Mesh", "RS Mesh", "RS Mesh"},
+{"RS Program Fragment", "RS Program Fragment", "RS Program Fragment", "RS 
Program Fragment"},
+{"RS Program Vertex", "RS Program Vertex", "RS Program Vertex", "RS 
Program Vertex"},
+{"RS Program Raster", "RS Program Raster", "RS Program Raster", "RS 
Program Raster"},
+{"RS Program Store", "RS Program Store", "RS Program Store", "RS Program 
Store"},
+{"RS Font", "RS Font", "RS Font", "RS Font"}
 };
 
 // Used as an index into the RSTypeToFormat array elements
@@ -327,7 +370,13 @@ const unsigned int RenderScriptRuntime::
 {eFormatDecimal, eFormatVectorOfUInt16, sizeof(uint16_t)}, // 
RS_TYPE_UNSIGNED_16
 {eFormatDecimal, eFormatVectorOfUInt32, sizeof(uint32_t)}, // 
RS_TYPE_UNSIGNED_32
 {eFormatDecimal, eFormatVectorOfUInt64, sizeof(uint64_t)}, // 
RS_TYPE_UNSIGNED_64
-{eFormatBoolean, eFormatBoolean, sizeof(bool)} // RS_TYPE_BOOL
+{eFormatBoolean, eFormatBoolean, 1}, // RS_TYPE_BOOL
+{eFormatHex, eFormatHex, sizeof(uint16_t)}, // RS_TYPE_UNSIGNED_5_6_5
+{eFormatHex, eFormatHex, sizeof(uint16_t)}, // RS_TYPE_UNSIGNED_5_5_5_1
+{eFormatHex, eFormatHex, sizeof(uint16_t)}, // RS_TYPE_UNSIGNED_4_4_4_4
+{eFormatVectorOfFloat32, eFormatVectorOfFloat32, sizeof(float) * 16}, // 
RS_TYPE_MATRIX_4X4
+{eFormatVectorOfFloat32, eFormatVectorOfFloat32, sizeof(float) * 9}, // 
RS_TYPE_MATRIX_3X3
+{eFormatVectorOfFloat32, eFormatVectorOfFloat32, sizeof(float) * 4} // 
RS_TYPE_MATRIX_2X2
 };
 
 //--
@@ -1896,12 +1945,12 @@ RenderScriptRuntime::SetElementSize(Elem
 {
 Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
 const Element::DataType type = *elem.type.get();
-assert(type >= Element::RS_TYPE_NONE && type <= Element::RS_TYPE_BOOLEAN
+assert(type >= Element::RS_TYPE_NONE && type <= Element::RS_TYPE_FONT
  

Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Dawn Perchik via lldb-commits
dawn marked 6 inline comments as done.
dawn added a comment.

> clang-format your changes please (there are many deviations from the coding 
> style)


I've made some fixes even though the code is no longer consistent with the rest 
of the file.  Alas.  I would love to run all of lldb through clang-format, but 
as we've seen, there are several options which still need to be added before we 
can do that (mostly relating to the formatting function declarations).



Comment at: source/Commands/CommandObjectTarget.cpp:1510
@@ -1503,2 +1509,3 @@
 
-for (uint32_t i=0; i nit: fix indentation
This is the original code, and is consistent with the coding style of the rest 
of the file.  It bothers me too that lldb is so schizophrenic about its coding 
style, but unless we fix all of lldb, I think it's best to just try and follow 
the style of the code around you.

Does anyone else have an opinion about this?  I'll go ahead and change it, only 
because I see I that the new code I added didn't follow this style (oops).


Comment at: source/Commands/CommandObjectTarget.cpp:1541-1542
@@ +1540,4 @@
+CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i));
+if (!cu_sp)
+continue;
+CompileUnit *cu = cu_sp.get();

ki.stfu wrote:
> Isn't it always false?
Code elsewhere checks for it, so I assume there are cases when cu_sp can be 
null.  Example in source/Core/SearchFilter.cpp:
for (size_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i));
if (cu_sp)
{

Better safe than sorry.  


Comment at: source/Commands/CommandObjectTarget.cpp:1543
@@ +1542,3 @@
+continue;
+CompileUnit *cu = cu_sp.get();
+const FileSpecList &cu_file_list = cu->GetSupportFiles();

ki.stfu wrote:
> You don't need a raw pointer here, just use cu_sp.get() on line #1587
There are 5 uses of cu in this code, so I think it's cleaner to have a variable.


Comment at: source/Commands/CommandObjectTarget.cpp:1594-1596
@@ +1593,5 @@
+// Anymore after this one?
+start_idx++;
+start_idx = cu->FindLineEntry(start_idx, line, 
&cu_file_spec,
+  /*exact=*/true, 
&line_entry);
+} while (start_idx != UINT32_MAX);

ki.stfu wrote:
> combine it together:
> ```
> cu->FindLineEntry(start_idx + 1, ...)
> ```
I'd love to have a guideline as to when to wrap lines - lldb is all over the 
place about this.  I've tended to try to keep lines to 100.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Dawn Perchik via lldb-commits
dawn updated this revision to Diff 43152.
dawn marked an inline comment as done.
dawn added a comment.

Updated patch with suggestions from Ilia's review (thanks Ilia!).


Repository:
  rL LLVM

http://reviews.llvm.org/D15593

Files:
  packages/Python/lldbsuite/test/help/TestHelp.py
  packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
  
packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
  source/Commands/CommandObjectTarget.cpp
  tools/lldb-mi/MICmdCmdSymbol.cpp

Index: tools/lldb-mi/MICmdCmdSymbol.cpp
===
--- tools/lldb-mi/MICmdCmdSymbol.cpp
+++ tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -82,11 +82,7 @@
 CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile);
 
 const CMIUtilString &strFilePath(pArgFile->GetValue());
-// FIXME: this won't work for header files!  To try and use existing
-// commands to get this to work for header files would be too slow.
-// Instead, this code should be rewritten to use APIs and/or support
-// should be added to lldb which would work for header files.
-const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str()));
+const CMIUtilString strCmd(CMIUtilString::Format("target modules dump lines --compile-unit-only false --explicit-matches-only true --show-raw false \"%s\"", strFilePath.AddSlashes().c_str()));
 
 CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
 const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult);
@@ -110,10 +106,10 @@
 {
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_header_regex( 
-"^ *Line table for (.+) in `(.+)$");
-// ^1=file  ^2=module
+"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$");
+// ^1=file  ^2=cu^3=module
 
-MIUtilParse::CRegexParser::Match match(3);
+MIUtilParse::CRegexParser::Match match(4);
 
 const bool ok = g_lineentry_header_regex.Execute(input, match);
 if (ok)
@@ -146,12 +142,12 @@
 
 // Match LineEntry using regex.
 static MIUtilParse::CRegexParser g_lineentry_nocol_regex( 
-"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+)$");
+"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$");
 static MIUtilParse::CRegexParser g_lineentry_col_regex( 
-"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+):[0-9]+$");
-//  ^1=addr   ^2=f ^3=line ^4=:col(opt)
+"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$");
+// ^1=start ^2=end   ^3=f ^4=line ^5=:col(opt)
 
-MIUtilParse::CRegexParser::Match match(5);
+MIUtilParse::CRegexParser::Match match(6);
 
 // First try matching the LineEntry with the column,
 // then try without the column.
@@ -160,8 +156,8 @@
 if (ok)
 {
 addr = match.GetMatchAtIndex(1);
-file = match.GetMatchAtIndex(2);
-line = match.GetMatchAtIndex(3);
+file = match.GetMatchAtIndex(3);
+line = match.GetMatchAtIndex(4);
 }
 return ok;
 }
@@ -222,10 +218,6 @@
 if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine))
 continue;
 
-// Skip entries which don't match the desired source.
-if (strWantFile != strFile)
-continue;
-
 const CMICmnMIValueConst miValueConst(strAddr);
 const CMICmnMIValueResult miValueResult("pc", miValueConst);
 CMICmnMIValueTuple miValueTuple(miValueResult);
Index: source/Commands/CommandObjectTarget.cpp
===
--- source/Commands/CommandObjectTarget.cpp
+++ source/Commands/CommandObjectTarget.cpp
@@ -1485,39 +1485,118 @@
 }
 
 static uint32_t
-DumpCompileUnitLineTable (CommandInterpreter &interpreter,
-  Stream &strm,
-  Module *module,
-  const FileSpec &file_spec,
-  bool load_addresses)
+DumpFileLines (CommandInterpreter &interpreter,
+   Stream &strm,
+   Module *module,
+   const FileSpec &file_spec,
+   bool load_addresses,
+   bool compile_unit_only,
+   bool explicit_matches_only,
+   bool show_raw)
 {
 uint32_t num_matches = 0;
 if (module)
 {
-SymbolContextList sc_list;
-num_matches = module->ResolveSymbolContextsForFileSpec (file_spec,
-0,
-false,
-eSymbolContextCompUnit,
-

Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

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

Man those options are complex. I really would like to see something more simple:

"--raw" dumps the line entries as you have mentioned
"--no-inlines" would omit any inline entries
"--module " would only find any source file arguments in the module 
that is specified by full or basename (this option can be specified more than 
once)

The arguments are still the compile unit names (full or basenames). If there 
are no arguments, dump all line tables from all modules. If --module is 
specified, then dump all compile units from any modules that are specified.

Am I missing something?


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15582: Improve error handling for `f s #`

2015-12-17 Thread Ed Maste via lldb-commits
emaste accepted this revision.
emaste added a comment.
This revision is now accepted and ready to land.

LGTM
Or if you want show the set of arguments - e.g. ```expected frame-index, got 's 
1'``` That might clarify the "too many arguments."


http://reviews.llvm.org/D15582



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


[Lldb-commits] [lldb] r255917 - ResultsFormatter: always lock on handle_event()

2015-12-17 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Dec 17 13:13:58 2015
New Revision: 255917

URL: http://llvm.org/viewvc/llvm-project?rev=255917&view=rev
Log:
ResultsFormatter: always lock on handle_event()

Some of the newer structures were not protected.  Now that we have
a recursive lock, we just lock the whole handle_event() call.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py?rev=255917&r1=255916&r2=255917&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py Thu Dec 17 
13:13:58 2015
@@ -848,91 +848,92 @@ class ResultsFormatter(object):
 @param test_event the test event as formatted by one of the
 event_for_* calls.
 """
-# Keep track of whether terminate was received.  We do this so
-# that a process can call the 'terminate' event on its own, to
-# close down a formatter at the appropriate time.  Then the
-# atexit() cleanup can call the "terminate if it hasn't been
-# called yet".
-if test_event is not None:
-event_type = test_event.get("event", "")
-# We intentionally allow event_type to be checked anew
-# after this check below since this check may rewrite
-# the event type
-if event_type == EventBuilder.TYPE_JOB_RESULT:
-# Possibly convert the job status (timeout, exceptional exit)
-# to an appropriate test_result event.
-self._maybe_remap_job_result_event(test_event)
-event_type = test_event.get("event", "")
-
-# Remap timeouts to expected timeouts.
-if event_type in EventBuilder.RESULT_TYPES:
-self._maybe_remap_expected_timeout(test_event)
-self._maybe_remap_expected_failure(test_event)
+with self.lock:
+# Keep track of whether terminate was received.  We do this so
+# that a process can call the 'terminate' event on its own, to
+# close down a formatter at the appropriate time.  Then the
+# atexit() cleanup can call the "terminate if it hasn't been
+# called yet".
+if test_event is not None:
 event_type = test_event.get("event", "")
-
-if event_type == "terminate":
-self.terminate_called = True
-elif event_type in EventBuilder.RESULT_TYPES:
-# Keep track of event counts per test/job result status type.
-# The only job (i.e. inferior process) results that make it
-# here are ones that cannot be remapped to the most recently
-# started test for the given worker index.
-status = test_event["status"]
-self.result_status_counts[status] += 1
-# Clear the most recently started test for the related worker.
-worker_index = test_event.get("worker_index", None)
-if worker_index is not None:
-self.started_tests_by_worker.pop(worker_index, None)
-
-if status in EventBuilder.TESTRUN_ERROR_STATUS_VALUES:
-# A test/job status value in any of those status values
-# causes a testrun failure.  If such a test fails, check
-# whether it can be rerun.  If it can be rerun, add it
-# to the rerun job.
-self._maybe_add_test_to_rerun_list(test_event)
-
-# Build the test key.
-test_key = self._make_key(test_event)
-if test_key is None:
-raise Exception(
-"failed to find test filename for "
-"test event {}".format(test_event))
-
-# Save the most recent test event for the test key.
-# This allows a second test phase to overwrite the most
-# recent result for the test key (unique per method).
-# We do final reporting at the end, so we'll report based
-# on final results.
-# We do this so that a re-run caused by, perhaps, the need
-# to run a low-load, single-worker test run can have the final
-# run's results to always be used.
-if test_key in self.result_events:
-# We are replacing the result of something that was
-# already counted by the base class.  Remove the double
-# counting by reducing by one the count for the test
-# result status.
-old_status = self.

Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Jim Ingham via lldb-commits

> On Dec 17, 2015, at 10:25 AM, Dawn Perchik  wrote:
> 
> dawn marked 6 inline comments as done.
> dawn added a comment.
> 
>> clang-format your changes please (there are many deviations from the coding 
>> style)
> 
> 
> I've made some fixes even though the code is no longer consistent with the 
> rest of the file.  Alas.  I would love to run all of lldb through 
> clang-format, but as we've seen, there are several options which still need 
> to be added before we can do that (mostly relating to the formatting function 
> declarations).
> 
> 
> 
> Comment at: source/Commands/CommandObjectTarget.cpp:1510
> @@ -1503,2 +1509,3 @@
> 
> -for (uint32_t i=0; i +for (uint32_t i=0; i +{
> 
> ki.stfu wrote:
>> nit: fix indentation
> This is the original code, and is consistent with the coding style of the 
> rest of the file.  It bothers me too that lldb is so schizophrenic about its 
> coding style, but unless we fix all of lldb, I think it's best to just try 
> and follow the style of the code around you.

lldb is not "schizophrenic about its coding style."  The rules about nesting 
are quite clear, for instance.  There are just places where people have made 
mistakes, for instance where somebody added an extra level of nesting and 
forgot to indent the contained code.  Running clang-format on new submissions - 
then hand checking the result to make sure it hasn't done something incorrect - 
is a good idea.  And if you see errors while reading around, fix them as 
separate checkins.

> 
> Does anyone else have an opinion about this?  I'll go ahead and change it, 
> only because I see I that the new code I added didn't follow this style 
> (oops).
> 
> 
> Comment at: source/Commands/CommandObjectTarget.cpp:1541-1542
> @@ +1540,4 @@
> +CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i));
> +if (!cu_sp)
> +continue;
> +CompileUnit *cu = cu_sp.get();
> 
> ki.stfu wrote:
>> Isn't it always false?
> Code elsewhere checks for it, so I assume there are cases when cu_sp can be 
> null.  Example in source/Core/SearchFilter.cpp:
>for (size_t i = 0; i < num_comp_units; i++)
>{
>CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i));
>if (cu_sp)
>{
> 
> Better safe than sorry.  
> 
> 
> Comment at: source/Commands/CommandObjectTarget.cpp:1543
> @@ +1542,3 @@
> +continue;
> +CompileUnit *cu = cu_sp.get();
> +const FileSpecList &cu_file_list = cu->GetSupportFiles();
> 
> ki.stfu wrote:
>> You don't need a raw pointer here, just use cu_sp.get() on line #1587
> There are 5 uses of cu in this code, so I think it's cleaner to have a 
> variable.
> 
> 
> Comment at: source/Commands/CommandObjectTarget.cpp:1594-1596
> @@ +1593,5 @@
> +// Anymore after this one?
> +start_idx++;
> +start_idx = cu->FindLineEntry(start_idx, line, 
> &cu_file_spec,
> +  /*exact=*/true, 
> &line_entry);
> +} while (start_idx != UINT32_MAX);
> 
> ki.stfu wrote:
>> combine it together:
>> ```
>> cu->FindLineEntry(start_idx + 1, ...)
>> ```
> I'd love to have a guideline as to when to wrap lines - lldb is all over the 
> place about this.  I've tended to try to keep lines to 100.

The lldb coding conventions (http://lldb.llvm.org/lldb-coding-conventions.html) 
say:

Source code width:

lldb does not follow the 80 character line restriction llvm imposes. In our 
experience, trying to fit C++ code into an 80 character line results in code 
that is awkward to read, and the time spent trying to find good indentation 
points to avoid this would be much better spent on thinking about your code.

More importantly, the restriction induces coders to choose overly abbreviated 
names to make them better fit in 80 characters. In our opinion choosing good 
descriptive names is much more important than fitting in 80 characters.

In lldb the limit for code lines is 120 characters because it gets awkward to 
scan longer lines even on a fairly big monitor, and we've found at that length 
you seldom have to make code look ugly to get it to wrap.

However you will see some instances of longer lines. The most common occurrence 
is in the options tables for the CommandInterpreter, which contain the help 
strings as well as a bunch of important but hard to remember fields. These 
tables are much easier to read if all the fields line up vertically, and don't 
have help text interleaved in between the lines. This is another thing to keep 
in mind when running clang-format, as it will always wrap at 120, so you will 
need to tweak its output when running against intentionally too-long lines.

Jim

> 
> 
> Repository

Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Ok, so I talked with Jim on this and this is what we came up with. I would like 
to see no changes made to the "target modules dump line-table" command. It is 
dumping complete line tables. This command is not for "find any line entries 
that match this file anywhere including inline references". We should make this 
new command into "source info". Its syntax will be:

source info --file  [--line ] [--module http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Greg Clayton via lldb-commits
clayborg added a comment.

I do want to apologize to Dawn and Jim for not having chimed in earlier and 
causing Dawn some extra work.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Ilia K via lldb-commits
ki.stfu added inline comments.


Comment at: source/Commands/CommandObjectTarget.cpp:1536-1537
@@ -1508,1 +1535,4 @@
+bool has_path = (file_spec.GetDirectory().AsCString() != 0);
+int ncus = module->GetNumCompileUnits();
+for (size_t i = 0; i < ncus; i++)
 {

use it on line #1536 too


Comment at: source/Commands/CommandObjectTarget.cpp:1543
@@ +1542,3 @@
+continue;
+CompileUnit *cu = cu_sp.get();
+const FileSpecList &cu_file_list = cu->GetSupportFiles();

That's no problem. Just replace s/cu/cu_sp/ on lines #1544, #1565, #1580, 
#1594, and then use cu_sp.get() on line #1586.


Comment at: source/Commands/CommandObjectTarget.cpp:1594-1596
@@ +1593,5 @@
+start_idx++;
+start_idx = cu->FindLineEntry(start_idx, line, 
&cu_file_spec, /*exact=*/true, &line_entry);
+} while (start_idx != UINT32_MAX);
+
+// Try the next higher line, starting over at start_idx 0.

How about that?
```
start_idx = cu->FindLineEntry(start_idx + 1,
  line,
  &cu_file_spec,
  /*exact=*/true,
  &line_entry);
```


Comment at: source/Commands/CommandObjectTarget.cpp:2689
@@ +2688,3 @@
+break;
+}
+

nit: you forgot the dot


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Ilia K via lldb-commits
ki.stfu added inline comments.


Comment at: tools/lldb-mi/MICmdCmdSymbol.cpp:226
@@ -225,3 @@
-// Skip entries which don't match the desired source.
-if (strWantFile != strFile)
-continue;

Is strWantFile needed? Seems it's an auxiliary variable.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Dawn, if you don't understand what I asked you to do, let me know and I can go 
and do the "source info" command for you, then you can modify this patch to 
just use the command I added. But it should be simple to just revert and 
changes to the original line table dumping command, and move the contents over 
to the new "source info" command and just make it do what you wanted it to do.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.

2015-12-17 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Note that you won't need any of the options that you had added to the other 
command becuase the "source info" command will do what you wanted in the first 
place: find all line entries where a file and optional line is mentioned in any 
line tables.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593



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


[Lldb-commits] [lldb] r255935 - Revert "Disable test reruns on arm unless explicitly marked with --rerun-all-issues"

2015-12-17 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Dec 17 16:42:50 2015
New Revision: 255935

URL: http://llvm.org/viewvc/llvm-project?rev=255935&view=rev
Log:
Revert "Disable test reruns on arm unless explicitly marked with 
--rerun-all-issues"

and
Revert "prevent rerun logic from kicking in on test runs including aarch64."

This reverts commits:
r255719
r255747

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py?rev=255935&r1=255934&r2=255935&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py Thu Dec 17 
16:42:50 2015
@@ -762,13 +762,8 @@ class ResultsFormatter(object):
 def _maybe_add_test_to_rerun_list(self, result_event):
 key = self._make_key(result_event)
 if key is not None:
-test_is_directly_eligible = (
-key in self.rerun_eligible_tests and
-# llvm.org/pr25844 workaround: temporarily prevent
-# rerun eligibility when building for Android.
-"aarch64" not in configuration.archs and
-"arm" not in configuration.archs)
-if (test_is_directly_eligible or configuration.rerun_all_issues):
+if (key in self.rerun_eligible_tests or
+configuration.rerun_all_issues):
 test_filename = result_event.get("test_filename", None)
 if test_filename is not None:
 test_name = result_event.get("test_name", None)


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


[Lldb-commits] [lldb] r255942 - The lldb side changes to go along with r255711 where a new

2015-12-17 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Dec 17 18:45:35 2015
New Revision: 255942

URL: http://llvm.org/viewvc/llvm-project?rev=255942&view=rev
Log:
The lldb side changes to go along with r255711 where a new
"thread-pcs" key is added to the T (questionmark) packet in
gdb-remote protocol so that lldb doesn't need to query the
pc values of every thread before it resumes a process.

The only odd part with this is that I'm sending the pc 
values in big endian order, so we need to know the endianness
of the remote process before we can use them.  All other
register values in gdb-remote protocol are sent in native-endian
format so this requirement doesn't exist.  This addition is a
performance enhancement -- lldb will fall back to querying the
pc of each thread individually if it needs to -- so when
we don't have the byte order for the process yet, we don't
use these values.  Practically speaking, the only way I've 
been able to elicit this condition is for the first
T packet when we attach to a process.

 

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=255942&r1=255941&r2=255942&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
Thu Dec 17 18:45:35 2015
@@ -147,6 +147,52 @@ GDBRemoteRegisterContext::PrivateSetRegi
 return success;
 }
 
+bool
+GDBRemoteRegisterContext::PrivateSetRegisterValue (uint32_t reg, uint64_t 
new_reg_val)
+{
+const RegisterInfo *reg_info = GetRegisterInfoAtIndex (reg);
+if (reg_info == NULL)
+return false;
+
+// Early in process startup, we can get a thread that has an invalid byte 
order
+// because the process hasn't been completely set up yet (see the ctor 
where the
+// byte order is setfrom the process).  If that's the case, we can't set 
the
+// value here.
+if (m_reg_data.GetByteOrder() == eByteOrderInvalid)
+{
+return false;
+}
+
+// Invalidate if needed
+InvalidateIfNeeded (false);
+
+DataBufferSP buffer_sp (new DataBufferHeap (&new_reg_val, sizeof 
(new_reg_val)));
+DataExtractor data (buffer_sp, endian::InlHostByteOrder(), sizeof (void*));
+
+// If our register context and our register info disagree, which should 
never happen, don't
+// overwrite past the end of the buffer.
+if (m_reg_data.GetByteSize() < reg_info->byte_offset + reg_info->byte_size)
+return false;
+
+// Grab a pointer to where we are going to put this register
+uint8_t *dst = 
const_cast(m_reg_data.PeekData(reg_info->byte_offset, 
reg_info->byte_size));
+
+if (dst == NULL)
+return false;
+
+
+if (data.CopyByteOrderedData (0,// src offset
+  reg_info->byte_size,  // src length
+  dst,  // dst
+  reg_info->byte_size,  // dst length
+  m_reg_data.GetByteOrder()))   // dst byte 
order
+{
+SetRegisterIsValid (reg, true);
+return true;
+}
+return false;
+}
+
 // Helper function for GDBRemoteRegisterContext::ReadRegisterBytes().
 bool
 GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info,

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=255942&r1=255941&r2=255942&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Thu 
Dec 17 18:45:35 2015
@@ -109,6 +109,9 @@ protected:
 bool
 PrivateSetRegisterValue (uint32_t reg, StringExtractor &response);
 
+bool
+PrivateSetRegisterValue (uint32_t reg, uint64_t val);
+
 void
 SetAllRegisterValid (bool b);
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=255942&r1=255941&r2=255942&view=diff
==

[Lldb-commits] [lldb] r255972 - Make the Language print the description of the Exception Breakpoint resolver. Also

2015-12-17 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Dec 17 20:14:04 2015
New Revision: 255972

URL: http://llvm.org/viewvc/llvm-project?rev=255972&view=rev
Log:
Make the Language print the description of the Exception Breakpoint resolver.  
Also
have the breakpoint description print the precondition description if one 
exists.
No behavior change.



Modified:
lldb/trunk/include/lldb/Breakpoint/Breakpoint.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
lldb/trunk/source/Breakpoint/Breakpoint.cpp
lldb/trunk/source/Target/Language.cpp
lldb/trunk/source/Target/LanguageRuntime.cpp
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/Breakpoint.h?rev=255972&r1=255971&r2=255972&view=diff
==
--- lldb/trunk/include/lldb/Breakpoint/Breakpoint.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/Breakpoint.h Thu Dec 17 20:14:04 2015
@@ -163,7 +163,7 @@ public:
 ConfigurePrecondition(Args &options);
 
 virtual void
-DescribePrecondition(Stream &stream, lldb::DescriptionLevel level);
+GetDescription(Stream &stream, lldb::DescriptionLevel level);
 };
 
 typedef std::shared_ptr BreakpointPreconditionSP;

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=255972&r1=255971&r2=255972&view=diff
==
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Thu Dec 17 20:14:04 2015
@@ -146,6 +146,12 @@ public:
 FunctionNameRepresentation representation,
 Stream& s);
 
+virtual void
+GetExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s);
+
+static void
+GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, 
Stream &s);
+
 // These are accessors for general information about the Languages lldb 
knows about:
 
 static lldb::LanguageType

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=255972&r1=255971&r2=255972&view=diff
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Thu Dec 17 20:14:04 
2015
@@ -204,7 +204,7 @@ public:
 ~ObjCExceptionPrecondition() override = default;
 
 bool EvaluatePrecondition(StoppointCallbackContext &context) override;
-void DescribePrecondition(Stream &stream, lldb::DescriptionLevel 
level) override;
+void GetDescription(Stream &stream, lldb::DescriptionLevel level) 
override;
 Error ConfigurePrecondition(Args &args) override;
 
 protected:

Modified: lldb/trunk/source/Breakpoint/Breakpoint.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Breakpoint.cpp?rev=255972&r1=255971&r2=255972&view=diff
==
--- lldb/trunk/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/trunk/source/Breakpoint/Breakpoint.cpp Thu Dec 17 20:14:04 2015
@@ -844,6 +844,9 @@ Breakpoint::GetDescription (Stream *s, l
 
 GetOptions()->GetDescription(s, level);
 
+if (m_precondition_sp)
+m_precondition_sp->GetDescription(*s, level);
+
 if (level == lldb::eDescriptionLevelFull)
 {
 if (!m_name_list.empty())
@@ -959,7 +962,7 @@ Breakpoint::BreakpointPrecondition::Eval
 }
 
 void
-Breakpoint::BreakpointPrecondition::DescribePrecondition(Stream &stream, 
lldb::DescriptionLevel level)
+Breakpoint::BreakpointPrecondition::GetDescription(Stream &stream, 
lldb::DescriptionLevel level)
 {
 }
 

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=255972&r1=255971&r2=255972&view=diff
==
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Thu Dec 17 20:14:04 2015
@@ -430,6 +430,19 @@ Language::GetFunctionDisplayName (const
 return false;
 }
 
+void
+Language::GetExceptionResolverDescription(bool catch_on, bool throw_on, Stream 
&s)
+{
+GetDefaultExceptionResolverDescription(catch_on, throw_on, s);
+}
+
+void
+Language::GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, 
Stream &s)
+{
+   s.Printf ("Exception breakpoint (catch: %s throw: %s)",
+ catch_on ? "on" : "off",
+ throw_on ? "on" : "o

[Lldb-commits] [lldb] r255973 - Fix formatting for last commit.

2015-12-17 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Dec 17 20:15:25 2015
New Revision: 255973

URL: http://llvm.org/viewvc/llvm-project?rev=255973&view=rev
Log:
Fix formatting for last commit.

Modified:
lldb/trunk/source/Target/Language.cpp

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=255973&r1=255972&r2=255973&view=diff
==
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Thu Dec 17 20:15:25 2015
@@ -439,9 +439,9 @@ Language::GetExceptionResolverDescriptio
 void
 Language::GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, 
Stream &s)
 {
-   s.Printf ("Exception breakpoint (catch: %s throw: %s)",
- catch_on ? "on" : "off",
- throw_on ? "on" : "off");
+ s.Printf ("Exception breakpoint (catch: %s throw: %s)",
+   catch_on ? "on" : "off",
+   throw_on ? "on" : "off");
 }
 //--
 // Constructor


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


[Lldb-commits] LLVM buildmaster will be restarted in few minutes

2015-12-17 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated and restarted after 7 PM Pacific time
today.

Thanks

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