[Lldb-commits] [lldb] r356003 - [TestBatchMode] We already log this output to a file.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 19:47:51 2019
New Revision: 356003

URL: http://llvm.org/viewvc/llvm-project?rev=356003=rev
Log:
[TestBatchMode] We already log this output to a file.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=356003=356002=356003=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
Tue Mar 12 19:47:51 2019
@@ -56,9 +56,6 @@ class DriverBatchModeTest (TestBase):
 '%s %s %s %s -- CRASH' %
 (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
 child = self.child
-# Turn on logging for what the child sends back.
-if self.TraceOn():
-child.logfile_read = sys.stdout
 
 # We should see the "run":
 self.expect_string("run")
@@ -97,9 +94,6 @@ class DriverBatchModeTest (TestBase):
 '%s %s %s %s -- NOCRASH' %
 (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
 child = self.child
-# Turn on logging for what the child sends back.
-if self.TraceOn():
-child.logfile_read = sys.stdout
 
 # We should see the "run":
 self.expect_string("run")
@@ -148,9 +142,6 @@ class DriverBatchModeTest (TestBase):
 
 self.addTearDownHook(self.closeVictim)
 
-if self.TraceOn():
-self.victim.logfile_read = sys.stdout
-
 self.victim.expect("PID: ([0-9]+) END")
 if self.victim.match is None:
 self.fail("Couldn't get the target PID.")
@@ -169,9 +160,6 @@ class DriverBatchModeTest (TestBase):
  exe))
 
 child = self.child
-# Turn on logging for what the child sends back.
-if self.TraceOn():
-child.logfile_read = sys.stdout
 
 # We should see the "run":
 self.expect_string("attach")


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


[Lldb-commits] [lldb] r356002 - [testsuite] Remove other traces broken in python 3.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 19:44:32 2019
New Revision: 356002

URL: http://llvm.org/viewvc/llvm-project?rev=356002=rev
Log:
[testsuite] Remove other traces broken in python 3.

They can be reinstated in case somebody needs to debug
this test in the future.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py?rev=356002=356001=356002=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py 
Tue Mar 12 19:44:32 2019
@@ -66,13 +66,8 @@ class SBDataAPICase(TestBase):
 self.assertIsNotNone(thread)
 
 frame = thread.GetSelectedFrame()
-if self.TraceOn():
-print(frame)
 foobar = frame.FindVariable('foobar')
 self.assertTrue(foobar.IsValid())
-if self.TraceOn():
-print(foobar)
-
 data = foobar.GetPointeeData(0, 2)
 offset = 0
 error = lldb.SBError()
@@ -130,9 +125,6 @@ class SBDataAPICase(TestBase):
 
 data = star_foobar.GetData()
 
-if self.TraceOn():
-print(data)
-
 offset = 0
 self.assert_data(data.GetUnsignedInt32, offset, 1)
 offset += 4
@@ -151,14 +143,8 @@ class SBDataAPICase(TestBase):
 new_foobar = foobar.CreateValueFromAddress(
 "f00", foobar_addr, star_foobar.GetType())
 self.assertTrue(new_foobar.IsValid())
-if self.TraceOn():
-print(new_foobar)
-
 data = new_foobar.GetData()
 
-if self.TraceOn():
-print(data)
-
 self.assertTrue(data.uint32[0] == 8, 'then foo[1].a == 8')
 self.assertTrue(data.uint32[1] == 7, 'then foo[1].b == 7')
 # exploiting that sizeof(uint32) == sizeof(float)
@@ -182,9 +168,6 @@ class SBDataAPICase(TestBase):
 
 data = new_foobar.GetData()
 
-if self.TraceOn():
-print(data)
-
 offset = 0
 self.assert_data(data.GetUnsignedInt32, offset, 8)
 offset += 4
@@ -204,13 +187,6 @@ class SBDataAPICase(TestBase):
 barfoo = frame.FindVariable('barfoo')
 
 data = barfoo.GetData()
-
-if self.TraceOn():
-print(barfoo)
-
-if self.TraceOn():
-print(data)
-
 offset = 0
 self.assert_data(data.GetUnsignedInt32, offset, 1)
 offset += 4
@@ -241,10 +217,6 @@ class SBDataAPICase(TestBase):
 new_object = barfoo.CreateValueFromData(
 "new_object", data, barfoo.GetType().GetBasicType(
 lldb.eBasicTypeInt))
-
-if self.TraceOn():
-print(new_object)
-
 self.assertTrue(new_object.GetValue() == "1", 'new_object == 1')
 
 if data.GetByteOrder() == lldb.eByteOrderBig:
@@ -271,9 +243,6 @@ class SBDataAPICase(TestBase):
 
 data.Append(data2)
 
-if self.TraceOn():
-print(data)
-
 # this breaks on EBCDIC
 offset = 0
 self.assert_data(data.GetUnsignedInt32, offset, 65)


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


[Lldb-commits] [lldb] r356000 - [testsuite] Remove dead code in TestFormats.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 18:26:01 2019
New Revision: 356000

URL: http://llvm.org/viewvc/llvm-project?rev=356000=rev
Log:
[testsuite] Remove dead code in TestFormats.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py?rev=356000=355999=356000=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py 
Tue Mar 12 18:26:01 2019
@@ -28,9 +28,6 @@ class TestFormats(TestBase):
 child = pexpect.spawn(
 '%s %s -x -o "b main" -o r %s' %
 (lldbtest_config.lldbExec, self.lldbOption, exe))
-# Turn on logging for what the child sends back.
-if self.TraceOn():
-child.logfile_read = sys.stdout
 # So that the spawned lldb session gets shutdown durng teardown.
 self.child = child
 
@@ -40,27 +37,3 @@ class TestFormats(TestBase):
 child.expect_exact(prompt + 'r')
 child.expect_exact(prompt)
 child.sendline()
-# child.expect_exact(prompt + "target create")
-#
-# child.sendline("command regex 'Help__'")
-# child.expect_exact(regex_prompt)
-# child.sendline('s/^$/help/')
-# child.expect_exact(regex_prompt1)
-# child.sendline('')
-# child.expect_exact(prompt)
-# # Help!
-# child.sendline('Help__')
-# # If we see the familiar 'help' output, the test is done.
-# child.expect('Debugger commands:')
-# # Try and incorrectly remove "Help__" using "command unalias" and 
verify we fail
-# child.sendline('command unalias Help__')
-# child.expect_exact("error: 'Help__' is not an alias, it is a 
debugger command which can be removed using the 'command delete' command")
-# child.expect_exact(prompt)
-#
-# # Delete the regex command using "command delete"
-# child.sendline('command delete Help__')
-# child.expect_exact(prompt)
-# # Verify the command was removed
-# child.sendline('Help__')
-# child.expect_exact("error: 'Help__' is not a valid command")
-# child.expect_exact(prompt)


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


[Lldb-commits] [lldb] r355998 - [Python] Fix another batch of python 2/python 3 portability issues.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 17:48:29 2019
New Revision: 355998

URL: http://llvm.org/viewvc/llvm-project?rev=355998=rev
Log:
[Python] Fix another batch of python 2/python 3 portability issues.

Modified:
lldb/trunk/examples/summaries/synth.py

lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py

Modified: lldb/trunk/examples/summaries/synth.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/summaries/synth.py?rev=355998=355997=355998=diff
==
--- lldb/trunk/examples/summaries/synth.py (original)
+++ lldb/trunk/examples/summaries/synth.py Tue Mar 12 17:48:29 2019
@@ -33,11 +33,8 @@ class PythonObjectSyntheticChildProvider
 def gen_child(self, name, value):
 data = None
 type = None
-if isinstance(value, int):
-data = lldb.SBData.CreateDataFromUInt32Array(
-self.bo, self.ps, [value])
-type = self.value.target.GetBasicType(lldb.eBasicTypeInt)
-elif isinstance(value, long):
+import six
+if isinstance(value, six.integer_types):
 data = lldb.SBData.CreateDataFromUInt64Array(
 self.bo, self.ps, [value])
 type = self.value.target.GetBasicType(lldb.eBasicTypeLong)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py?rev=355998=355997=355998=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py 
Tue Mar 12 17:48:29 2019
@@ -60,8 +60,13 @@ class DarwinNSLogOutputTestCase(TestBase
 
 # So that the child gets torn down after the test.
 import pexpect
-self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec,
- self.lldbOption, exe))
+import sys
+if sys.version_info.major == 3:
+  self.child = pexpect.spawnu('%s %s %s' % (lldbtest_config.lldbExec,
+self.lldbOption, exe))
+else:
+  self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec,
+   self.lldbOption, exe))
 child = self.child
 
 # Turn on logging for what the child sends back.

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py?rev=355998=355997=355998=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py 
Tue Mar 12 17:48:29 2019
@@ -42,7 +42,11 @@ class TestSTTYBeforeAndAfter(TestBase):
 lldb_prompt = "(lldb) "
 
 # So that the child gets torn down after the test.
-self.child = pexpect.spawn('expect')
+import sys
+if sys.version_info.major == 3:
+  self.child = pexpect.spawnu('expect')
+else:
+  self.child = pexpect.spawn('expect')
 child = self.child
 
 child.expect(expect_prompt)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py?rev=355998=355997=355998=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py 
Tue Mar 12 17:48:29 2019
@@ -42,8 +42,13 @@ class MiTestCaseBase(Base):
 
 def spawnLldbMi(self, exe=None, args=None, preconfig=True):
 import pexpect
-self.child = pexpect.spawn("%s --interpreter %s" % (
-self.lldbMiExec, args if args else ""), cwd=self.getBuildDir())
+import sys
+if sys.version_info.major == 3:
+  self.child = pexpect.spawnu("%s --interpreter %s" % (
+  self.lldbMiExec, args if args else ""), cwd=self.getBuildDir())
+else:
+  self.child = pexpect.spawn("%s --interpreter %s" % (
+  self.lldbMiExec, args if args else ""), cwd=self.getBuildDir())
 self.child.setecho(True)
 self.mylog = self.getBuildArtifact("child.log")
 

[Lldb-commits] [lldb] r355999 - [test] Some unicode sequences can't be printed, and Py 3 is more picky.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 17:48:32 2019
New Revision: 355999

URL: http://llvm.org/viewvc/llvm-project?rev=355999=rev
Log:
[test] Some unicode sequences can't be printed, and Py 3 is more picky.

Given this was under trace, it can just be removed. If somebody
ever needs to debug this testcase again and print the data, they
can add a new statement.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py?rev=355999=355998=355999=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py 
Tue Mar 12 17:48:32 2019
@@ -74,10 +74,6 @@ class SBDataAPICase(TestBase):
 print(foobar)
 
 data = foobar.GetPointeeData(0, 2)
-
-if self.TraceOn():
-print(data)
-
 offset = 0
 error = lldb.SBError()
 


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


[Lldb-commits] [lldb] r355994 - Update the macOS implementation of ComputeClangResourceDirectory to

2019-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Mar 12 16:59:02 2019
New Revision: 355994

URL: http://llvm.org/viewvc/llvm-project?rev=355994=rev
Log:
Update the macOS implementation of ComputeClangResourceDirectory to
comply with the more pedantic TestPaths.py

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

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangHost.cpp?rev=355994=355993=355994=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangHost.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangHost.cpp Tue Mar 12 
16:59:02 2019
@@ -98,7 +98,7 @@ bool lldb_private::ComputeClangResourceD
 "Developer/Toolchains/XcodeDefault.xctoolchain",
 swift_clang_resource_dir);
 if (!verify || VerifyClangPath(clang_path)) {
-  file_spec.SetFile(clang_path.c_str(), FileSpec::Style::native);
+  file_spec.GetDirectory().SetString(clang_path.c_str());
   FileSystem::Instance().Resolve(file_spec);
   return true;
 }
@@ -113,7 +113,7 @@ bool lldb_private::ComputeClangResourceD
   raw_path.resize(parent - r_end);
   llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
   if (!verify || VerifyClangPath(clang_path)) {
-file_spec.SetFile(clang_path.c_str(), FileSpec::Style::native);
+file_spec.GetDirectory().SetString(clang_path.c_str());
 FileSystem::Instance().Resolve(file_spec);
 return true;
   }
@@ -126,7 +126,7 @@ bool lldb_private::ComputeClangResourceD
 
   // Fall back to the Clang resource directory inside the framework.
   raw_path.append("LLDB.framework/Resources/Clang");
-  file_spec.SetFile(raw_path.c_str(), FileSpec::Style::native);
+  file_spec.GetDirectory().SetString(raw_path.c_str());
   FileSystem::Instance().Resolve(file_spec);
   return true;
 #endif // __APPLE__


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


[Lldb-commits] [PATCH] D59276: Delete dead code

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

In D59276#1426972 , @aprantl wrote:

> One one hand this seems fine to remove, but on the other hand — won't these 
> functions come in handy to compare and debug differences between the LLDB and 
> LLVM DWARF parsers, while we are switching over?


Maybe, but I'm not sure how useful it will actually be in practice to compare 
dump output that way.  I feel like if we successfully parse the DWARF using 
LLVM's parser, and no tests on either side regress in the process, then it is 
probably sufficient to say that things worked.

Can you imagine a scenario where the two outputs meaningfully differ but the 
test suites passed anyway?


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

https://reviews.llvm.org/D59276



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


[Lldb-commits] [PATCH] D59276: Delete dead code

2019-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

One one hand this seems fine to remove, but on the other hand — won't these 
functions come in handy to compare and debug differences between the LLDB and 
LLVM DWARF parsers, while we are switching over?


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

https://reviews.llvm.org/D59276



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


[Lldb-commits] [lldb] r355992 - This test is failing on and off on the bots.

2019-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Mar 12 16:15:48 2019
New Revision: 355992

URL: http://llvm.org/viewvc/llvm-project?rev=355992=rev
Log:
This test is failing on and off on the bots.  
Disable it for now till I can figure out what's going wrong.

Modified:
lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test

Modified: lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test?rev=355992=355991=355992=diff
==
--- lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test (original)
+++ lldb/trunk/lit/ExecControl/StopHook/stop-hook-threads.test Tue Mar 12 
16:15:48 2019
@@ -6,7 +6,7 @@
 # XFAIL: system-netbsd
 # UNSUPPORTED: system-windows
 # This test is flakey and hangs on windows periodically: llvm.org/pr38373
-# UNSUPPORTED: system-linux
+# UNSUPPORTED: system-linux, system-darwin
 
 thread list
 break set -f stop-hook-threads.cpp -p "Set break point at this line"


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


[Lldb-commits] [PATCH] D59276: Delete dead code

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
zturner created this revision.
zturner added reviewers: clayborg, aprantl.
Herald added subscribers: jdoerfert, mgorny.

Most of these are Dump functions that are never called, but there is one 
instance of entire unused classes (DWARFDebugMacinfo and 
DWARFDebugMacinfoEntry) which are also unreferenced in the codebase).


https://reviews.llvm.org/D59276

Files:
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h

Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
+++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
@@ -104,8 +104,6 @@
 
 bool Read(const lldb_private::DWARFDataExtractor ,
   lldb::offset_t *offset_ptr, DIEInfo _data) const;
-
-void Dump(lldb_private::Stream , const DIEInfo _data) const;
   };
 
   // A class for reading and using a saved hash table from a block of data
Index: lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
@@ -304,49 +304,6 @@
   return true;
 }
 
-void DWARFMappedHash::Header::Dump(lldb_private::Stream ,
-   const DIEInfo _data) const {
-  const size_t num_atoms = header_data.atoms.size();
-  for (size_t i = 0; i < num_atoms; ++i) {
-if (i > 0)
-  strm.PutCString(", ");
-
-DWARFFormValue form_value(NULL, header_data.atoms[i].form);
-switch (header_data.atoms[i].type) {
-case eAtomTypeDIEOffset: // DIE offset, check form for encoding
-  strm.Printf("{0x%8.8x}", hash_data.offset);
-  break;
-
-case eAtomTypeTag: // DW_TAG value for the DIE
-{
-  const char *tag_cstr = lldb_private::DW_TAG_value_to_name(hash_data.tag);
-  if (tag_cstr)
-strm.PutCString(tag_cstr);
-  else
-strm.Printf("DW_TAG_(0x%4.4x)", hash_data.tag);
-} break;
-
-case eAtomTypeTypeFlags: // Flags from enum TypeFlags
-  strm.Printf("0x%2.2x", hash_data.type_flags);
-  if (hash_data.type_flags) {
-strm.PutCString(" (");
-if (hash_data.type_flags & eTypeFlagClassIsImplementation)
-  strm.PutCString(" implementation");
-strm.PutCString(" )");
-  }
-  break;
-
-case eAtomTypeQualNameHash: // Flags from enum TypeFlags
-  strm.Printf("0x%8.8x", hash_data.qualified_name_hash);
-  break;
-
-default:
-  strm.Printf("AtomType(0x%x)", header_data.atoms[i].type);
-  break;
-}
-  }
-}
-
 DWARFMappedHash::MemoryTable::MemoryTable(
 lldb_private::DWARFDataExtractor _data,
 const lldb_private::DWARFDataExtractor _table, const char *name)
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
@@ -45,8 +45,6 @@
 
 const char *DW_VIS_value_to_name(uint32_t val);
 
-const char *DW_VIRTUALITY_value_to_name(uint32_t val);
-
 const char *DW_LANG_value_to_name(uint32_t val);
 
 const char *DW_ID_value_to_name(uint32_t val);
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
@@ -411,17 +411,6 @@
   return llvmstr.data();
 }
 
-const char *DW_VIRTUALITY_value_to_name(uint32_t val) {
-  static char invalid[100];
-  llvm::StringRef llvmstr = llvm::dwarf::VirtualityString(val);
- 

[Lldb-commits] [lldb] r355991 - Fix the broken Batch test by passing a custom module cache to the inferior lldb.

2019-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Mar 12 15:20:29 2019
New Revision: 355991

URL: http://llvm.org/viewvc/llvm-project?rev=355991=rev
Log:
Fix the broken Batch test by passing a custom module cache to the inferior lldb.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=355991=355990=355991=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
Tue Mar 12 15:20:29 2019
@@ -47,10 +47,11 @@ class DriverBatchModeTest (TestBase):
 
 import pexpect
 exe = self.getBuildArtifact("a.out")
+module_cache = self.getBuildArtifact("module.cache")
 prompt = "(lldb) "
 
 # Pass CRASH so the process will crash and stop in batch mode.
-run_commands = ' -b -o "break set -n main" -o "run" -o "continue" -k 
"frame var touch_me_not"'
+run_commands = ' -b -o "settings set symbols.clang-modules-cache-path 
%s" -o "break set -n main" -o "run" -o "continue" -k "frame var touch_me_not"' 
% module_cache
 self.child = pexpect.spawn(
 '%s %s %s %s -- CRASH' %
 (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
@@ -87,10 +88,11 @@ class DriverBatchModeTest (TestBase):
 
 import pexpect
 exe = self.getBuildArtifact("a.out")
+module_cache = self.getBuildArtifact("module.cache")
 prompt = "(lldb) "
 
 # Now do it again, and make sure if we don't crash, we quit:
-run_commands = ' -b -o "break set -n main" -o "run" -o "continue" '
+run_commands = ' -b -o "settings set symbols.clang-modules-cache-path 
%s" -o "break set -n main" -o "run" -o "continue" '%module_cache
 self.child = pexpect.spawn(
 '%s %s %s %s -- NOCRASH' %
 (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
@@ -131,6 +133,7 @@ class DriverBatchModeTest (TestBase):
 
 import pexpect
 exe = self.getBuildArtifact("a.out")
+module_cache = self.getBuildArtifact("module.cache")
 prompt = "(lldb) "
 
 # Finally, start up the process by hand, attach to it, and wait for 
its completion.
@@ -156,8 +159,8 @@ class DriverBatchModeTest (TestBase):
 
 self.victim.expect("Waiting")
 
-run_commands = ' -b -o "process attach -p %d" -o "breakpoint set 
--file %s -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" 
-o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (
-victim_pid, self.source)
+run_commands = ' -b  -o "settings set symbols.clang-modules-cache-path 
%s" -o "process attach -p %d" -o "breakpoint set --file %s -p \'Stop here to 
unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete 
keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (
+module_cache, victim_pid, self.source)
 self.child = pexpect.spawn(
 '%s %s %s %s' %
 (lldbtest_config.lldbExec,


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


[Lldb-commits] [lldb] r355990 - Revert "Temporarily add more logging to TestBatchMode"

2019-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Mar 12 15:20:26 2019
New Revision: 355990

URL: http://llvm.org/viewvc/llvm-project?rev=355990=rev
Log:
Revert "Temporarily add more logging to TestBatchMode"

Modified:
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=355990=355989=355990=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
Tue Mar 12 15:20:26 2019
@@ -45,8 +45,6 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
-self.runCmd("log enable lldb expr")
-
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "
@@ -87,8 +85,6 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
-self.runCmd("log enable lldb expr")
-
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "
@@ -133,8 +129,6 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
-self.runCmd("log enable lldb expr")
-
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "


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


[Lldb-commits] [PATCH] D58930: Add XCOFF triple object format type for AIX

2019-03-12 Thread Jason Liu via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355989: Add XCOFF triple object format type for AIX 
(authored by jasonliu, committed by ).
Herald added a subscriber: kristina.

Changed prior to commit:
  https://reviews.llvm.org/D58930?vs=189713=190346#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58930

Files:
  cfe/trunk/lib/CodeGen/BackendUtil.cpp
  cfe/trunk/lib/CodeGen/CodeGenModule.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  llvm/trunk/include/llvm/ADT/Triple.h
  llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
  llvm/trunk/lib/MC/MCContext.cpp
  llvm/trunk/lib/MC/MCObjectFileInfo.cpp
  llvm/trunk/lib/MC/MCParser/AsmParser.cpp
  llvm/trunk/lib/Support/Triple.cpp
  llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/trunk/unittests/ADT/TripleTest.cpp

Index: llvm/trunk/include/llvm/ADT/Triple.h
===
--- llvm/trunk/include/llvm/ADT/Triple.h
+++ llvm/trunk/include/llvm/ADT/Triple.h
@@ -219,6 +219,7 @@
 ELF,
 MachO,
 Wasm,
+XCOFF,
   };
 
 private:
@@ -598,6 +599,11 @@
!isAndroid();
   }
 
+  /// Tests whether the OS is AIX.
+  bool isOSAIX() const {
+return getOS() == Triple::AIX;
+  }
+
   /// Tests whether the OS uses the ELF binary format.
   bool isOSBinFormatELF() const {
 return getObjectFormat() == Triple::ELF;
@@ -618,6 +624,11 @@
 return getObjectFormat() == Triple::Wasm;
   }
 
+  /// Tests whether the OS uses the XCOFF binary format.
+  bool isOSBinFormatXCOFF() const {
+return getObjectFormat() == Triple::XCOFF;
+  }
+
   /// Tests whether the target is the PS4 CPU
   bool isPS4CPU() const {
 return getArch() == Triple::x86_64 &&
Index: llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
===
--- llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
+++ llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
@@ -380,7 +380,7 @@
 return EHFrameSection;
   }
 
-  enum Environment { IsMachO, IsELF, IsCOFF, IsWasm };
+  enum Environment { IsMachO, IsELF, IsCOFF, IsWasm, IsXCOFF };
   Environment getObjectFileType() const { return Env; }
 
   bool isPositionIndependent() const { return PositionIndependent; }
Index: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
===
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -5594,6 +5594,9 @@
   case MCObjectFileInfo::IsWasm:
 CurrentFormat = WASM;
 break;
+  case MCObjectFileInfo::IsXCOFF:
+llvm_unreachable("unexpected object format");
+break;
   }
 
   if (~Prefix->SupportedFormats & CurrentFormat) {
Index: llvm/trunk/lib/Support/Triple.cpp
===
--- llvm/trunk/lib/Support/Triple.cpp
+++ llvm/trunk/lib/Support/Triple.cpp
@@ -534,6 +534,9 @@
 
 static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
   return StringSwitch(EnvironmentName)
+// "xcoff" must come before "coff" because of the order-dependendent
+// pattern matching.
+.EndsWith("xcoff", Triple::XCOFF)
 .EndsWith("coff", Triple::COFF)
 .EndsWith("elf", Triple::ELF)
 .EndsWith("macho", Triple::MachO)
@@ -622,6 +625,7 @@
   case Triple::ELF: return "elf";
   case Triple::MachO: return "macho";
   case Triple::Wasm: return "wasm";
+  case Triple::XCOFF: return "xcoff";
   }
   llvm_unreachable("unknown object format type");
 }
@@ -686,6 +690,8 @@
   case Triple::ppc64:
 if (T.isOSDarwin())
   return Triple::MachO;
+else if (T.isOSAIX())
+  return Triple::XCOFF;
 return Triple::ELF;
 
   case Triple::wasm32:
Index: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
===
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp
@@ -710,6 +710,9 @@
   case MCObjectFileInfo::IsWasm:
 PlatformParser.reset(createWasmAsmParser());
 break;
+  case MCObjectFileInfo::IsXCOFF:
+// TODO: Need to implement createXCOFFAsmParser for XCOFF format.
+break;
   }
 
   PlatformParser->Initialize(*this);
Index: llvm/trunk/lib/MC/MCContext.cpp
===
--- llvm/trunk/lib/MC/MCContext.cpp
+++ llvm/trunk/lib/MC/MCContext.cpp
@@ -161,6 +161,9 @@
   return new (Name, *this) MCSymbolMachO(Name, IsTemporary);
 case MCObjectFileInfo::IsWasm:
   return new (Name, *this) MCSymbolWasm(Name, IsTemporary);
+case MCObjectFileInfo::IsXCOFF:
+  // TODO: Need to implement class MCSymbolXCOFF.
+  break;
 }
   }
   return new (Name, *this) MCSymbol(MCSymbol::SymbolKindUnset, Name,

[Lldb-commits] [lldb] r355985 - Add more logging to ClangModulesDeclVendor.cpp

2019-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Mar 12 14:30:47 2019
New Revision: 355985

URL: http://llvm.org/viewvc/llvm-project?rev=355985=rev
Log:
Add more logging to ClangModulesDeclVendor.cpp

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

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=355985=355984=355985=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
Tue Mar 12 14:30:47 2019
@@ -624,12 +624,21 @@ ClangModulesDeclVendor::Create(Target 
   clang::CompilerInstance::createDiagnostics(new clang::DiagnosticOptions,
  new 
StoringDiagnosticConsumer);
 
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+  if (log)
+log->PutString("ClangModulesDeclVendor::Create()");
   std::vector compiler_invocation_argument_cstrs;
   compiler_invocation_argument_cstrs.reserve(
   compiler_invocation_arguments.size());
   for (const std::string  : compiler_invocation_arguments) {
 compiler_invocation_argument_cstrs.push_back(arg.c_str());
+if (log) {
+  log->PutString("\n  ");
+  log->PutString(arg);
+}
   }
+  if (log)
+log->PutString("\n");
 
   std::shared_ptr invocation =
   
clang::createInvocationFromCommandLine(compiler_invocation_argument_cstrs,


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


[Lldb-commits] [lldb] r355986 - Temporarily add more logging to TestBatchMode

2019-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Mar 12 14:30:50 2019
New Revision: 355986

URL: http://llvm.org/viewvc/llvm-project?rev=355986=rev
Log:
Temporarily add more logging to TestBatchMode

Modified:
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=355986=355985=355986=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
Tue Mar 12 14:30:50 2019
@@ -45,6 +45,8 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
+self.runCmd("log enable lldb expr")
+
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "
@@ -85,6 +87,8 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
+self.runCmd("log enable lldb expr")
+
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "
@@ -129,6 +133,8 @@ class DriverBatchModeTest (TestBase):
 self.build()
 self.setTearDownCleanup()
 
+self.runCmd("log enable lldb expr")
+
 import pexpect
 exe = self.getBuildArtifact("a.out")
 prompt = "(lldb) "


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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355975: Remove support for DWARF64. (authored by zturner, 
committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D59235?vs=190173=190326#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59235

Files:
  include/lldb/Core/dwarf.h
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: include/lldb/Core/dwarf.h
===
--- include/lldb/Core/dwarf.h
+++ include/lldb/Core/dwarf.h
@@ -27,15 +27,8 @@
 // any addresses in the compile units that get
 // parsed
 
-#ifdef DWARFUTILS_DWARF64
-#define DWARF_REF_ADDR_SIZE 8
-typedef uint64_t dw_offset_t; // Dwarf Debug Information Entry offset for any
-  // offset into the file
-#else
-#define DWARF_REF_ADDR_SIZE 4
 typedef uint32_t dw_offset_t; // Dwarf Debug Information Entry offset for any
   // offset into the file
-#endif
 
 /* Constants */
 #define DW_INVALID_OFFSET (~(dw_offset_t)0)
Index: source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -87,8 +87,7 @@
 lldb::offset_t *offset_ptr, const DWARFUnit *cu);
   static bool IsBlockForm(const dw_form_t form);
   static bool IsDataForm(const dw_form_t form);
-  static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size,
-bool is_dwarf64);
+  static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size);
   static int Compare(const DWARFFormValue , const DWARFFormValue );
   void Clear();
   static bool FormIsSupported(dw_form_t form);
Index: source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
@@ -12,11 +12,7 @@
 
 uint64_t
 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const {
-  uint64_t length = GetU32(offset_ptr);
-  m_is_dwarf64 = (length == UINT32_MAX);
-  if (m_is_dwarf64)
-length = GetU64(offset_ptr);
-  return length;
+  return GetU32(offset_ptr);
 }
 
 dw_offset_t
Index: source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -260,9 +260,7 @@
   lldb::offset_t offset = 0;
 
   uint64_t length = data.GetU32();
-  bool isDwarf64 = (length == 0x);
-  if (isDwarf64)
-length = data.GetU64();
+  // FIXME: Handle DWARF64.
   lldb::offset_t end = offset + length;
 
   // Check version.
@@ -279,7 +277,7 @@
 
   uint32_t offsetsAmount = data.GetU32();
   for (uint32_t i = 0; i < offsetsAmount; ++i)
-Offsets.push_back(data.GetMaxU64(, isDwarf64 ? 8 : 4));
+Offsets.push_back(data.GetMaxU64(, 4));
 
   lldb::offset_t listOffset = offset;
   std::vector rangeList;
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -59,8 +59,7 @@
   // parse
   const DWARFDataExtractor  = GetData();
   DWARFFormValue::FixedFormSizes fixed_form_sizes =
-  DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
-  IsDWARF64());
+  DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize());
   if (offset < GetNextCompileUnitOffset() &&
   m_first_die.FastExtract(data, this, fixed_form_sizes, )) {
 AddUnitDIE(m_first_die);
@@ -185,8 +184,7 @@
   die_index_stack.push_back(0);
   bool prev_die_had_children = false;
   DWARFFormValue::FixedFormSizes fixed_form_sizes =
-  DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
-  IsDWARF64());
+  DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize());
   while (offset < next_cu_offset &&
  

[Lldb-commits] [PATCH] D59165: Remove DWARFDIECollection

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355974: Remove DWARFDIECollection. (authored by zturner, 
committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D59165?vs=189961=190325#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59165

Files:
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -54,8 +54,7 @@
   ScopedExtractDIEs ExtractDIEsScoped();
 
   DWARFDIE LookupAddress(const dw_addr_t address);
-  size_t AppendDIEsWithTag(const dw_tag_t tag,
-   DWARFDIECollection _dies,
+  size_t AppendDIEsWithTag(const dw_tag_t tag, std::vector ,
uint32_t depth = UINT32_MAX) const;
   bool Verify(lldb_private::Stream *s) const;
   virtual void Dump(lldb_private::Stream *s) const = 0;
Index: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -18,7 +18,6 @@
 #include "lldb/Utility/Stream.h"
 
 #include "DWARFUnit.h"
-#include "DWARFDIECollection.h"
 #include "DWARFDebugAbbrev.h"
 #include "DWARFDebugAranges.h"
 #include "DWARFDebugInfo.h"
@@ -1381,11 +1380,11 @@
   }
 }
 
-void DWARFDebugInfoEntry::GetDeclContextDIEs(
-DWARFUnit *cu, DWARFDIECollection _context_dies) const {
+std::vector
+DWARFDebugInfoEntry::GetDeclContextDIEs(DWARFUnit *cu) const {
 
   DWARFDIE die(cu, const_cast(this));
-  die.GetDeclContextDIEs(decl_context_dies);
+  return die.GetDeclContextDIEs();
 }
 
 void DWARFDebugInfoEntry::GetDWARFDeclContext(
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -49,7 +49,6 @@
 class DWARFDebugLine;
 class DWARFDebugRangesBase;
 class DWARFDeclContext;
-class DWARFDIECollection;
 class DWARFFormValue;
 class SymbolFileDWARFDebugMap;
 class SymbolFileDWARFDwo;
Index: source/Plugins/SymbolFile/DWARF/CMakeLists.txt
===
--- source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -21,7 +21,6 @@
   DWARFDeclContext.cpp
   DWARFDefines.cpp
   DWARFDIE.cpp
-  DWARFDIECollection.cpp
   DWARFFormValue.cpp
   DWARFIndex.cpp
   DWARFUnit.cpp
Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -81,7 +81,7 @@
   //--
   // DeclContext related functions
   //--
-  void GetDeclContextDIEs(DWARFDIECollection _context_dies) const;
+  std::vector GetDeclContextDIEs() const;
 
   void GetDWARFDeclContext(DWARFDeclContext _decl_ctx) const;
 
Index: source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -230,8 +230,7 @@
 return HasChildren() ? this + 1 : NULL;
   }
 
-  void GetDeclContextDIEs(DWARFUnit *cu,
-  DWARFDIECollection _context_dies) const;
+  std::vector GetDeclContextDIEs(DWARFUnit *cu) const;
 
   void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDeclContext _decl_ctx) const;
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -17,7 +17,6 @@
 #include "lldb/Utility/StreamString.h"
 #include 

[Lldb-commits] [PATCH] D59164: [SymbolFileDWARF] Move ElaboratingDIEIterator into implementation file

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355973: Move ElaboratingDIEIterator into implementation 
file. (authored by zturner, committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D59164?vs=189959=190324#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59164

Files:
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDIE.h

Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -17,20 +17,75 @@
 
 using namespace lldb_private;
 
-void DWARFDIE::ElaboratingDIEIterator::Next() {
-  assert(!m_worklist.empty() && "Incrementing end iterator?");
+namespace {
 
-  // Pop the current item from the list.
-  DWARFDIE die = m_worklist.back();
-  m_worklist.pop_back();
-
-  // And add back any items that elaborate it.
-  for (dw_attr_t attr : {DW_AT_specification, DW_AT_abstract_origin}) {
-if (DWARFDIE d = die.GetReferencedDIE(attr))
-  if (m_seen.insert(die.GetID()).second)
-m_worklist.push_back(d);
+/// Iterate through all DIEs elaborating (i.e. reachable by a chain of
+/// DW_AT_specification and DW_AT_abstract_origin attributes) a given DIE. For
+/// convenience, the starting die is included in the sequence as the first
+/// item.
+class ElaboratingDIEIterator
+: public std::iterator {
+
+  // The operating invariant is: top of m_worklist contains the "current" item
+  // and the rest of the list are items yet to be visited. An empty worklist
+  // means we've reached the end.
+  // Infinite recursion is prevented by maintaining a list of seen DIEs.
+  // Container sizes are optimized for the case of following DW_AT_specification
+  // and DW_AT_abstract_origin just once.
+  llvm::SmallVector m_worklist;
+  llvm::SmallSet m_seen;
+
+  void Next() {
+assert(!m_worklist.empty() && "Incrementing end iterator?");
+
+// Pop the current item from the list.
+DWARFDIE die = m_worklist.back();
+m_worklist.pop_back();
+
+// And add back any items that elaborate it.
+for (dw_attr_t attr : {DW_AT_specification, DW_AT_abstract_origin}) {
+  if (DWARFDIE d = die.GetReferencedDIE(attr))
+if (m_seen.insert(die.GetID()).second)
+  m_worklist.push_back(d);
+}
+  }
+
+public:
+  /// An iterator starting at die d.
+  explicit ElaboratingDIEIterator(DWARFDIE d) : m_worklist(1, d) {}
+
+  /// End marker
+  ElaboratingDIEIterator() {}
+
+  const DWARFDIE *() const { return m_worklist.back(); }
+  ElaboratingDIEIterator ++() {
+Next();
+return *this;
+  }
+  ElaboratingDIEIterator operator++(int) {
+ElaboratingDIEIterator I = *this;
+Next();
+return I;
   }
+
+  friend bool operator==(const ElaboratingDIEIterator ,
+ const ElaboratingDIEIterator ) {
+if (a.m_worklist.empty() || b.m_worklist.empty())
+  return a.m_worklist.empty() == b.m_worklist.empty();
+return a.m_worklist.back() == b.m_worklist.back();
+  }
+  friend bool operator!=(const ElaboratingDIEIterator ,
+ const ElaboratingDIEIterator ) {
+return !(a == b);
+  }
+};
+
+llvm::iterator_range
+elaborating_dies(const DWARFDIE ) {
+  return llvm::make_range(ElaboratingDIEIterator(die),
+  ElaboratingDIEIterator());
 }
+} // namespace
 
 DWARFDIE
 DWARFDIE::GetParent() const {
@@ -229,7 +284,7 @@
 }
 
 bool DWARFDIE::IsMethod() const {
-  for (DWARFDIE d: elaborating_dies())
+  for (DWARFDIE d : elaborating_dies(*this))
 if (d.GetParent().IsStructUnionOrClass())
   return true;
   return false;
Index: source/Plugins/SymbolFile/DWARF/DWARFDIE.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -14,8 +14,6 @@
 
 class DWARFDIE : public DWARFBaseDIE {
 public:
-  class ElaboratingDIEIterator;
-
   using DWARFBaseDIE::DWARFBaseDIE;
 
   //--
@@ -33,8 +31,6 @@
   DWARFDIE
   GetContainingDWOModuleDIE() const;
 
-  inline llvm::iterator_range elaborating_dies() const;
-
   //--
   // Accessing information about a DIE
   //--
@@ -121,58 +117,4 @@
   lldb_private::CompilerDeclContext GetContainingDeclContext() const;
 };
 
-/// Iterate through all DIEs elaborating (i.e. reachable by a chain of
-/// DW_AT_specification and DW_AT_abstract_origin attributes) a given DIE. For
-/// convenience, the starting die is included in the sequence as the first
-/// item.
-class DWARFDIE::ElaboratingDIEIterator
-: public std::iterator {
-

[Lldb-commits] [lldb] r355975 - Remove support for DWARF64.

2019-03-12 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Mar 12 13:51:05 2019
New Revision: 355975

URL: http://llvm.org/viewvc/llvm-project?rev=355975=rev
Log:
Remove support for DWARF64.

LLVM doesn't produce DWARF64, and neither does GCC.  LLDB's support
for DWARF64 is only partial, and if enabled appears to also not work.
Finally, it's untested.  Removing this makes merging LLVM and
LLDB's DWARF parsing implementations simpler.

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

Modified:
lldb/trunk/include/lldb/Core/dwarf.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/include/lldb/Core/dwarf.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/dwarf.h?rev=355975=355974=355975=diff
==
--- lldb/trunk/include/lldb/Core/dwarf.h (original)
+++ lldb/trunk/include/lldb/Core/dwarf.h Tue Mar 12 13:51:05 2019
@@ -27,15 +27,8 @@ typedef uint64_t dw_addr_t; // Dwarf add
 // any addresses in the compile units that get
 // parsed
 
-#ifdef DWARFUTILS_DWARF64
-#define DWARF_REF_ADDR_SIZE 8
-typedef uint64_t dw_offset_t; // Dwarf Debug Information Entry offset for any
-  // offset into the file
-#else
-#define DWARF_REF_ADDR_SIZE 4
 typedef uint32_t dw_offset_t; // Dwarf Debug Information Entry offset for any
   // offset into the file
-#endif
 
 /* Constants */
 #define DW_INVALID_OFFSET (~(dw_offset_t)0)

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=355975=355974=355975=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Tue Mar 12 
13:51:05 2019
@@ -29,7 +29,6 @@ DWARFUnitSP DWARFCompileUnit::Extract(Sy
 dw_offset_t abbr_offset;
 const DWARFDebugAbbrev *abbr = dwarf2Data->DebugAbbrev();
 cu_sp->m_length = debug_info.GetDWARFInitialLength(offset_ptr);
-cu_sp->m_is_dwarf64 = debug_info.IsDWARF64();
 cu_sp->m_version = debug_info.GetU16(offset_ptr);
 
 if (cu_sp->m_version == 5) {
@@ -74,7 +73,7 @@ void DWARFCompileUnit::Dump(Stream *s) c
 
 uint32_t DWARFCompileUnit::GetHeaderByteSize() const {
   if (m_version < 5)
-return m_is_dwarf64 ? 23 : 11;
+return 11;
 
   switch (m_unit_type) {
   case llvm::dwarf::DW_UT_compile:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp?rev=355975=355974=355975=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp Tue Mar 
12 13:51:05 2019
@@ -12,11 +12,7 @@ namespace lldb_private {
 
 uint64_t
 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const {
-  uint64_t length = GetU32(offset_ptr);
-  m_is_dwarf64 = (length == UINT32_MAX);
-  if (m_is_dwarf64)
-length = GetU64(offset_ptr);
-  return length;
+  return GetU32(offset_ptr);
 }
 
 dw_offset_t

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h?rev=355975=355974=355975=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h Tue Mar 12 
13:51:05 2019
@@ -16,22 +16,18 @@ namespace lldb_private {
 
 class DWARFDataExtractor : public DataExtractor {
 public:
-  DWARFDataExtractor() : DataExtractor(), m_is_dwarf64(false) {}
+  DWARFDataExtractor() = default;
 
   DWARFDataExtractor(const DWARFDataExtractor , lldb::offset_t offset,
  lldb::offset_t length)
-  : DataExtractor(data, offset, length), m_is_dwarf64(false) {}
+  : DataExtractor(data, offset, length) {}
 
   uint64_t GetDWARFInitialLength(lldb::offset_t 

[Lldb-commits] [lldb] r355973 - Move ElaboratingDIEIterator into implementation file.

2019-03-12 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Mar 12 13:50:29 2019
New Revision: 355973

URL: http://llvm.org/viewvc/llvm-project?rev=355973=rev
Log:
Move ElaboratingDIEIterator into implementation file.

This is not used outside of the private implementation of the class,
so hiding in the implementation file is a nice way of simplifying
the external interface.

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp?rev=355973=355972=355973=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp Tue Mar 12 13:50:29 
2019
@@ -17,20 +17,75 @@
 
 using namespace lldb_private;
 
-void DWARFDIE::ElaboratingDIEIterator::Next() {
-  assert(!m_worklist.empty() && "Incrementing end iterator?");
+namespace {
 
-  // Pop the current item from the list.
-  DWARFDIE die = m_worklist.back();
-  m_worklist.pop_back();
-
-  // And add back any items that elaborate it.
-  for (dw_attr_t attr : {DW_AT_specification, DW_AT_abstract_origin}) {
-if (DWARFDIE d = die.GetReferencedDIE(attr))
-  if (m_seen.insert(die.GetID()).second)
-m_worklist.push_back(d);
+/// Iterate through all DIEs elaborating (i.e. reachable by a chain of
+/// DW_AT_specification and DW_AT_abstract_origin attributes) a given DIE. For
+/// convenience, the starting die is included in the sequence as the first
+/// item.
+class ElaboratingDIEIterator
+: public std::iterator {
+
+  // The operating invariant is: top of m_worklist contains the "current" item
+  // and the rest of the list are items yet to be visited. An empty worklist
+  // means we've reached the end.
+  // Infinite recursion is prevented by maintaining a list of seen DIEs.
+  // Container sizes are optimized for the case of following 
DW_AT_specification
+  // and DW_AT_abstract_origin just once.
+  llvm::SmallVector m_worklist;
+  llvm::SmallSet m_seen;
+
+  void Next() {
+assert(!m_worklist.empty() && "Incrementing end iterator?");
+
+// Pop the current item from the list.
+DWARFDIE die = m_worklist.back();
+m_worklist.pop_back();
+
+// And add back any items that elaborate it.
+for (dw_attr_t attr : {DW_AT_specification, DW_AT_abstract_origin}) {
+  if (DWARFDIE d = die.GetReferencedDIE(attr))
+if (m_seen.insert(die.GetID()).second)
+  m_worklist.push_back(d);
+}
+  }
+
+public:
+  /// An iterator starting at die d.
+  explicit ElaboratingDIEIterator(DWARFDIE d) : m_worklist(1, d) {}
+
+  /// End marker
+  ElaboratingDIEIterator() {}
+
+  const DWARFDIE *() const { return m_worklist.back(); }
+  ElaboratingDIEIterator ++() {
+Next();
+return *this;
+  }
+  ElaboratingDIEIterator operator++(int) {
+ElaboratingDIEIterator I = *this;
+Next();
+return I;
   }
+
+  friend bool operator==(const ElaboratingDIEIterator ,
+ const ElaboratingDIEIterator ) {
+if (a.m_worklist.empty() || b.m_worklist.empty())
+  return a.m_worklist.empty() == b.m_worklist.empty();
+return a.m_worklist.back() == b.m_worklist.back();
+  }
+  friend bool operator!=(const ElaboratingDIEIterator ,
+ const ElaboratingDIEIterator ) {
+return !(a == b);
+  }
+};
+
+llvm::iterator_range
+elaborating_dies(const DWARFDIE ) {
+  return llvm::make_range(ElaboratingDIEIterator(die),
+  ElaboratingDIEIterator());
 }
+} // namespace
 
 DWARFDIE
 DWARFDIE::GetParent() const {
@@ -229,7 +284,7 @@ bool DWARFDIE::IsStructUnionOrClass() co
 }
 
 bool DWARFDIE::IsMethod() const {
-  for (DWARFDIE d: elaborating_dies())
+  for (DWARFDIE d : elaborating_dies(*this))
 if (d.GetParent().IsStructUnionOrClass())
   return true;
   return false;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h?rev=355973=355972=355973=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h Tue Mar 12 13:50:29 
2019
@@ -14,8 +14,6 @@
 
 class DWARFDIE : public DWARFBaseDIE {
 public:
-  class ElaboratingDIEIterator;
-
   using DWARFBaseDIE::DWARFBaseDIE;
 
   //--
@@ -33,8 +31,6 @@ public:
   DWARFDIE
   GetContainingDWOModuleDIE() const;
 
-  inline llvm::iterator_range elaborating_dies() const;
-
   //--
   // Accessing information about a DIE
   

[Lldb-commits] [lldb] r355974 - Remove DWARFDIECollection.

2019-03-12 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Mar 12 13:50:46 2019
New Revision: 355974

URL: http://llvm.org/viewvc/llvm-project?rev=355974=rev
Log:
Remove DWARFDIECollection.

This is a very thin wrapper over a std::vector and does
not seem to provide any real value over just using a container
directly.

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

Removed:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt?rev=355974=355973=355974=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt Tue Mar 12 
13:50:46 2019
@@ -21,7 +21,6 @@ add_lldb_library(lldbPluginSymbolFileDWA
   DWARFDeclContext.cpp
   DWARFDefines.cpp
   DWARFDIE.cpp
-  DWARFDIECollection.cpp
   DWARFFormValue.cpp
   DWARFIndex.cpp
   DWARFUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=355974=355973=355974=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Tue Mar 
12 13:50:46 2019
@@ -10,7 +10,6 @@
 
 #include "DWARFASTParserClang.h"
 #include "DWARFDIE.h"
-#include "DWARFDIECollection.h"
 #include "DWARFDebugInfo.h"
 #include "DWARFDeclContext.h"
 #include "DWARFDefines.h"
@@ -1393,7 +1392,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 DIERef(class_type->GetID(), dwarf));
   }
   if (class_type_die) {
-DWARFDIECollection failures;
+std::vector failures;
 
 CopyUniqueClassMethodTypes(decl_ctx_die, class_type_die,
class_type, failures);
@@ -2194,7 +2193,7 @@ bool DWARFASTParserClang::CompleteTypeFr
 std::vector member_accessibilities;
 bool is_a_class = false;
 // Parse members and base classes first
-DWARFDIECollection member_function_dies;
+std::vector member_function_dies;
 
 DelayedPropertyList delayed_properties;
 ParseChildMembers(sc, die, clang_type, class_language, bases,
@@ -2203,12 +2202,8 @@ bool DWARFASTParserClang::CompleteTypeFr
   layout_info);
 
 // Now parse any methods if there were any...
-size_t num_functions = member_function_dies.Size();
-if (num_functions > 0) {
-  for (size_t i = 0; i < num_functions; ++i) {
-dwarf->ResolveType(member_function_dies.GetDIEAtIndex(i));
-  }
-}
+for (const DWARFDIE  : member_function_dies)
+  dwarf->ResolveType(die);
 
 if (class_language == eLanguageTypeObjC) {
   ConstString class_name(clang_type.GetTypeName());
@@ -2677,7 +2672,7 @@ bool DWARFASTParserClang::ParseChildMemb
 CompilerType _clang_type, const LanguageType class_language,
 std::vector> _classes,
 std::vector _accessibilities,
-DWARFDIECollection _function_dies,
+std::vector _function_dies,
 DelayedPropertyList _properties, AccessType _accessibility,
 bool _a_class, ClangASTImporter::LayoutInfo _info) {
   if (!parent_die)
@@ -3176,7 +3171,7 @@ bool DWARFASTParserClang::ParseChildMemb
 
 case DW_TAG_subprogram:
   // Let the type parsing code handle this one for us.
-  member_function_dies.Append(die);
+  member_function_dies.push_back(die);
   break;
 
 case DW_TAG_inheritance: {
@@ -3872,7 +3867,7 @@ void DWARFASTParserClang::LinkDeclContex
 
 bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
 const DWARFDIE _class_die, const DWARFDIE _class_die,
-lldb_private::Type *class_type, DWARFDIECollection ) {
+lldb_private::Type 

[Lldb-commits] [PATCH] D59159: [third-party] Update pexpect to 4.6.

2019-03-12 Thread Davide Italiano via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Revision".
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355967: [third-party] Update pexpect to 4.6. (authored by 
davide, committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D59159?vs=189940=190322#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59159

Files:
  third_party/Python/module/pexpect-2.4/ANSI.py
  third_party/Python/module/pexpect-2.4/FSM.py
  third_party/Python/module/pexpect-2.4/INSTALL
  third_party/Python/module/pexpect-2.4/LICENSE
  third_party/Python/module/pexpect-2.4/PKG-INFO
  third_party/Python/module/pexpect-2.4/README
  third_party/Python/module/pexpect-2.4/doc/clean.css
  third_party/Python/module/pexpect-2.4/doc/email.png
  third_party/Python/module/pexpect-2.4/doc/examples.html
  third_party/Python/module/pexpect-2.4/doc/index.html
  third_party/Python/module/pexpect-2.4/doc/index.template.html
  third_party/Python/module/pexpect-2.4/examples/README
  third_party/Python/module/pexpect-2.4/examples/astat.py
  third_party/Python/module/pexpect-2.4/examples/bd_client.py
  third_party/Python/module/pexpect-2.4/examples/bd_serv.py
  third_party/Python/module/pexpect-2.4/examples/cgishell.cgi
  third_party/Python/module/pexpect-2.4/examples/chess.py
  third_party/Python/module/pexpect-2.4/examples/chess2.py
  third_party/Python/module/pexpect-2.4/examples/chess3.py
  third_party/Python/module/pexpect-2.4/examples/df.py
  third_party/Python/module/pexpect-2.4/examples/fix_cvs_files.py
  third_party/Python/module/pexpect-2.4/examples/ftp.py
  third_party/Python/module/pexpect-2.4/examples/hive.py
  third_party/Python/module/pexpect-2.4/examples/monitor.py
  third_party/Python/module/pexpect-2.4/examples/passmass.py
  third_party/Python/module/pexpect-2.4/examples/python.py
  third_party/Python/module/pexpect-2.4/examples/rippy.py
  third_party/Python/module/pexpect-2.4/examples/script.py
  third_party/Python/module/pexpect-2.4/examples/ssh_session.py
  third_party/Python/module/pexpect-2.4/examples/ssh_tunnel.py
  third_party/Python/module/pexpect-2.4/examples/sshls.py
  third_party/Python/module/pexpect-2.4/examples/table_test.html
  third_party/Python/module/pexpect-2.4/examples/topip.py
  third_party/Python/module/pexpect-2.4/examples/uptime.py
  third_party/Python/module/pexpect-2.4/fdpexpect.py
  third_party/Python/module/pexpect-2.4/pexpect.py
  third_party/Python/module/pexpect-2.4/pxssh.py
  third_party/Python/module/pexpect-2.4/screen.py
  third_party/Python/module/pexpect-2.4/setup.py
  third_party/Python/module/pexpect-4.6/.gitignore
  third_party/Python/module/pexpect-4.6/.travis.yml
  third_party/Python/module/pexpect-4.6/DEVELOPERS.rst
  third_party/Python/module/pexpect-4.6/LICENSE
  third_party/Python/module/pexpect-4.6/MANIFEST.in
  third_party/Python/module/pexpect-4.6/README.rst
  third_party/Python/module/pexpect-4.6/doc/FAQ.rst
  third_party/Python/module/pexpect-4.6/doc/Makefile
  third_party/Python/module/pexpect-4.6/doc/api/fdpexpect.rst
  third_party/Python/module/pexpect-4.6/doc/api/index.rst
  third_party/Python/module/pexpect-4.6/doc/api/pexpect.rst
  third_party/Python/module/pexpect-4.6/doc/api/popen_spawn.rst
  third_party/Python/module/pexpect-4.6/doc/api/pxssh.rst
  third_party/Python/module/pexpect-4.6/doc/api/replwrap.rst
  third_party/Python/module/pexpect-4.6/doc/clean.css
  third_party/Python/module/pexpect-4.6/doc/commonissues.rst
  third_party/Python/module/pexpect-4.6/doc/conf.py
  third_party/Python/module/pexpect-4.6/doc/examples.rst
  third_party/Python/module/pexpect-4.6/doc/history.rst
  third_party/Python/module/pexpect-4.6/doc/index.rst
  third_party/Python/module/pexpect-4.6/doc/install.rst
  third_party/Python/module/pexpect-4.6/doc/make.bat
  third_party/Python/module/pexpect-4.6/doc/overview.rst
  third_party/Python/module/pexpect-4.6/doc/requirements.txt
  third_party/Python/module/pexpect-4.6/doc/sphinxext/github.py
  third_party/Python/module/pexpect-4.6/examples/README
  third_party/Python/module/pexpect-4.6/examples/astat.py
  third_party/Python/module/pexpect-4.6/examples/cgishell.cgi
  third_party/Python/module/pexpect-4.6/examples/chess.py
  third_party/Python/module/pexpect-4.6/examples/chess2.py
  third_party/Python/module/pexpect-4.6/examples/chess3.py
  third_party/Python/module/pexpect-4.6/examples/df.py
  third_party/Python/module/pexpect-4.6/examples/ftp.py
  third_party/Python/module/pexpect-4.6/examples/hive.py
  third_party/Python/module/pexpect-4.6/examples/monitor.py
  third_party/Python/module/pexpect-4.6/examples/passmass.py
  third_party/Python/module/pexpect-4.6/examples/python.py
  third_party/Python/module/pexpect-4.6/examples/script.py
  third_party/Python/module/pexpect-4.6/examples/ssh_tunnel.py
  third_party/Python/module/pexpect-4.6/examples/table_test.html
  

[Lldb-commits] [lldb] r355969 - [lldb/thirdparty] Remove unneeded files, asked by Jonas.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 13:41:36 2019
New Revision: 355969

URL: http://llvm.org/viewvc/llvm-project?rev=355969=rev
Log:
[lldb/thirdparty] Remove unneeded files, asked by Jonas.

Removed:
lldb/trunk/third_party/Python/module/pexpect-4.6/doc/
lldb/trunk/third_party/Python/module/pexpect-4.6/examples/
lldb/trunk/third_party/Python/module/pexpect-4.6/notes/
lldb/trunk/third_party/Python/module/pexpect-4.6/tests/
lldb/trunk/third_party/Python/module/pexpect-4.6/tools/
lldb/trunk/third_party/Python/module/ptyprocess-0.6.0/docs/
lldb/trunk/third_party/Python/module/ptyprocess-0.6.0/tests/

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


[Lldb-commits] [lldb] r355968 - [lldb-mi] Make this test more reliable. NFC.

2019-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Mar 12 13:41:29 2019
New Revision: 355968

URL: http://llvm.org/viewvc/llvm-project?rev=355968=rev
Log:
[lldb-mi] Make this test more reliable. NFC.

Except that it will probably stop failing on and off on my machine.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py?rev=355968=355967=355968=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py 
Tue Mar 12 13:41:29 2019
@@ -50,6 +50,12 @@ class MiSignalTestCase(lldbmi_testcase.M
 self.runCmd("-exec-continue")
 self.expect("\^running")
 
+# There's a chance that lldb didn't resume the process, we send an 
interruput but
+# the process is not running yet. Give it some time to restart. 5 
seconds ought to
+# be enough for every modern CPU out there.
+import time
+time.sleep(5)
+
 # Test that Ctrl+C can interrupt an execution
 self.child.sendintr()  # FIXME: here uses self.child directly
 self.expect(


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


Re: [Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Eric Christopher via lldb-commits
Yep yep yep.

On Tue, Mar 12, 2019 at 1:24 PM Adrian Prantl via Phabricator
 wrote:
>
> aprantl added a comment.
>
> In D59235#1426716 , @JDevlieghere 
> wrote:
>
> > Agreed, and we've been doing this for new patches for a while now. However, 
> > I very strongly prefer having asserts over "returning a default value", 
> > which only hides real bugs.
>
>
> I think everyone is on the same page here, but it doesn't hurt to explicitly 
> repeat this  :-)
>
> - Assertions should be used liberally to assert internal consistency and to 
> enforce contracts in the API. Basically when you write an assertion, you 
> should be already convinced that it will always hold.
> - Assertions may never be used to handle invalid external input in a parser. 
> Invalid external input must use error handling, expected, optional, ...
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D59235/new/
>
> https://reviews.llvm.org/D59235
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

In D59235#1426716 , @JDevlieghere 
wrote:

> Agreed, and we've been doing this for new patches for a while now. However, I 
> very strongly prefer having asserts over "returning a default value", which 
> only hides real bugs.


I think everyone is on the same page here, but it doesn't hurt to explicitly 
repeat this  :-)

- Assertions should be used liberally to assert internal consistency and to 
enforce contracts in the API. Basically when you write an assertion, you should 
be already convinced that it will always hold.
- Assertions may never be used to handle invalid external input in a parser. 
Invalid external input must use error handling, expected, optional, ...


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [lldb] r355963 - Fix compiler warning

2019-03-12 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Mar 12 13:24:13 2019
New Revision: 355963

URL: http://llvm.org/viewvc/llvm-project?rev=355963=rev
Log:
Fix compiler warning

Fixes warning: comparison of integers of different signs.

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=355963=355962=355963=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Tue Mar 12 13:24:13 2019
@@ -241,8 +241,7 @@ DynamicLoaderDarwinKernel::SearchForKern
   0xff802010ULL, // oldest arm64 devices
   LLDB_INVALID_ADDRESS};
   addr_t kernel_addresses_32[] = {0x0110, // 2016 and earlier armv7 devices
-  0x1010, 
-  LLDB_INVALID_ADDRESS};
+  0x1010, LLDB_INVALID_ADDRESS};
 
   uint8_t uval[8];
   if (process->GetAddressByteSize() == 8) {
@@ -1043,7 +1042,7 @@ void DynamicLoaderDarwinKernel::LoadKern
 m_kernel.LoadImageAtFileAddress(m_process);
   }
 }
-
+
 // The operating system plugin gets loaded and initialized in
 // LoadImageUsingMemoryModule when we discover the kernel dSYM.  For a core
 // file in particular, that's the wrong place to do this, since  we haven't
@@ -1245,9 +1244,9 @@ bool DynamicLoaderDarwinKernel::ParseKex
 // If this "kext" entry is actually an alias for the kernel -- the kext was
 // compiled into the kernel or something -- then we don't want to load the
 // kernel's text section at a different address.  Ignore this kext entry.
-if (kext_summaries[new_kext].GetUUID().IsValid() 
-&& m_kernel.GetUUID().IsValid() 
-&& kext_summaries[new_kext].GetUUID() == m_kernel.GetUUID()) {
+if (kext_summaries[new_kext].GetUUID().IsValid() &&
+m_kernel.GetUUID().IsValid() &&
+kext_summaries[new_kext].GetUUID() == m_kernel.GetUUID()) {
   to_be_added[new_kext] = false;
   break;
 }
@@ -1301,10 +1300,9 @@ bool DynamicLoaderDarwinKernel::ParseKex
 bool kext_successfully_added = true;
 if (load_kexts) {
   if (!image_info.LoadImageUsingMemoryModule(m_process)) {
-kexts_failed_to_load.push_back(
- std::pair(
- kext_summaries[new_kext].GetName(), 
- kext_summaries[new_kext].GetUUID()));
+kexts_failed_to_load.push_back(std::pair(
+kext_summaries[new_kext].GetName(),
+kext_summaries[new_kext].GetUUID()));
 image_info.LoadImageAtFileAddress(m_process);
 kext_successfully_added = false;
   }
@@ -1357,11 +1355,11 @@ bool DynamicLoaderDarwinKernel::ParseKex
   if (s && load_kexts) {
 s->Printf(" done.\n");
 if (kexts_failed_to_load.size() > 0 && number_of_new_kexts_being_added > 
0) {
-  s->Printf("Failed to load %d of %d kexts:\n", 
-(int) kexts_failed_to_load.size(),
+  s->Printf("Failed to load %d of %d kexts:\n",
+(int)kexts_failed_to_load.size(),
 number_of_new_kexts_being_added);
   // print a sorted list of  kexts which failed to load
-  int longest_name = 0;
+  unsigned longest_name = 0;
   std::sort(kexts_failed_to_load.begin(), kexts_failed_to_load.end());
   for (const auto  : kexts_failed_to_load) {
 if (ku.first.size() > longest_name)


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


Re: [Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Zachary Turner via lldb-commits
+1. I’ve seen some of the changes in llvm that have changed asserts to
return a default value. IMHO these should be changed to return Expected
instead
On Tue, Mar 12, 2019 at 1:16 PM Jonas Devlieghere via Phabricator <
revi...@reviews.llvm.org> wrote:

> JDevlieghere added a comment.
>
> In D59235#1426169 , @probinson
> wrote:
>
> > In D59235#1425443 , @zturner
> wrote:
> >
> > > In D59235#1425436 ,
> @clayborg wrote:
> > >
> > > > My main concern with the LLVM DWARF parser is all of the asserts in
> the code. If you attempt to use a DWARFDIE without first checking it for
> validity, it will crash on you instead of returning a good error or default
> value. That makes me really nervous as we shouldn't just crash the
> debugger. The switching over won't be too hard, just the fallout from the
> LLDB versions of the class that do error checking and return good
> error/default values and LLVM being very strict.
> > >
> > >
> > > Sure, I'm prepared to deal all that appropriately.  I don't plan to
> regress LLDB's stability in the process.
> > >
> > > That's why for now I'm just doing very small preliminary steps to get
> the two interfaces to be closer to each other and simplify the problem
> space.  We can worry about the asserts and all of that when we actually
> start moving pieces of LLDB to use LLVM's classes (which isn't in this
> patch).
> >
> >
> > A long term plan of moving LLVM's parser away from asserts and toward
> error reporting on bad input would also make the binutils that try to read
> DWARF more robust and useful for trying to diagnose bad object files.  I'm
> all for it.
>
>
> Agreed, and we've been doing this for new patches for a while now.
> However, I very strongly prefer having asserts over "returning a default
> value", which only hides real bugs.
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D59235/new/
>
> https://reviews.llvm.org/D59235
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D59235#1426169 , @probinson wrote:

> In D59235#1425443 , @zturner wrote:
>
> > In D59235#1425436 , @clayborg 
> > wrote:
> >
> > > My main concern with the LLVM DWARF parser is all of the asserts in the 
> > > code. If you attempt to use a DWARFDIE without first checking it for 
> > > validity, it will crash on you instead of returning a good error or 
> > > default value. That makes me really nervous as we shouldn't just crash 
> > > the debugger. The switching over won't be too hard, just the fallout from 
> > > the LLDB versions of the class that do error checking and return good 
> > > error/default values and LLVM being very strict.
> >
> >
> > Sure, I'm prepared to deal all that appropriately.  I don't plan to regress 
> > LLDB's stability in the process.
> >
> > That's why for now I'm just doing very small preliminary steps to get the 
> > two interfaces to be closer to each other and simplify the problem space.  
> > We can worry about the asserts and all of that when we actually start 
> > moving pieces of LLDB to use LLVM's classes (which isn't in this patch).
>
>
> A long term plan of moving LLVM's parser away from asserts and toward error 
> reporting on bad input would also make the binutils that try to read DWARF 
> more robust and useful for trying to diagnose bad object files.  I'm all for 
> it.


Agreed, and we've been doing this for new patches for a while now. However, I 
very strongly prefer having asserts over "returning a default value", which 
only hides real bugs.


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [lldb] r355958 - Rework how lldb warngs about kexts that failed to load in a

2019-03-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Mar 12 12:42:34 2019
New Revision: 355958

URL: http://llvm.org/viewvc/llvm-project?rev=355958=rev
Log:
Rework how lldb warngs about kexts that failed to load in a 
darwin kernel debug session.

Originally, the kext name & uuid were emitted in the middle of the
kext-loading period's.  Last week I decided to try not printing
any details about kexts that failed to load, only printing a summary
of how many failed to load.  

This time I'm print different progress characters depending on whether
the kext loaded or not ("-" for not), then at the end I will print a 
summary of how many kexts failed to load and a sorted list of the
kexts with the bundle ID and the uuid.  It's a lot more readable.

 


Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=355958=355957=355958=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Tue Mar 12 12:42:34 2019
@@ -32,6 +32,7 @@
 #include "DynamicLoaderDarwinKernel.h"
 
 #include 
+#include 
 
 //#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN
 #ifdef ENABLE_DEBUG_PRINTF
@@ -1288,7 +1289,8 @@ bool DynamicLoaderDarwinKernel::ParseKex
 }
   }
 
-  int failed_to_load_kexts = 0;
+  // Build up a list of  for any kexts that fail to load
+  std::vector> kexts_failed_to_load;
   if (number_of_new_kexts_being_added > 0) {
 ModuleList loaded_module_list;
 
@@ -1296,10 +1298,15 @@ bool DynamicLoaderDarwinKernel::ParseKex
 for (uint32_t new_kext = 0; new_kext < num_of_new_kexts; new_kext++) {
   if (to_be_added[new_kext]) {
 KextImageInfo _info = kext_summaries[new_kext];
+bool kext_successfully_added = true;
 if (load_kexts) {
   if (!image_info.LoadImageUsingMemoryModule(m_process)) {
-failed_to_load_kexts++;
+kexts_failed_to_load.push_back(
+ std::pair(
+ kext_summaries[new_kext].GetName(), 
+ kext_summaries[new_kext].GetUUID()));
 image_info.LoadImageAtFileAddress(m_process);
+kext_successfully_added = false;
   }
 }
 
@@ -1309,8 +1316,12 @@ bool DynamicLoaderDarwinKernel::ParseKex
 m_process->GetStopID() == image_info.GetProcessStopId())
   loaded_module_list.AppendIfNeeded(image_info.GetModule());
 
-if (s && load_kexts)
-  s->Printf(".");
+if (s && load_kexts) {
+  if (kext_successfully_added)
+s->Printf(".");
+  else
+s->Printf("-");
+}
 
 if (log)
   kext_summaries[new_kext].PutToLog(log);
@@ -1344,11 +1355,25 @@ bool DynamicLoaderDarwinKernel::ParseKex
   }
 
   if (s && load_kexts) {
-s->Printf(" done.");
-if (failed_to_load_kexts > 0 && number_of_new_kexts_being_added > 0)
-  s->Printf("  Failed to load %d of %d kexts.", failed_to_load_kexts,
+s->Printf(" done.\n");
+if (kexts_failed_to_load.size() > 0 && number_of_new_kexts_being_added > 
0) {
+  s->Printf("Failed to load %d of %d kexts:\n", 
+(int) kexts_failed_to_load.size(),
 number_of_new_kexts_being_added);
-s->Printf("\n");
+  // print a sorted list of  kexts which failed to load
+  int longest_name = 0;
+  std::sort(kexts_failed_to_load.begin(), kexts_failed_to_load.end());
+  for (const auto  : kexts_failed_to_load) {
+if (ku.first.size() > longest_name)
+  longest_name = ku.first.size();
+  }
+  for (const auto  : kexts_failed_to_load) {
+std::string uuid;
+if (ku.second.IsValid())
+  uuid = ku.second.GetAsString();
+s->Printf (" %-*s %s\n", longest_name, ku.first.c_str(), uuid.c_str());
+  }
+}
 s->Flush();
   }
 


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


[Lldb-commits] [lldb] r355957 - Check the result of creating a node from __next_ in the std::list formatter.

2019-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Mar 12 12:27:39 2019
New Revision: 355957

URL: http://llvm.org/viewvc/llvm-project?rev=355957=rev
Log:
Check the result of creating a node from __next_ in the std::list formatter.

There's a single report of a crash coming from this current_sp being NULL.  I 
don't
have a repro case, and I couldn't get it to happen by hand-corrupting a list.  
We
always get an error instead.  So I don't have a test case.  But checking for 
null
is clearly right here.



Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp?rev=355957=355956=355957=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp Tue Mar 12 
12:27:39 2019
@@ -384,7 +384,7 @@ lldb::ValueObjectSP ListFrontEnd::GetChi
   if (current_sp->GetName() == g_next) {
 ProcessSP process_sp(current_sp->GetProcessSP());
 if (!process_sp)
-  return nullptr;
+  return lldb::ValueObjectSP();
 
 // if we grabbed the __next_ pointer, then the child is one pointer deep-er
 lldb::addr_t addr = current_sp->GetParent()->GetPointerValue();
@@ -392,6 +392,8 @@ lldb::ValueObjectSP ListFrontEnd::GetChi
 ExecutionContext exe_ctx(process_sp);
 current_sp =
 CreateValueObjectFromAddress("__value_", addr, exe_ctx, 
m_element_type);
+if (!current_sp)
+  return lldb::ValueObjectSP();
   }
 
   // we need to copy current_sp into a new object otherwise we will end up with


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


[Lldb-commits] [lldb] r355956 - Re-enable this test, the underlying bug was fixed and the test now passes.

2019-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Mar 12 12:25:29 2019
New Revision: 355956

URL: http://llvm.org/viewvc/llvm-project?rev=355956=rev
Log:
Re-enable this test, the underlying bug was fixed and the test now passes.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py?rev=355956=355955=355956=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
 Tue Mar 12 12:25:29 2019
@@ -22,7 +22,6 @@ class LibcxxListDataFormatterTestCase(Te
 
 @add_test_categories(["libc++"])
 @expectedFailureAndroid(bugnumber="llvm.org/pr32592")
-@skipIfDarwin  # rdar://25499635
 def test_with_run_command(self):
 self.build()
 exe = self.getBuildArtifact("a.out")


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


[Lldb-commits] [lldb] r355951 - Fix the project for r355939 (ASTUtils.{h, c})

2019-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Mar 12 11:48:58 2019
New Revision: 355951

URL: http://llvm.org/viewvc/llvm-project?rev=355951=rev
Log:
Fix the project for r355939 (ASTUtils.{h,c})

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=355951=355950=355951=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Mar 12 11:48:58 2019
@@ -94,6 +94,7 @@
2689006713353E0E00698AC0 /* ASTDumper.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 4906FD4012F2255300A2A77C /* ASTDumper.cpp */; };
2689006813353E0E00698AC0 /* ASTResultSynthesizer.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49A8A39F11D568A300AD3B68 /* 
ASTResultSynthesizer.cpp */; };
2689006913353E0E00698AC0 /* ASTStructExtractor.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 491193501226386000578B7F /* 
ASTStructExtractor.cpp */; };
+   4C0B95802238342C0026C840 /* ASTUtils.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 4C0B957E2238342C0026C840 /* ASTUtils.cpp */; };
8CF02AEA19DCC02100B14BE0 /* ASanRuntime.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */; 
};
257906641BD5AFD000178368 /* Acceptor.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 257906621BD5AFD000178368 /* Acceptor.cpp */; };
257906651BD5AFD000178368 /* Acceptor.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 257906631BD5AFD000178368 /* Acceptor.h */; };
@@ -1427,6 +1428,8 @@
49A8A3A311D568BF00AD3B68 /* ASTResultSynthesizer.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ASTResultSynthesizer.h; path = ExpressionParser/Clang/ASTResultSynthesizer.h; 
sourceTree = ""; };
491193501226386000578B7F /* ASTStructExtractor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ASTStructExtractor.cpp; path = 
ExpressionParser/Clang/ASTStructExtractor.cpp; sourceTree = ""; };
4911934B1226383D00578B7F /* ASTStructExtractor.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ASTStructExtractor.h; path = ExpressionParser/Clang/ASTStructExtractor.h; 
sourceTree = ""; };
+   4C0B957E2238342C0026C840 /* ASTUtils.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ASTUtils.cpp; path = ExpressionParser/Clang/ASTUtils.cpp; sourceTree = 
""; };
+   4C0B957F2238342C0026C840 /* ASTUtils.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ASTUtils.h; path = ExpressionParser/Clang/ASTUtils.h; sourceTree = ""; };
8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = ASanRuntime.cpp; sourceTree = ""; };
8CF02AE619DCBF8400B14BE0 /* ASanRuntime.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
ASanRuntime.h; sourceTree = ""; };
257906621BD5AFD000178368 /* Acceptor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = Acceptor.cpp; path = "tools/lldb-server/Acceptor.cpp"; sourceTree = 
""; };
@@ -6252,6 +6255,8 @@
49A8A39F11D568A300AD3B68 /* 
ASTResultSynthesizer.cpp */,
4911934B1226383D00578B7F /* 
ASTStructExtractor.h */,
491193501226386000578B7F /* 
ASTStructExtractor.cpp */,
+   4C0B957E2238342C0026C840 /* ASTUtils.cpp */,
+   4C0B957F2238342C0026C840 /* ASTUtils.h */,
49307AB111DEA4F20081F992 /* IRForTarget.h */,
49307AAD11DEA4D90081F992 /* IRForTarget.cpp */,
4984BA0F1B978C3E008658D4 /* 
ClangExpressionVariable.h */,
@@ -8084,6 +8089,7 @@
236124A51986B4E2004EFC37 /* Socket.cpp in 
Sources */,
3FDFDDBF199D345E009756A7 /* FileCache.cpp in 
Sources */,
AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp 
in Sources */,
+   4C0B95802238342C0026C840 /* ASTUtils.cpp in 
Sources */,
AF77E0A11A033D360096C0EA /* 
RegisterContextFreeBSD_powerpc.cpp in Sources */,
26764CA01E48F528008D3573 /* 
RegularExpression.cpp in Sources */,
2689003B13353E0400698AC0 /* 
EmulateInstruction.cpp in Sources */,



[Lldb-commits] [lldb] r355943 - Correcting some comments in PdbIndex.cpp [NFC]

2019-03-12 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Tue Mar 12 10:40:51 2019
New Revision: 355943

URL: http://llvm.org/viewvc/llvm-project?rev=355943=rev
Log:
Correcting some comments in PdbIndex.cpp [NFC]

ICF can cause multiple symbols to start at the same virtual address.
I plan to handle this shortly, but I wanted to correct the comment for
now.

Deleted an obsolete comment about adjusting the offset for the magic
number at the beginning of the debug info stream.  This adjustment is
handled at a lower level now.

Modified:
lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp?rev=355943=355942=355943=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp Tue Mar 12 
10:40:51 2019
@@ -132,9 +132,8 @@ void PdbIndex::BuildAddrToSymbolMap(Comp
 
 PdbCompilandSymId cu_sym_id(modi, iter.offset());
 
-// If the debug info is incorrect, we could have multiple symbols with the
-// same address.  So use try_emplace instead of insert, and the first one
-// will win.
+// It's rare, but we could have multiple symbols with the same address
+// because of identical comdat folding.  Right now, the first one will win.
 cci.m_symbols_by_va.insert(std::make_pair(va, PdbSymUid(cu_sym_id)));
   }
 }
@@ -186,8 +185,6 @@ std::vector PdbIndex::Find
 }
 
 CVSymbol PdbIndex::ReadSymbolRecord(PdbCompilandSymId cu_sym) const {
-  // We need to subtract 4 here to adjust for the codeview debug magic
-  // at the beginning of the debug info stream.
   const CompilandIndexItem *cci = compilands().GetCompiland(cu_sym.modi);
   auto iter = cci->m_debug_stream.getSymbolArray().at(cu_sym.offset);
   lldbassert(iter != cci->m_debug_stream.getSymbolArray().end());


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


Re: [Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Zachary Turner via lldb-commits
Fair enough, a FIXME sounds reasonable.

On Tue, Mar 12, 2019 at 10:33 AM Jan Kratochvil via Phabricator <
revi...@reviews.llvm.org> wrote:

> jankratochvil added inline comments.
>
>
> 
> Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp:263
>uint64_t length = data.GetU32();
> -  bool isDwarf64 = (length == 0x);
> -  if (isDwarf64)
> 
> zturner wrote:
> > jankratochvil wrote:
> > > Here should be an error that DWARF64 is not supported.
> > How do we report that error?  This function doesn't return an error
> code, and neither does the function that calls it (I didn't look higher
> than that), and we don't build with exceptions.  We can assert, but we try
> to avoid asserts (although admittedly, we're going to crash anyway).  I can
> try to do more work to propagate errors up the stack, but at this point
> this whole file (and even most of the folder that the file is in) is in
> theory going to be going away soon as we converge on LLVM's DWARF parser,
> so it may make sense to just deal with the problem at that level.
> Just that there should be something, at least a FIXME comment.
> There is `dwarf2Data->GetObjectFile()->GetModule()->ReportError()` but it
> will currently lock up since implementation of multithreaded DWARF reading.
> But there are AFAIK already many such errors which do not happen in
> realworld but they would lock up if they did. I agree returning an error
> value is the proper solution, I have no idea when it is the right time to
> implement that.
>
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D59235/new/
>
> https://reviews.llvm.org/D59235
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp:263
   uint64_t length = data.GetU32();
-  bool isDwarf64 = (length == 0x);
-  if (isDwarf64)

zturner wrote:
> jankratochvil wrote:
> > Here should be an error that DWARF64 is not supported.
> How do we report that error?  This function doesn't return an error code, and 
> neither does the function that calls it (I didn't look higher than that), and 
> we don't build with exceptions.  We can assert, but we try to avoid asserts 
> (although admittedly, we're going to crash anyway).  I can try to do more 
> work to propagate errors up the stack, but at this point this whole file (and 
> even most of the folder that the file is in) is in theory going to be going 
> away soon as we converge on LLVM's DWARF parser, so it may make sense to just 
> deal with the problem at that level.
Just that there should be something, at least a FIXME comment.
There is `dwarf2Data->GetObjectFile()->GetModule()->ReportError()` but it will 
currently lock up since implementation of multithreaded DWARF reading. But 
there are AFAIK already many such errors which do not happen in realworld but 
they would lock up if they did. I agree returning an error value is the proper 
solution, I have no idea when it is the right time to implement that.



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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [lldb] r355941 - [Reproducers] Add a test to ensure we can reuse the reproducer dir.

2019-03-12 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Mar 12 10:31:04 2019
New Revision: 355941

URL: http://llvm.org/viewvc/llvm-project?rev=355941=rev
Log:
[Reproducers] Add a test to ensure we can reuse the reproducer dir.

Yesterday I noticed a reproducer test failing after making a local
change. Removing the reproducer directory solved the issue. Add a test
case that detects this.

Added:
lldb/trunk/lit/Reproducer/TestReuseDirectory.test
Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Added: lldb/trunk/lit/Reproducer/TestReuseDirectory.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestReuseDirectory.test?rev=355941=auto
==
--- lldb/trunk/lit/Reproducer/TestReuseDirectory.test (added)
+++ lldb/trunk/lit/Reproducer/TestReuseDirectory.test Tue Mar 12 10:31:04 2019
@@ -0,0 +1,10 @@
+# UNSUPPORTED: system-windows, system-freebsd
+
+# Test that we can capture twice to the same directory without breaking the
+# reproducer functionality.
+
+# RUN: rm -rf %t.repro
+# RUN: %clang %S/Inputs/simple.c -g -o %t.out
+# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path 
%t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK 
--check-prefix CAPTURE
+# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path 
%t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK 
--check-prefix CAPTURE
+# RUN: %lldb --replay %t.repro | FileCheck %S/TestGDBRemoteRepro.test 
--check-prefix CHECK --check-prefix REPLAY

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=355941=355940=355941=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Mar 
12 10:31:04 2019
@@ -178,7 +178,7 @@ public:
 
 std::error_code EC;
 m_stream_up = llvm::make_unique(history_file.GetPath(), EC,
-
sys::fs::OpenFlags::F_None);
+
sys::fs::OpenFlags::F_Text);
 return m_stream_up.get();
   }
 


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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp:89
   }
   llvm_unreachable("invalid UnitType.");
 }

Not your code, but this application of `llvm_unreachable` seems suspicious 
unless we can guarantee that we already checked for a supported format before 
entering here.


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
zturner marked an inline comment as done.
zturner added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp:170
 case DW_FORM_sec_offset:
   assert(m_cu);
+  m_value.value.uval = data.GetMaxU64(offset_ptr, 4);

jankratochvil wrote:
> Delete the assert?
Good catch.  I'll do this (and the other one) before submitting.


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Zachary Turner via Phabricator via lldb-commits
zturner marked an inline comment as done.
zturner added a comment.

It seems like we're mostly in agreement on the direction of the patch, so if 
there's no outstanding comments I'll submit at the end of the day.




Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp:263
   uint64_t length = data.GetU32();
-  bool isDwarf64 = (length == 0x);
-  if (isDwarf64)

jankratochvil wrote:
> Here should be an error that DWARF64 is not supported.
How do we report that error?  This function doesn't return an error code, and 
neither does the function that calls it (I didn't look higher than that), and 
we don't build with exceptions.  We can assert, but we try to avoid asserts 
(although admittedly, we're going to crash anyway).  I can try to do more work 
to propagate errors up the stack, but at this point this whole file (and even 
most of the folder that the file is in) is in theory going to be going away 
soon as we converge on LLVM's DWARF parser, so it may make sense to just deal 
with the problem at that level.


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-12 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355939: Add ability to import std module into expression 
parser to improve C++ debugging (authored by teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D58125?vs=190289=190290#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58125

Files:
  lldb/trunk/include/lldb/Expression/ExpressionSourceCode.h
  lldb/trunk/include/lldb/Target/Platform.h
  lldb/trunk/include/lldb/Target/Target.h
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/TestImportStdModule.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/TestMissingStdModule.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/TestStdModuleSysroot.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/algorithm
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/module.modulemap
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/libc_header.h
  lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTUtils.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTUtils.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
  lldb/trunk/source/Target/Target.cpp

Index: lldb/trunk/include/lldb/Expression/ExpressionSourceCode.h
===
--- lldb/trunk/include/lldb/Expression/ExpressionSourceCode.h
+++ lldb/trunk/include/lldb/Expression/ExpressionSourceCode.h
@@ -10,6 +10,7 @@
 #define liblldb_ExpressionSourceCode_h
 
 #include "lldb/lldb-enumerations.h"
+#include "llvm/ADT/ArrayRef.h"
 
 #include 
 
Index: lldb/trunk/include/lldb/Target/Target.h
===
--- lldb/trunk/include/lldb/Target/Target.h
+++ lldb/trunk/include/lldb/Target/Target.h
@@ -129,6 +129,8 @@
 
   bool GetEnableAutoImportClangModules() const;
 
+  bool GetEnableImportStdModule() const;
+
   bool GetEnableAutoApplyFixIts() const;
 
   bool GetEnableNotifyAboutFixIts() const;
Index: lldb/trunk/include/lldb/Target/Platform.h
===
--- lldb/trunk/include/lldb/Target/Platform.h
+++ lldb/trunk/include/lldb/Target/Platform.h
@@ -281,6 +281,21 @@
 
   virtual bool SetRemoteWorkingDirectory(const FileSpec _dir);
 
+  //--
+  /// Retrieve the system include directories on this platform for the
+  /// given language.
+  ///
+  /// \param[in] lang
+  /// The language for which the include directories should be queried.
+  ///
+  /// \param[out] directories
+  /// The include directories for this system.
+  //--
+  virtual std::vector
+  GetSystemIncludeDirectories(lldb::LanguageType lang) {
+return {};
+  }
+
   virtual UserIDResolver () = 0;
 
   //--
Index: 

[Lldb-commits] [lldb] r355940 - [Reproducers] Stop recording instead of deallocating

2019-03-12 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Mar 12 10:10:28 2019
New Revision: 355940

URL: http://llvm.org/viewvc/llvm-project?rev=355940=rev
Log:
[Reproducers] Stop recording instead of deallocating

The command interpreter holds a pointer to a DataRecorder. After
generating the reproducer, we deallocated all the DataRecorders, causing
the command interpreter to hold a non-null reference to an invalid
object.

This patch changes the behavior of the command provider to stop the
DataRecorders when a reproducer is generated, rather than deallocating
them.

Modified:
lldb/trunk/include/lldb/Utility/Reproducer.h
lldb/trunk/source/Utility/Reproducer.cpp

Modified: lldb/trunk/include/lldb/Utility/Reproducer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Reproducer.h?rev=355940=355939=355940=diff
==
--- lldb/trunk/include/lldb/Utility/Reproducer.h (original)
+++ lldb/trunk/include/lldb/Utility/Reproducer.h Tue Mar 12 10:10:28 2019
@@ -115,7 +115,7 @@ class DataRecorder {
 public:
   DataRecorder(FileSpec filename, std::error_code )
   : m_filename(std::move(filename)),
-m_os(m_filename.GetPath(), ec, llvm::sys::fs::F_Text) {}
+m_os(m_filename.GetPath(), ec, llvm::sys::fs::F_Text), m_record(true) 
{}
 
   static llvm::Expected>
   Create(FileSpec filename);
@@ -128,9 +128,15 @@ public:
 
   const FileSpec () { return m_filename; }
 
+  void Stop() {
+assert(m_record);
+m_record = false;
+  }
+
 private:
   FileSpec m_filename;
   llvm::raw_fd_ostream m_os;
+  bool m_record;
 };
 
 struct CommandInfo {

Modified: lldb/trunk/source/Utility/Reproducer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Reproducer.cpp?rev=355940=355939=355940=diff
==
--- lldb/trunk/source/Utility/Reproducer.cpp (original)
+++ lldb/trunk/source/Utility/Reproducer.cpp Tue Mar 12 10:10:28 2019
@@ -247,8 +247,10 @@ DataRecorder *CommandProvider::GetNewDat
 
 void CommandProvider::Keep() {
   std::vector files;
-  for (auto  : m_data_recorders)
+  for (auto  : m_data_recorders) {
+recorder->Stop();
 files.push_back(recorder->GetFilename().GetPath());
+  }
 
   FileSpec file = GetRoot().CopyByAppendingPathComponent(info::file);
   std::error_code ec;


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


[Lldb-commits] [lldb] r355939 - Add ability to import std module into expression parser to improve C++ debugging

2019-03-12 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Tue Mar 12 10:09:33 2019
New Revision: 355939

URL: http://llvm.org/viewvc/llvm-project?rev=355939=rev
Log:
Add ability to import std module into expression parser to improve C++ debugging

Summary:
This patch is the MVP version of importing the std module into the expression 
parser to improve C++ debugging.

What happens in this patch is that we inject a `@import std` into our 
expression source code. We also
modify our internal Clang instance for parsing this expression to work with 
modules and debug info
at the same time (which is the main change in terms of LOC). We implicitly 
build the `std` module on the first use. The
C++ include paths for building are extracted from the debug info, which means 
that this currently only
works if the program is compiled with `-glldb -fmodules` and uses the std 
module. The C include paths
are currently specified by LLDB.

I enabled the tests currently only for libc++ and Linux because I could test 
this locally. I'll enable the tests
for other platforms once this has landed and doesn't break any bots (and I 
implemented the platform-specific
C include paths for them).

With this patch we can now:
* Build a libc++ as a module and import it into the expression parser.
* Read from the module while also referencing declarations from the debug info. 
E.g. `std::abs(local_variable)`.

What doesn't work (yet):
* Merging debug info and C++ module declarations. E.g. 
`std::vector` doesn't work.
* Pretty much anything that involves the ASTImporter and templated code. As the 
ASTImporter is used for saving the result declaration, this means that we can't
call yet any function that returns a non-trivial type.
* Use libstdc++ for this, as it requires multiple include paths and Clang only 
emits one include path per module. Also libstdc++ doesn't support Clang modules 
without patches.

Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille

Reviewed By: aprantl

Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/TestImportStdModule.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/TestMissingStdModule.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/TestStdModuleSysroot.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/algorithm

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/module.modulemap

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/libc_header.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTUtils.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTUtils.h
Modified:

[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 190289.
teemperor added a comment.

- Rebased patch.
- Modernized for loops in ASTUtils.


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

https://reviews.llvm.org/D58125

Files:
  lldb/include/lldb/Expression/ExpressionSourceCode.h
  lldb/include/lldb/Target/Platform.h
  lldb/include/lldb/Target/Target.h
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/TestImportStdModule.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/TestMissingStdModule.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/TestStdModuleSysroot.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/algorithm
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/module.modulemap
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/libc_header.h
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
  lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/source/Plugins/Platform/Linux/PlatformLinux.h
  lldb/source/Target/Target.cpp

Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -3327,6 +3327,9 @@
 {"auto-import-clang-modules", OptionValue::eTypeBoolean, false, true,
  nullptr, {},
  "Automatically load Clang modules referred to by the program."},
+{"import-std-module", OptionValue::eTypeBoolean, false, false,
+ nullptr, {},
+ "Import the C++ std module to improve debugging STL containers."},
 {"auto-apply-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
  {}, "Automatically apply fix-it hints to expressions."},
 {"notify-about-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
@@ -3465,6 +3468,7 @@
   ePropertyDebugFileSearchPaths,
   ePropertyClangModuleSearchPaths,
   ePropertyAutoImportClangModules,
+  ePropertyImportStdModule,
   ePropertyAutoApplyFixIts,
   ePropertyNotifyAboutFixIts,
   ePropertySaveObjects,
@@ -3887,6 +3891,12 @@
   nullptr, idx, g_properties[idx].default_uint_value != 0);
 }
 
+bool TargetProperties::GetEnableImportStdModule() const {
+  const uint32_t idx = ePropertyImportStdModule;
+  return m_collection_sp->GetPropertyAtIndexAsBoolean(
+  nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
 bool TargetProperties::GetEnableAutoApplyFixIts() const {
   const uint32_t idx = ePropertyAutoApplyFixIts;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
Index: lldb/source/Plugins/Platform/Linux/PlatformLinux.h
===
--- lldb/source/Plugins/Platform/Linux/PlatformLinux.h
+++ lldb/source/Plugins/Platform/Linux/PlatformLinux.h
@@ -52,6 +52,9 @@
 
   bool CanDebugProcess() override;
 
+  std::vector
+  GetSystemIncludeDirectories(lldb::LanguageType lang) override;
+
   lldb::ProcessSP DebugProcess(ProcessLaunchInfo _info,
Debugger , Target *target,
Status ) override;
Index: lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
===
--- lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -263,6 

[Lldb-commits] [PATCH] D59238: [Reproducers] Support capturing a reproducer without an explicit path.

2019-03-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355936: [Reproducers] Support capturing a reproducer 
without an explicit path. (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59238?vs=190194=190284#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59238

Files:
  include/lldb/API/SBReproducer.h
  lit/Reproducer/Functionalities/TestDataFormatter.test
  lit/Reproducer/Functionalities/TestImageList.test
  lit/Reproducer/Functionalities/TestStepping.test
  lit/Reproducer/Modules/TestModuleCXX.test
  lit/Reproducer/TestDriverOptions.test
  lit/Reproducer/TestFileRepro.test
  lit/Reproducer/TestGDBRemoteRepro.test
  source/API/SBReproducer.cpp
  tools/driver/Driver.cpp
  tools/driver/Options.td

Index: include/lldb/API/SBReproducer.h
===
--- include/lldb/API/SBReproducer.h
+++ include/lldb/API/SBReproducer.h
@@ -18,6 +18,7 @@
 /// in the interface or implementation of this class.
 class LLDB_API SBReproducer {
 public:
+  static const char *Capture();
   static const char *Capture(const char *path);
   static const char *Replay(const char *path);
 };
Index: tools/driver/Options.td
===
--- tools/driver/Options.td
+++ tools/driver/Options.td
@@ -219,9 +219,11 @@
   Alias,
   HelpText<"Alias for --debug">;
 
-def capture: Separate<["--", "-"], "capture">,
+def capture: F<"capture">,
+  HelpText<"Tells the debugger to capture a reproducer.">;
+def capture_path: Separate<["--", "-"], "capture-path">,
   MetaVarName<"">,
-  HelpText<"Tells the debugger to capture a reproducer to .">;
+  HelpText<"Tells the debugger to use the given filename for the reproducer.">;
 def replay: Separate<["--", "-"], "replay">,
   MetaVarName<"">,
   HelpText<"Tells the debugger to replay a reproducer from .">;
Index: tools/driver/Driver.cpp
===
--- tools/driver/Driver.cpp
+++ tools/driver/Driver.cpp
@@ -849,6 +849,38 @@
   llvm::outs() << examples;
 }
 
+llvm::Optional InitializeReproducer(opt::InputArgList _args) {
+  if (auto *replay_path = input_args.getLastArg(OPT_replay)) {
+if (const char *error = SBReproducer::Replay(replay_path->getValue())) {
+  WithColor::error() << "reproducer replay failed: " << error << '\n';
+  return 1;
+}
+return 0;
+  }
+
+  bool capture = input_args.hasArg(OPT_capture);
+  auto *capture_path = input_args.getLastArg(OPT_capture_path);
+
+  if (capture || capture_path) {
+if (capture_path) {
+  if (!capture)
+WithColor::warning() << "-capture-path specified without -capture\n";
+  if (const char *error = SBReproducer::Capture(capture_path->getValue())) {
+WithColor::error() << "reproducer capture failed: " << error << '\n';
+return 1;
+  }
+} else {
+  const char *error = SBReproducer::Capture();
+  if (error) {
+WithColor::error() << "reproducer capture failed: " << error << '\n';
+return 1;
+  }
+}
+  }
+
+  return llvm::None;
+}
+
 int
 #ifdef _MSC_VER
 wmain(int argc, wchar_t const *wargv[])
@@ -889,23 +921,8 @@
  << '\n';
   }
 
-  if (auto *arg = input_args.getLastArg(OPT_capture)) {
-auto arg_value = arg->getValue();
-const char *error = SBReproducer::Capture(arg_value);
-if (error) {
-  WithColor::error() << "reproducer capture failed: " << error << '\n';
-  return 1;
-}
-  }
-
-  if (auto *arg = input_args.getLastArg(OPT_replay)) {
-auto arg_value = arg->getValue();
-const char *error = SBReproducer::Replay(arg_value);
-if (error) {
-  WithColor::error() << "reproducer replay failed: " << error << '\n';
-  return 1;
-}
-return 0;
+  if (auto exit_code = InitializeReproducer(input_args)) {
+return *exit_code;
   }
 
   SBError error = SBDebugger::InitializeWithErrorHandling();
Index: source/API/SBReproducer.cpp
===
--- source/API/SBReproducer.cpp
+++ source/API/SBReproducer.cpp
@@ -2940,6 +2940,15 @@
   }
 }
 
+const char *SBReproducer::Capture() {
+  static std::string error;
+  if (auto e = Reproducer::Initialize(ReproducerMode::Capture, llvm::None)) {
+error = llvm::toString(std::move(e));
+return error.c_str();
+  }
+  return nullptr;
+}
+
 const char *SBReproducer::Capture(const char *path) {
   static std::string error;
   if (auto e =
Index: lit/Reproducer/TestGDBRemoteRepro.test
===
--- lit/Reproducer/TestGDBRemoteRepro.test
+++ lit/Reproducer/TestGDBRemoteRepro.test
@@ -6,8 +6,9 @@
 # process. To ensure we're not actually running the original binary we check
 # that the string "testing" is not printed.
 
+# RUN: rm -rf 

[Lldb-commits] [lldb] r355936 - [Reproducers] Support capturing a reproducer without an explicit path.

2019-03-12 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Mar 12 09:44:18 2019
New Revision: 355936

URL: http://llvm.org/viewvc/llvm-project?rev=355936=rev
Log:
[Reproducers] Support capturing a reproducer without an explicit path.

Tablegen doesn't support options that are both flags and take values as
an argument. I noticed this when doing the tablegen rewrite, but forgot
that that affected the reproducer --capture flag.

This patch makes --capture a flag and adds --capture-path to specify a
path for the reproducer. In reality I expect this to be mostly used for
testing, but it could be useful nonetheless.

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

Modified:
lldb/trunk/include/lldb/API/SBReproducer.h
lldb/trunk/lit/Reproducer/Functionalities/TestDataFormatter.test
lldb/trunk/lit/Reproducer/Functionalities/TestImageList.test
lldb/trunk/lit/Reproducer/Functionalities/TestStepping.test
lldb/trunk/lit/Reproducer/Modules/TestModuleCXX.test
lldb/trunk/lit/Reproducer/TestDriverOptions.test
lldb/trunk/lit/Reproducer/TestFileRepro.test
lldb/trunk/lit/Reproducer/TestGDBRemoteRepro.test
lldb/trunk/source/API/SBReproducer.cpp
lldb/trunk/tools/driver/Driver.cpp
lldb/trunk/tools/driver/Options.td

Modified: lldb/trunk/include/lldb/API/SBReproducer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBReproducer.h?rev=355936=355935=355936=diff
==
--- lldb/trunk/include/lldb/API/SBReproducer.h (original)
+++ lldb/trunk/include/lldb/API/SBReproducer.h Tue Mar 12 09:44:18 2019
@@ -18,6 +18,7 @@ namespace lldb {
 /// in the interface or implementation of this class.
 class LLDB_API SBReproducer {
 public:
+  static const char *Capture();
   static const char *Capture(const char *path);
   static const char *Replay(const char *path);
 };

Modified: lldb/trunk/lit/Reproducer/Functionalities/TestDataFormatter.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/Functionalities/TestDataFormatter.test?rev=355936=355935=355936=diff
==
--- lldb/trunk/lit/Reproducer/Functionalities/TestDataFormatter.test (original)
+++ lldb/trunk/lit/Reproducer/Functionalities/TestDataFormatter.test Tue Mar 12 
09:44:18 2019
@@ -5,7 +5,7 @@
 # RUN: rm -rf %t.repro
 # RUN: %clangxx %S/Inputs/foo.cpp -g -o %t.out
 
-# RUN: %lldb -x -b -s %S/Inputs/DataFormatter.in --capture %t.repro %t.out | 
FileCheck %s
+# RUN: %lldb -x -b -s %S/Inputs/DataFormatter.in --capture --capture-path 
%t.repro %t.out | FileCheck %s
 # RUN: %lldb --replay %t.repro | FileCheck %s
 
 # CHECK: stop reason = breakpoint 1.1

Modified: lldb/trunk/lit/Reproducer/Functionalities/TestImageList.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/Functionalities/TestImageList.test?rev=355936=355935=355936=diff
==
--- lldb/trunk/lit/Reproducer/Functionalities/TestImageList.test (original)
+++ lldb/trunk/lit/Reproducer/Functionalities/TestImageList.test Tue Mar 12 
09:44:18 2019
@@ -8,7 +8,7 @@
 # RUN: rm -rf %t.txt
 
 # RUN: echo "CAPTURE" >> %t.txt
-# RUN: %lldb -x -b  --capture %t.repro \
+# RUN: %lldb -x -b  --capture --capture-path %t.repro \
 # RUN:-o 'run' \
 # RUN:-o 'image list' \
 # RUN:-o 'reproducer generate' \

Modified: lldb/trunk/lit/Reproducer/Functionalities/TestStepping.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/Functionalities/TestStepping.test?rev=355936=355935=355936=diff
==
--- lldb/trunk/lit/Reproducer/Functionalities/TestStepping.test (original)
+++ lldb/trunk/lit/Reproducer/Functionalities/TestStepping.test Tue Mar 12 
09:44:18 2019
@@ -2,10 +2,11 @@
 
 # This tests that stepping continues to work when replaying a reproducer.
 
+# RUN: rm -rf %t.repro
 # RUN: %clang %S/Inputs/stepping.c -O0 -g -o %t.out
 # RUN: grep -v '#' %s > %t.in
 
-# RUN: %lldb -x -b -s %t.in --capture %t.repro %t.out | FileCheck %s 
--check-prefix CHECK
+# RUN: %lldb -x -b -s %t.in --capture --capture-path %t.repro %t.out | 
FileCheck %s --check-prefix CHECK
 # RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK
 
 # Set breakpoints in a,b and c and verify we stop there when stepping.

Modified: lldb/trunk/lit/Reproducer/Modules/TestModuleCXX.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/Modules/TestModuleCXX.test?rev=355936=355935=355936=diff
==
--- lldb/trunk/lit/Reproducer/Modules/TestModuleCXX.test (original)
+++ lldb/trunk/lit/Reproducer/Modules/TestModuleCXX.test Tue Mar 12 09:44:18 
2019
@@ -1,6 +1,7 @@
 # REQUIRES: system-darwin
 
 # Start fresh.
+# RUN: rm -rf %t.repro
 # RUN: rm -rf %t.root
 # RUN: rm -rf %t.clang-cache
 # RUN: rm 

[Lldb-commits] [lldb] r355931 - Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"

2019-03-12 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Tue Mar 12 08:54:35 2019
New Revision: 355931

URL: http://llvm.org/viewvc/llvm-project?rev=355931=rev
Log:
Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx 
docs (experimental)"

This reverts commit 511066858d44101703d61eded9abf8caff0f9fe0.
This turned out unnecessary to fix the bot.

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

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=355931=355930=355931=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Tue Mar 12 08:54:35 2019
@@ -93,7 +93,7 @@ function(add_lldb_library name)
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  if(NOT LLDB_BUILT_STANDALONE AND NOT LLVM_ENABLE_SPHINX)
+  if(NOT LLDB_BUILT_STANDALONE)
 add_dependencies(${name} clang-tablegen-targets)
   endif()
 


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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp:263
   uint64_t length = data.GetU32();
-  bool isDwarf64 = (length == 0x);
-  if (isDwarf64)

Here should be an error that DWARF64 is not supported.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp:170
 case DW_FORM_sec_offset:
   assert(m_cu);
+  m_value.value.uval = data.GetMaxU64(offset_ptr, 4);

Delete the assert?



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp:327
 case DW_FORM_strp:
   assert(cu);
+  *offset_ptr += 4;

Delete the assert?


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Paul Robinson via Phabricator via lldb-commits
probinson added a comment.

In D59235#1425443 , @zturner wrote:

> In D59235#1425436 , @clayborg wrote:
>
> > My main concern with the LLVM DWARF parser is all of the asserts in the 
> > code. If you attempt to use a DWARFDIE without first checking it for 
> > validity, it will crash on you instead of returning a good error or default 
> > value. That makes me really nervous as we shouldn't just crash the 
> > debugger. The switching over won't be too hard, just the fallout from the 
> > LLDB versions of the class that do error checking and return good 
> > error/default values and LLVM being very strict.
>
>
> Sure, I'm prepared to deal all that appropriately.  I don't plan to regress 
> LLDB's stability in the process.
>
> That's why for now I'm just doing very small preliminary steps to get the two 
> interfaces to be closer to each other and simplify the problem space.  We can 
> worry about the asserts and all of that when we actually start moving pieces 
> of LLDB to use LLVM's classes (which isn't in this patch).


A long term plan of moving LLVM's parser away from asserts and toward error 
reporting on bad input would also make the binutils that try to read DWARF more 
robust and useful for trying to diagnose bad object files.  I'm all for it.


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

https://reviews.llvm.org/D59235



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


[Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D59235#1425443 , @zturner wrote:

> In D59235#1425436 , @clayborg wrote:
>
> > My main concern with the LLVM DWARF parser is all of the asserts in the 
> > code. If you attempt to use a DWARFDIE without first checking it for 
> > validity, it will crash on you instead of returning a good error or default 
> > value. That makes me really nervous as we shouldn't just crash the 
> > debugger. The switching over won't be too hard, just the fallout from the 
> > LLDB versions of the class that do error checking and return good 
> > error/default values and LLVM being very strict.
>
>
> Sure, I'm prepared to deal all that appropriately.  I don't plan to regress 
> LLDB's stability in the process.


Sounds good.

> That's why for now I'm just doing very small preliminary steps to get the two 
> interfaces to be closer to each other and simplify the problem space.  We can 
> worry about the asserts and all of that when we actually start moving pieces 
> of LLDB to use LLVM's classes (which isn't in this patch).

I look forward to seeing this transition. I was planning on working on that 
right before I left Apple, but I left and didn't have the time after starting a 
new job. I will be happy to help review any changes as I did a lot of cleanup 
in the LLVM DWARF parser in preparation for the transition, so we should be in 
good shape.


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

https://reviews.llvm.org/D59235



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


Re: [Lldb-commits] [PATCH] D59217: Fix/unify SBType comparison

2019-03-12 Thread Greg Clayton via lldb-commits
The main reason for this that I can see is if we ever want to provide a 
lldb::user_id_t for a given SBType. We will lose that ability if we remove, but 
I am ok with this because we can force the TypeSystem to be able to remember 
this in metadata if we ever do need it. Why? In DWARF that most compilers 
produce, they produce many copies of a type, up to one in each compile unit 
within an symbol file. If you somehow get ahold of a type via the lldb::SB API 
right now, there is no way to figure out which one it picked from those many 
copies. So not a big deal if we remove this as we have not exposed 
"lldb::user_id_t lldb::SBType::GetID()" in the API yet, nor do we seem to have 
a need for it. You might keep the constructor that takes a type_sp just to keep 
the diffs down though, that ctor will extract the compiler type form the 
type_sp and not store it.

Greg

> On Mar 11, 2019, at 4:32 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> Ah, I see.  This doesn't seem terribly confusing,  TypePair manages the 
> TypeSP & CompilerType and keeps them in sync, so it just allows you to 
> provide a higher quality representation if you have it.  A lot of SBValues 
> come from debug information so they will have TypeSP's around when they get 
> made.
> 
> But if you want to try simplifying things, that's also good.  Since this is 
> caching the TypeSP we need to include "doesn't slow down debugging" to the 
> things that don't break, but we don't have a good way to measure that right 
> now.
> 
> Jim
> 
> 
>> On Mar 11, 2019, at 4:17 PM, Zachary Turner  wrote:
>> 
>> 
>> 
>> On Mon, Mar 11, 2019 at 4:15 PM Jim Ingham via lldb-commits 
>>  wrote:
>> Just to be precise: TypeImpl stores a TypePair for the static type and a 
>> CompilerType for the dynamic type.  These two have different meanings.  
>> There's no assumption about the relationship between the static and dynamic 
>> type.  In ObjC, the dynamic type need not even be in the same class 
>> hierarchy as the static type.  That's there so that if an SBValue hands out 
>> a type, it can represent both the static and dynamic types of the value it 
>> comes from.
>> 
>> I'm not sure why the static type is a TypePair and the dynamic type is a 
>> CompilerType, however.
>> 
>> The TypePair stores a TypeSP and a CompilerType that are supposed to be the 
>> same type.  It doesn't look like there is any way for those two to get out 
>> of sync, but I'm not entirely sure why it helps to have both in the same 
>> object.  Presumably it's caching?
>> 
>> This was what i meant.  It seems that in the case of SBType, nothing depends 
>> on the type_sp member of the pair, only the CompilerType.
>> 
>> I think the reason why both are in the same object is so that if you 
>> initialize it with a TypeSP you have a superset of functionality available 
>> than if you initialize it from a CompilerType.  But, if nobody actually 
>> requires this, then it simplifies the interface and makes it easier to 
>> reason about to just store a CompilerType for the static type.
>> 
>> Like Greg said though, it should be easy to see if it breaks anything by 
>> just changing the static type from TypePair to CompilerType and then fixing 
>> up the code and seeing if anything breaks.
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [PATCH] D59198: Correctly look up declarations in inline namespaces

2019-03-12 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355897: Correctly look up declarations in inline 
namespaces (authored by teemperor, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59198?vs=190111=190215#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59198

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/CompilerDeclContext.h
  include/lldb/Symbol/TypeSystem.h
  packages/Python/lldbsuite/test/expression_command/inline-namespace/Makefile
  
packages/Python/lldbsuite/test/expression_command/inline-namespace/TestInlineNamespace.py
  packages/Python/lldbsuite/test/expression_command/inline-namespace/main.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Symbol/ClangASTContext.cpp
  source/Symbol/CompilerDeclContext.cpp

Index: include/lldb/Symbol/CompilerDeclContext.h
===
--- include/lldb/Symbol/CompilerDeclContext.h
+++ include/lldb/Symbol/CompilerDeclContext.h
@@ -76,6 +76,21 @@
  ConstString *language_object_name_ptr);
 
   //--
+  /// Check if the given other decl context is contained in the lookup
+  /// of this decl context (for example because the other context is a nested
+  /// inline namespace).
+  ///
+  /// @param[in] other
+  /// The other decl context for which we should check if it is contained
+  /// in the lookoup of this context.
+  ///
+  /// @return
+  /// Returns true iff the other decl context is contained in the lookup
+  /// of this decl context.
+  //--
+  bool IsContainedInLookup(CompilerDeclContext other) const;
+
+  //--
   // Accessors
   //--
 
Index: include/lldb/Symbol/ClangASTContext.h
===
--- include/lldb/Symbol/ClangASTContext.h
+++ include/lldb/Symbol/ClangASTContext.h
@@ -354,11 +354,13 @@
   //--
 
   clang::NamespaceDecl *
-  GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx);
+  GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx,
+bool is_inline = false);
 
   static clang::NamespaceDecl *
   GetUniqueNamespaceDeclaration(clang::ASTContext *ast, const char *name,
-clang::DeclContext *decl_ctx);
+clang::DeclContext *decl_ctx,
+bool is_inline = false);
 
   //--
   // Function Types
@@ -506,6 +508,9 @@
 bool *is_instance_method_ptr,
 ConstString *language_object_name_ptr) override;
 
+  bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
+  void *other_opaque_decl_ctx) override;
+
   //--
   // Clang specific clang::DeclContext functions
   //--
Index: include/lldb/Symbol/TypeSystem.h
===
--- include/lldb/Symbol/TypeSystem.h
+++ include/lldb/Symbol/TypeSystem.h
@@ -132,6 +132,9 @@
   void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
   bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
 
+  virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
+  void *other_opaque_decl_ctx) = 0;
+
   //--
   // Tests
   //--
Index: packages/Python/lldbsuite/test/expression_command/inline-namespace/main.cpp
===
--- packages/Python/lldbsuite/test/expression_command/inline-namespace/main.cpp
+++ packages/Python/lldbsuite/test/expression_command/inline-namespace/main.cpp
@@ -0,0 +1,10 @@
+namespace A {
+  inline namespace B {
+int f() { return 3; }
+  };
+}
+
+int main(int argc, char **argv) {
+  // Set break point at this line.
+  return A::f();
+}
Index: packages/Python/lldbsuite/test/expression_command/inline-namespace/TestInlineNamespace.py
===
--- packages/Python/lldbsuite/test/expression_command/inline-namespace/TestInlineNamespace.py
+++ 

[Lldb-commits] [lldb] r355897 - Correctly look up declarations in inline namespaces

2019-03-12 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Tue Mar 12 00:45:04 2019
New Revision: 355897

URL: http://llvm.org/viewvc/llvm-project?rev=355897=rev
Log:
Correctly look up declarations in inline namespaces

Summary:
This patch marks the inline namespaces from DWARF as inline and also ensures 
that looking
up declarations now follows the lookup rules for inline namespaces.

Reviewers: aprantl, shafik, serge-sans-paille

Reviewed By: aprantl

Subscribers: eraman, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace/TestInlineNamespace.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace/main.cpp
Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerDeclContext.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=355897=355896=355897=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Mar 12 00:45:04 2019
@@ -354,11 +354,13 @@ public:
   //--
 
   clang::NamespaceDecl *
-  GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext 
*decl_ctx);
+  GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx,
+bool is_inline = false);
 
   static clang::NamespaceDecl *
   GetUniqueNamespaceDeclaration(clang::ASTContext *ast, const char *name,
-clang::DeclContext *decl_ctx);
+clang::DeclContext *decl_ctx,
+bool is_inline = false);
 
   //--
   // Function Types
@@ -506,6 +508,9 @@ public:
 bool *is_instance_method_ptr,
 ConstString *language_object_name_ptr) 
override;
 
+  bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
+  void *other_opaque_decl_ctx) override;
+
   //--
   // Clang specific clang::DeclContext functions
   //--

Modified: lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h?rev=355897=355896=355897=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h Tue Mar 12 00:45:04 
2019
@@ -76,6 +76,21 @@ public:
  ConstString *language_object_name_ptr);
 
   //--
+  /// Check if the given other decl context is contained in the lookup
+  /// of this decl context (for example because the other context is a nested
+  /// inline namespace).
+  ///
+  /// @param[in] other
+  /// The other decl context for which we should check if it is contained
+  /// in the lookoup of this context.
+  ///
+  /// @return
+  /// Returns true iff the other decl context is contained in the lookup
+  /// of this decl context.
+  //--
+  bool IsContainedInLookup(CompilerDeclContext other) const;
+
+  //--
   // Accessors
   //--
 

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=355897=355896=355897=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Mar 12 00:45:04 2019
@@ -132,6 +132,9 @@ public:
   void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
   bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
 
+  virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
+