[Lldb-commits] [PATCH] D46144: Reflow paragraphs in comments.

2018-04-27 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The formatting of the comments has been bugging me as well. So far, I have been 
trying to reflow them whenever I touch the code around them, but at that rate 
fixing all of them would take ages.

Your heuristics seem to be working fairly well. I've found a couple of 
sub-optimal decisions in the few files I opened, but I am not sure if it's 
feasible to fix the algorithm to account for them.

So overall, this seems like a good idea to me, and the few places where it gets 
this wrong can be fixed up afterwards (it decreases the total number of badly 
formatted comments).

PS: I don't see any header files in the list. Is there a particular reason for 
skipping them?




Comment at: source/API/SBDebugger.cpp:73
+// This calls the bool lldb::PluginInitialize(lldb::SBDebugger
+// debugger) function. TODO: mangle this differently for your system -
+// on OSX, the first underscore needs to be removed and the second one

Folding TODO: Here is sub-optimal.



Comment at: source/API/SBInstruction.cpp:37-38
 // 1  lldb::SBInstruction inst;
-// 2  inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
-// 3  if (inst.DoesBranch())
-// 4  ...
+// 2  inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0) 3  if
+// (inst.DoesBranch()) 4  ...
 //

This doesn't look right.


https://reviews.llvm.org/D46144



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


[Lldb-commits] [PATCH] D40468: DWZ 01/07: Support reading section ".gnu_debugaltlink"

2018-04-27 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Awesome, thanks. I think we can get this one out of the way.

In https://reviews.llvm.org/D40468#1080136, @jankratochvil wrote:

> Added `lit/Modules/dwarf-gnu-debugaltlink.yaml`. I do not see its test 
> success anywhere but when I make it fail I see its failure in `make 
> check-lldb` stdout/stderr.


That's supposed to happen. To see passing tests you need to run lit in the 
verbose mode.

> Curiously its simulated failure does not appear in `make check-lit`.

check-lit is a lit-selftest. This test should not be run as a part of that. Did 
you perhaps mean check-lldb-lit (which should probably be removed because it's 
now practically an alias for check-lldb)?


https://reviews.llvm.org/D40468



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


[Lldb-commits] [PATCH] D40475: DWZ 06/07: DWZ test mode

2018-04-27 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil planned changes to this revision.
jankratochvil added a comment.

With the new testsuite run it currently reports failures due to missing 
.debug_info sections in some testcases, I need to make it false-regression-free.


https://reviews.llvm.org/D40475



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


[Lldb-commits] [PATCH] D40468: DWZ 01/07: Support reading section ".gnu_debugaltlink"

2018-04-27 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In https://reviews.llvm.org/D40468#1080751, @labath wrote:

> Awesome, thanks. I think we can get this one out of the way.


Thanks, I will check it in next days.

> check-lit is a lit-selftest. This test should not be run as a part of that. 
> Did you perhaps mean check-lldb-lit (which should probably be removed because 
> it's now practically an alias for check-lldb)?

Yes, I was wrongly running `check-lit` instead of `check-lldb-lit`, thanks for 
the correction.


https://reviews.llvm.org/D40468



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


[Lldb-commits] [PATCH] D44998: ObjectFileELF: Add support for arbitrarily named code sections

2018-04-27 Thread Konstantin Baladurin via Phabricator via lldb-commits
kbaladurin added a comment.
Herald added a reviewer: javed.absar.

Is it ready to commit?


https://reviews.llvm.org/D44998



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


[Lldb-commits] [PATCH] D44998: ObjectFileELF: Add support for arbitrarily named code sections

2018-04-27 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Yes, I take it you need someone to check it in?


https://reviews.llvm.org/D44998



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


[Lldb-commits] [PATCH] D44998: ObjectFileELF: Add support for arbitrarily named code sections

2018-04-27 Thread Konstantin Baladurin via Phabricator via lldb-commits
kbaladurin added a comment.

Yes, as I haven't commit access. Thank you!


https://reviews.llvm.org/D44998



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


[Lldb-commits] [PATCH] D45628: [LLDB] Support compressed debug info sections (.zdebug*)

2018-04-27 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

This is fine, I'll commit it for you today.


https://reviews.llvm.org/D45628



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


[Lldb-commits] [lldb] r331043 - Mark test as @skipIfOutOfTreeDebugserver

2018-04-27 Thread Frederic Riss via lldb-commits
Author: friss
Date: Fri Apr 27 08:30:09 2018
New Revision: 331043

URL: http://llvm.org/viewvc/llvm-project?rev=331043&view=rev
Log:
Mark test as @skipIfOutOfTreeDebugserver

This test will currently fail for people using the system debugserver.

Modified:

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py?rev=331043&r1=331042&r2=331043&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
 Fri Apr 27 08:30:09 2018
@@ -24,6 +24,7 @@ class TestGdbRemoteGPacket(gdbremote_tes
 register_bank = context.get("register_bank")
 self.assertTrue(register_bank[0] != 'E')
 
+@skipIfOutOfTreeDebugserver
 @debugserver_test
 def test_g_packet_debugserver(self):
 self.init_debugserver_test()


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


[Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Apr 27 08:45:58 2018
New Revision: 331049

URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
Log:
Always normalize FileSpec paths.

Always normalizing lldb_private::FileSpec paths will help us get a consistent 
results from comparisons when setting breakpoints and when looking for source 
files. This also removes a lot of complexity from the comparison routines. 
Modified the DWARF line table parser to use the normalized compile unit 
directory if needed.

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


Modified:
lldb/trunk/include/lldb/Core/FileSpecList.h
lldb/trunk/include/lldb/Utility/FileSpec.h
lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
lldb/trunk/source/Core/FileSpecList.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/CompileUnit.cpp
lldb/trunk/source/Symbol/Declaration.cpp
lldb/trunk/source/Utility/FileSpec.cpp
lldb/trunk/unittests/Utility/FileSpecTest.cpp

Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
==
--- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
+++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
@@ -119,16 +119,11 @@ public:
   /// @param[in] full
   /// Should FileSpec::Equal be called with "full" true or false.
   ///
-  /// @param[in] remove_backup_dots
-  /// Should FileSpec::Equal be called with "remove_backup_dots" true or
-  /// false.
-  ///
   /// @return
   /// The index of the file that matches \a file if it is found,
   /// else UINT32_MAX is returned.
   //--
-  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
-   bool remove_backup_dots = false) const;
+  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
 
   //--
   /// Get file at index.

Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
==
--- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
@@ -256,8 +256,7 @@ public:
   //--
   static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
 
-  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
-bool remove_backups = false);
+  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
 
   //--
   /// Case sensitivity of path.
@@ -488,12 +487,6 @@ public:
   size_t MemorySize() const;
 
   //--
-  /// Normalize a pathname by collapsing redundant separators and
-  /// up-level references.
-  //--
-  FileSpec GetNormalizedPath() const;
-
-  //--
   /// Change the file specified with a new path.
   ///
   /// Update the contents of this object with a new path. The path will

Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Fri Apr 27 
08:45:58 2018
@@ -122,7 +122,7 @@ void BreakpointResolverFileLine::FilterC
 
   llvm::StringRef relative_path;
   if (is_relative)
-relative_path = 
m_file_spec.GetNormalizedPath().GetDirectory().GetStringRef();
+relative_path = m_file_spec.GetDirectory().GetStringRef();
 
   Log * log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
   for(uint32_t i = 0; i < sc_list.GetSize(); ++i) {

Modified: lldb/trunk/source/Core/FileSpecList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=331049&r1=331048&r2=331049&view=diff
==
--- lldb/trunk/source/Core/FileSpecList.cpp (original)
+++ lldb/trunk/source/Core/FileSpecList.cpp Fri Ap

[Lldb-commits] [PATCH] D45977: Always normalize FileSpec paths.

2018-04-27 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331049: Always normalize FileSpec paths. (authored by 
gclayton, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D45977?vs=144021&id=144353#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45977

Files:
  lldb/trunk/include/lldb/Core/FileSpecList.h
  lldb/trunk/include/lldb/Utility/FileSpec.h
  lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
  lldb/trunk/source/Core/FileSpecList.cpp
  lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Symbol/CompileUnit.cpp
  lldb/trunk/source/Symbol/Declaration.cpp
  lldb/trunk/source/Utility/FileSpec.cpp
  lldb/trunk/unittests/Utility/FileSpecTest.cpp

Index: lldb/trunk/include/lldb/Utility/FileSpec.h
===
--- lldb/trunk/include/lldb/Utility/FileSpec.h
+++ lldb/trunk/include/lldb/Utility/FileSpec.h
@@ -256,8 +256,7 @@
   //--
   static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
 
-  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
-bool remove_backups = false);
+  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
 
   //--
   /// Case sensitivity of path.
@@ -488,12 +487,6 @@
   size_t MemorySize() const;
 
   //--
-  /// Normalize a pathname by collapsing redundant separators and
-  /// up-level references.
-  //--
-  FileSpec GetNormalizedPath() const;
-
-  //--
   /// Change the file specified with a new path.
   ///
   /// Update the contents of this object with a new path. The path will
Index: lldb/trunk/include/lldb/Core/FileSpecList.h
===
--- lldb/trunk/include/lldb/Core/FileSpecList.h
+++ lldb/trunk/include/lldb/Core/FileSpecList.h
@@ -119,16 +119,11 @@
   /// @param[in] full
   /// Should FileSpec::Equal be called with "full" true or false.
   ///
-  /// @param[in] remove_backup_dots
-  /// Should FileSpec::Equal be called with "remove_backup_dots" true or
-  /// false.
-  ///
   /// @return
   /// The index of the file that matches \a file if it is found,
   /// else UINT32_MAX is returned.
   //--
-  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
-   bool remove_backup_dots = false) const;
+  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
 
   //--
   /// Get file at index.
Index: lldb/trunk/unittests/Utility/FileSpecTest.cpp
===
--- lldb/trunk/unittests/Utility/FileSpecTest.cpp
+++ lldb/trunk/unittests/Utility/FileSpecTest.cpp
@@ -54,17 +54,14 @@
 
   FileSpec fs_posix_trailing_slash("/foo/bar/", false,
FileSpec::ePathSyntaxPosix);
-  EXPECT_STREQ("/foo/bar/.", fs_posix_trailing_slash.GetCString());
-  EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetDirectory().GetCString());
-  EXPECT_STREQ(".", fs_posix_trailing_slash.GetFilename().GetCString());
+  EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetCString());
+  EXPECT_STREQ("/foo", fs_posix_trailing_slash.GetDirectory().GetCString());
+  EXPECT_STREQ("bar", fs_posix_trailing_slash.GetFilename().GetCString());
 
   FileSpec fs_windows_trailing_slash("F:\\bar\\", false,
  FileSpec::ePathSyntaxWindows);
-  EXPECT_STREQ("F:\\bar\\.", fs_windows_trailing_slash.GetCString());
-  // EXPECT_STREQ("F:\\bar",
-  // fs_windows_trailing_slash.GetDirectory().GetCString()); // It returns
-  // "F:/bar"
-  EXPECT_STREQ(".", fs_windows_trailing_slash.GetFilename().GetCString());
+  EXPECT_STREQ("F:\\bar", fs_windows_trailing_slash.GetCString());
+  EXPECT_STREQ("bar", fs_windows_trailing_slash.GetFilename().GetCString());
 }
 
 TEST(FileSpecTest, AppendPathComponent) {
@@ -131,32 +128,13 @@
   EXPECT_STREQ("F:\\bar", fs_windows_root.GetCString());
 }
 
-static void Compare(const FileSpec &one, const FileSpec &two, bool full_match,
-bool remove_backup_dots, bool result) {
-  EXPECT_EQ(result, FileSpec::Equal(one, two, full_match, remove_backup_dots))
-  << "File one: " << one.GetCString() << "\nFile two: " << two.GetCString()
-  << "\nFull ma

[Lldb-commits] [PATCH] D46128: Fix expression parser to not accept any type whose basename matches for a type that must exist at root level

2018-04-27 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

ping?


https://reviews.llvm.org/D46128



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


[Lldb-commits] [PATCH] D46128: Fix expression parser to not accept any type whose basename matches for a type that must exist at root level

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: 
packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestTypeLookup.py:41
+
+# Make sure we don't accedentally accept structures that exist only
+# in namespaces when evaluating expressions with top level types.

accidentally


https://reviews.llvm.org/D46128



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


[Lldb-commits] [PATCH] D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5

2018-04-27 Thread Greg Clayton via Phabricator via lldb-commits
clayborg updated this revision to Diff 144358.
clayborg added a comment.
Herald added a subscriber: mgorny.

Update patch to work with changes from:

https://reviews.llvm.org/D45170


https://reviews.llvm.org/D32167

Files:
  include/lldb/lldb-enumerations.h
  include/lldb/lldb-forward.h
  lldb.xcodeproj/project.pbxproj
  packages/Python/lldbsuite/test/lldbinline.py
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/make/Makefile.rules
  packages/Python/lldbsuite/test/plugins/builder_base.py
  packages/Python/lldbsuite/test/test_categories.py
  source/Core/Section.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.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
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Symbol/ObjectFile.cpp

Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -359,6 +359,7 @@
   case eSectionTypeDWARFDebugRanges:
   case eSectionTypeDWARFDebugStr:
   case eSectionTypeDWARFDebugStrOffsets:
+  case eSectionTypeDWARFDebugTypes:
   case eSectionTypeDWARFAppleNames:
   case eSectionTypeDWARFAppleTypes:
   case eSectionTypeDWARFAppleNamespaces:
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -246,6 +246,7 @@
   const lldb_private::DWARFDataExtractor &get_debug_ranges_data();
   const lldb_private::DWARFDataExtractor &get_debug_str_data();
   const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data();
+  const lldb_private::DWARFDataExtractor &get_debug_types_data();
   const lldb_private::DWARFDataExtractor &get_apple_names_data();
   const lldb_private::DWARFDataExtractor &get_apple_types_data();
   const lldb_private::DWARFDataExtractor &get_apple_namespaces_data();
@@ -491,6 +492,7 @@
   DWARFDataSegment m_data_debug_ranges;
   DWARFDataSegment m_data_debug_str;
   DWARFDataSegment m_data_debug_str_offsets;
+  DWARFDataSegment m_data_debug_types;
   DWARFDataSegment m_data_apple_names;
   DWARFDataSegment m_data_apple_types;
   DWARFDataSegment m_data_apple_namespaces;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -501,21 +501,6 @@
 if (section_list == NULL)
   return 0;
 
-// On non Apple platforms we might have .debug_types debug info that
-// is created by using "-fdebug-types-section". LLDB currently will try
-// to load this debug info, but it causes crashes during debugging when
-// types are missing since it doesn't know how to parse the info in
-// the .debug_types type units. This causes all complex debug info
-// types to be unresolved. Because this causes LLDB to crash and since
-// it really doesn't provide a solid debuggiung experience, we should
-// disable trying to debug this kind of DWARF until support gets
-// added or deprecated.
-if (section_list->FindSectionByName(ConstString(".debug_types"))) {
-  m_obj_file->GetModule()->ReportWarning(
-"lldb doesn’t support .debug_types debug info");
-  return 0;
-}
-
 uint64_t debug_abbrev_file_size = 0;
 uint64_t debug_info_file_size = 0;
 uint64_t debug_line_file_size = 0;
@@ -591,8 +576,24 @@
 const DWARFDataExtractor &
 SymbolFileDWARF::GetCachedSectionData(lldb::SectionType sect_type,
   DWARFDataSegment &data_segment) {
-  llvm::call_once(data_segment.m_flag, [this, sect_type, &data_segment] {
+  llvm::call_once(data_segment.m_flag, [&] {
 this->LoadSectionData(sect_type, st

Re: [Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Jim Ingham via lldb-commits
Greg,

Your new FileSpecTest unit tests are failing in the Xcode build of lldb, e.g.:

http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671

Can you figure out what's up with this?

Jim

BTW, the "reply to" for lldb-commits mails for you is still your apple.com 
address.  I don't know where that gets set but you should probably update that 
at some point.




> On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits 
>  wrote:
> 
> Author: gclayton
> Date: Fri Apr 27 08:45:58 2018
> New Revision: 331049
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
> Log:
> Always normalize FileSpec paths.
> 
> Always normalizing lldb_private::FileSpec paths will help us get a consistent 
> results from comparisons when setting breakpoints and when looking for source 
> files. This also removes a lot of complexity from the comparison routines. 
> Modified the DWARF line table parser to use the normalized compile unit 
> directory if needed.
> 
> Differential Revision: https://reviews.llvm.org/D45977
> 
> 
> Modified:
>  lldb/trunk/include/lldb/Core/FileSpecList.h
>  lldb/trunk/include/lldb/Utility/FileSpec.h
>  lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>  lldb/trunk/source/Core/FileSpecList.cpp
>  lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
>  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>  lldb/trunk/source/Symbol/CompileUnit.cpp
>  lldb/trunk/source/Symbol/Declaration.cpp
>  lldb/trunk/source/Utility/FileSpec.cpp
>  lldb/trunk/unittests/Utility/FileSpecTest.cpp
> 
> Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
> ==
> --- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
> +++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
> @@ -119,16 +119,11 @@ public:
> /// @param[in] full
> /// Should FileSpec::Equal be called with "full" true or false.
> ///
> -  /// @param[in] remove_backup_dots
> -  /// Should FileSpec::Equal be called with "remove_backup_dots" true or
> -  /// false.
> -  ///
> /// @return
> /// The index of the file that matches \a file if it is found,
> /// else UINT32_MAX is returned.
> //--
> -  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
> -   bool remove_backup_dots = false) const;
> +  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
> 
> //--
> /// Get file at index.
> 
> Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
> ==
> --- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
> +++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
> @@ -256,8 +256,7 @@ public:
> //--
> static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
> 
> -  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
> -bool remove_backups = false);
> +  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
> 
> //--
> /// Case sensitivity of path.
> @@ -488,12 +487,6 @@ public:
> size_t MemorySize() const;
> 
> //--
> -  /// Normalize a pathname by collapsing redundant separators and
> -  /// up-level references.
> -  //--
> -  FileSpec GetNormalizedPath() const;
> -
> -  //--
> /// Change the file specified with a new path.
> ///
> /// Update the contents of this object with a new path. The path will
> 
> Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff
> ==
> --- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
> +++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Fri Apr 27 
> 08:45:58 2018
> @@ -122,7 +122,7 @@ void BreakpointResolverFileLine::FilterC
> 
> llvm::StringRef relative_path;
> if (is_relative)
> -relative_path = 
> m_fi

Re: [Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Frédéric Riss via lldb-commits


> On Apr 27, 2018, at 11:17 AM, Jim Ingham via lldb-commits 
>  wrote:
> 
> Greg,
> 
> Your new FileSpecTest unit tests are failing in the Xcode build of lldb, e.g.:
> 
> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671
> 
> Can you figure out what's up with this?

Once you get past the unit test, it looks like it also broke 
TestBreakpointCommand.py. Please fix this quickly.

Fred

> Jim
> 
> BTW, the "reply to" for lldb-commits mails for you is still your apple.com 
> address.  I don't know where that gets set but you should probably update 
> that at some point.
> 
> 
> 
> 
>> On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits 
>>  wrote:
>> 
>> Author: gclayton
>> Date: Fri Apr 27 08:45:58 2018
>> New Revision: 331049
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
>> Log:
>> Always normalize FileSpec paths.
>> 
>> Always normalizing lldb_private::FileSpec paths will help us get a 
>> consistent results from comparisons when setting breakpoints and when 
>> looking for source files. This also removes a lot of complexity from the 
>> comparison routines. Modified the DWARF line table parser to use the 
>> normalized compile unit directory if needed.
>> 
>> Differential Revision: https://reviews.llvm.org/D45977
>> 
>> 
>> Modified:
>> lldb/trunk/include/lldb/Core/FileSpecList.h
>> lldb/trunk/include/lldb/Utility/FileSpec.h
>> lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>> lldb/trunk/source/Core/FileSpecList.cpp
>> lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>> lldb/trunk/source/Symbol/CompileUnit.cpp
>> lldb/trunk/source/Symbol/Declaration.cpp
>> lldb/trunk/source/Utility/FileSpec.cpp
>> lldb/trunk/unittests/Utility/FileSpecTest.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
>> +++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
>> @@ -119,16 +119,11 @@ public:
>> /// @param[in] full
>> /// Should FileSpec::Equal be called with "full" true or false.
>> ///
>> -  /// @param[in] remove_backup_dots
>> -  /// Should FileSpec::Equal be called with "remove_backup_dots" true or
>> -  /// false.
>> -  ///
>> /// @return
>> /// The index of the file that matches \a file if it is found,
>> /// else UINT32_MAX is returned.
>> //--
>> -  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
>> -   bool remove_backup_dots = false) const;
>> +  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
>> 
>> //--
>> /// Get file at index.
>> 
>> Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
>> +++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
>> @@ -256,8 +256,7 @@ public:
>> //--
>> static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
>> 
>> -  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
>> -bool remove_backups = false);
>> +  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
>> 
>> //--
>> /// Case sensitivity of path.
>> @@ -488,12 +487,6 @@ public:
>> size_t MemorySize() const;
>> 
>> //--
>> -  /// Normalize a pathname by collapsing redundant separators and
>> -  /// up-level references.
>> -  //--
>> -  FileSpec GetNormalizedPath() const;
>> -
>> -  //--
>> /// Change the file specified with a new path.
>> ///
>> /// Update the contents of this object with a new path. The path will
>> 
>> Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lld

[Lldb-commits] [lldb] r331073 - [debugserver] Fix the G packet handling.

2018-04-27 Thread Frederic Riss via lldb-commits
Author: friss
Date: Fri Apr 27 12:59:42 2018
New Revision: 331073

URL: http://llvm.org/viewvc/llvm-project?rev=331073&view=rev
Log:
[debugserver] Fix the G packet handling.

Of course r331004 needed a counterpart on the write side.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py?rev=331073&r1=331072&r2=331073&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
 Fri Apr 27 12:59:42 2018
@@ -24,6 +24,15 @@ class TestGdbRemoteGPacket(gdbremote_tes
 register_bank = context.get("register_bank")
 self.assertTrue(register_bank[0] != 'E')
 
+self.test_sequence.add_log_lines(
+["read packet: $G" + register_bank + "#00",
+ {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$",
+  "capture": {1: "G_reply"}}],
+True)
+context = self.expect_gdbremote_sequence()
+self.assertTrue(context.get("G_reply")[0] != 'E')
+
+
 @skipIfOutOfTreeDebugserver
 @debugserver_test
 def test_g_packet_debugserver(self):

Modified: 
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=331073&r1=331072&r2=331073&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Fri 
Apr 27 12:59:42 2018
@@ -2717,7 +2717,9 @@ nub_size_t DNBArchImplX86_64::SetRegiste
 
 // Copy fcw through mxcsrmask as there is no padding
 memcpy(&m_state.context.fpu.no_avx.__fpu_fcw, p, 5);
-p += 5;
+// We wrote 5 bytes, but we skip 6 to account for __fpu_rsrv1
+// to match the g_fpu_registers_* tables.
+p += 6;
 memcpy(&m_state.context.fpu.no_avx.__fpu_fop, p, 8);
 p += 8;
 memcpy(&m_state.context.fpu.no_avx.__fpu_dp, p, 6);


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


[Lldb-commits] [PATCH] D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5

2018-04-27 Thread Paul Robinson via Phabricator via lldb-commits
probinson added a comment.

I am looking at making the LLVM parser handle type units across v4/v5, and the 
trick of pretending .debug_types is pasted onto the end of .debug_info seems 
like a pretty convenient fiction.  It unifies DIE handling, and still allows 
the dumper to distinguish which bits are in which section, which is 
traditionally how the dumper UI thinks about DWARF.  So as long as you and Jan 
are on the same page there, I'm happy to follow suit.




Comment at: source/Plugins/SymbolFile/DWARF/DIERef.cpp:53
+  // and DIE for the type signature. When a type is referred to by a
+  // DW_FORM_ref_sig8 form, the real information for the type in
+  // contained in a DW_TAG_type_unit.

... the type is


https://reviews.llvm.org/D32167



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


Re: [Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Greg Clayton via lldb-commits
Will do


> On Apr 27, 2018, at 1:01 PM, Frédéric Riss  wrote:
> 
> 
> 
>> On Apr 27, 2018, at 11:17 AM, Jim Ingham via lldb-commits 
>> mailto:lldb-commits@lists.llvm.org>> wrote:
>> 
>> Greg,
>> 
>> Your new FileSpecTest unit tests are failing in the Xcode build of lldb, 
>> e.g.:
>> 
>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671
>>  
>> 
>> 
>> Can you figure out what's up with this?
> 
> Once you get past the unit test, it looks like it also broke 
> TestBreakpointCommand.py. Please fix this quickly.
> 
> Fred
> 
>> Jim
>> 
>> BTW, the "reply to" for lldb-commits mails for you is still your apple.com 
>> address.  I don't know where that gets set but you should probably update 
>> that at some point.
>> 
>> 
>> 
>> 
>>> On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits 
>>>  wrote:
>>> 
>>> Author: gclayton
>>> Date: Fri Apr 27 08:45:58 2018
>>> New Revision: 331049
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
>>> Log:
>>> Always normalize FileSpec paths.
>>> 
>>> Always normalizing lldb_private::FileSpec paths will help us get a 
>>> consistent results from comparisons when setting breakpoints and when 
>>> looking for source files. This also removes a lot of complexity from the 
>>> comparison routines. Modified the DWARF line table parser to use the 
>>> normalized compile unit directory if needed.
>>> 
>>> Differential Revision: https://reviews.llvm.org/D45977
>>> 
>>> 
>>> Modified:
>>> lldb/trunk/include/lldb/Core/FileSpecList.h
>>> lldb/trunk/include/lldb/Utility/FileSpec.h
>>> lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>>> lldb/trunk/source/Core/FileSpecList.cpp
>>> lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>>> lldb/trunk/source/Symbol/CompileUnit.cpp
>>> lldb/trunk/source/Symbol/Declaration.cpp
>>> lldb/trunk/source/Utility/FileSpec.cpp
>>> lldb/trunk/unittests/Utility/FileSpecTest.cpp
>>> 
>>> Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
>>> +++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
>>> @@ -119,16 +119,11 @@ public:
>>> /// @param[in] full
>>> /// Should FileSpec::Equal be called with "full" true or false.
>>> ///
>>> -  /// @param[in] remove_backup_dots
>>> -  /// Should FileSpec::Equal be called with "remove_backup_dots" true 
>>> or
>>> -  /// false.
>>> -  ///
>>> /// @return
>>> /// The index of the file that matches \a file if it is found,
>>> /// else UINT32_MAX is returned.
>>> //--
>>> -  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
>>> -   bool remove_backup_dots = false) const;
>>> +  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
>>> 
>>> //--
>>> /// Get file at index.
>>> 
>>> Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
>>> +++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
>>> @@ -256,8 +256,7 @@ public:
>>> //--
>>> static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
>>> 
>>> -  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
>>> -bool remove_backups = false);
>>> +  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
>>> 
>>> //--
>>> /// Case sensitivity of path.
>>> @@ -488,12 +487,6 @@ public:
>>> size_t MemorySize() const;
>>> 
>>> //--
>>> -  /// Normalize a pathname by collapsing redundant separators and
>>> -  /// up-level references.
>>> -  //--
>>> -  FileSpec GetNormalizedPath() const;
>>> -
>>> -  //--
>>> /// Change the file specified with a new path.
>>> ///
>>> /// Update the contents

Re: [Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Greg Clayton via lldb-commits
I will fix this ASAP

> On Apr 27, 2018, at 11:17 AM, Jim Ingham  wrote:
> 
> Greg,
> 
> Your new FileSpecTest unit tests are failing in the Xcode build of lldb, e.g.:
> 
> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671
> 
> Can you figure out what's up with this?
> 
> Jim
> 
> BTW, the "reply to" for lldb-commits mails for you is still your apple.com 
> address.  I don't know where that gets set but you should probably update 
> that at some point.
> 
> 
> 
> 
>> On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits 
>>  wrote:
>> 
>> Author: gclayton
>> Date: Fri Apr 27 08:45:58 2018
>> New Revision: 331049
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
>> Log:
>> Always normalize FileSpec paths.
>> 
>> Always normalizing lldb_private::FileSpec paths will help us get a 
>> consistent results from comparisons when setting breakpoints and when 
>> looking for source files. This also removes a lot of complexity from the 
>> comparison routines. Modified the DWARF line table parser to use the 
>> normalized compile unit directory if needed.
>> 
>> Differential Revision: https://reviews.llvm.org/D45977
>> 
>> 
>> Modified:
>> lldb/trunk/include/lldb/Core/FileSpecList.h
>> lldb/trunk/include/lldb/Utility/FileSpec.h
>> lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>> lldb/trunk/source/Core/FileSpecList.cpp
>> lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
>> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>> lldb/trunk/source/Symbol/CompileUnit.cpp
>> lldb/trunk/source/Symbol/Declaration.cpp
>> lldb/trunk/source/Utility/FileSpec.cpp
>> lldb/trunk/unittests/Utility/FileSpecTest.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
>> +++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
>> @@ -119,16 +119,11 @@ public:
>> /// @param[in] full
>> /// Should FileSpec::Equal be called with "full" true or false.
>> ///
>> -  /// @param[in] remove_backup_dots
>> -  /// Should FileSpec::Equal be called with "remove_backup_dots" true or
>> -  /// false.
>> -  ///
>> /// @return
>> /// The index of the file that matches \a file if it is found,
>> /// else UINT32_MAX is returned.
>> //--
>> -  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
>> -   bool remove_backup_dots = false) const;
>> +  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
>> 
>> //--
>> /// Get file at index.
>> 
>> Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
>> +++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
>> @@ -256,8 +256,7 @@ public:
>> //--
>> static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
>> 
>> -  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
>> -bool remove_backups = false);
>> +  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
>> 
>> //--
>> /// Case sensitivity of path.
>> @@ -488,12 +487,6 @@ public:
>> size_t MemorySize() const;
>> 
>> //--
>> -  /// Normalize a pathname by collapsing redundant separators and
>> -  /// up-level references.
>> -  //--
>> -  FileSpec GetNormalizedPath() const;
>> -
>> -  //--
>> /// Change the file specified with a new path.
>> ///
>> /// Update the contents of this object with a new path. The path will
>> 
>> Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=331049&r1=331048&r2=331049&view=diff
>> ==
>> --- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
>> +++ lldb/trunk/source/Breakpoint/BreakpointReso

[Lldb-commits] [lldb] r331082 - Fix build bots after r331049 broke them.

2018-04-27 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Fri Apr 27 14:10:07 2018
New Revision: 331082

URL: http://llvm.org/viewvc/llvm-project?rev=331082&view=rev
Log:
Fix build bots after r331049 broke them.


Modified:
lldb/trunk/source/Utility/FileSpec.cpp

Modified: lldb/trunk/source/Utility/FileSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/FileSpec.cpp?rev=331082&r1=331081&r2=331082&view=diff
==
--- lldb/trunk/source/Utility/FileSpec.cpp (original)
+++ lldb/trunk/source/Utility/FileSpec.cpp Fri Apr 27 14:10:07 2018
@@ -244,9 +244,13 @@ inline char safeCharAtIndex(const llvm::
 //--
 bool needsNormalization(const llvm::StringRef &path,
 FileSpec::PathSyntax syntax) {
-  const auto separator = GetPreferredPathSeparator(syntax);
-  for (auto i = path.find(separator); i != llvm::StringRef::npos;
-   i = path.find(separator, i + 1)) {
+  if (path.empty())
+return false;
+  // We strip off leading "." values so these paths need to be normalized
+  if (path[0] == '.')
+return true;
+  for (auto i = path.find_first_of("\\/"); i != llvm::StringRef::npos;
+   i = path.find_first_of("\\/", i + 1)) {
 const auto next = safeCharAtIndex(path, i+1);
 switch (next) {
   case 0:
@@ -257,7 +261,7 @@ bool needsNormalization(const llvm::Stri
   case '\\':
 // two path separator chars in the middle of a path needs to be
 // normalized
-if (next == separator && i > 0)
+if (i > 0)
   return true;
 ++i;
 break;
@@ -269,9 +273,7 @@ bool needsNormalization(const llvm::Stri
 case 0: return true; // ends with "/."
 case '/':
 case '\\':
-  if (next_next == separator)
-return true; // contains "/./"
-  break;
+  return true; // contains "/./"
 case '.': {
   const auto next_next_next = safeCharAtIndex(path, i+3);
   switch (next_next_next) {
@@ -279,9 +281,7 @@ bool needsNormalization(const llvm::Stri
 case 0: return true; // ends with "/.."
 case '/':
 case '\\':
-  if (next_next_next == separator)
-return true; // contains "/../"
-  break;
+  return true; // contains "/../"
   }
   break;
 }


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


Re: [Lldb-commits] [lldb] r331049 - Always normalize FileSpec paths.

2018-04-27 Thread Greg Clayton via lldb-commits
Buildbots should be fixed with 331082.


> On Apr 27, 2018, at 1:01 PM, Frédéric Riss  wrote:
> 
> 
> 
>> On Apr 27, 2018, at 11:17 AM, Jim Ingham via lldb-commits 
>> mailto:lldb-commits@lists.llvm.org>> wrote:
>> 
>> Greg,
>> 
>> Your new FileSpecTest unit tests are failing in the Xcode build of lldb, 
>> e.g.:
>> 
>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb-xcode/6271/consoleFull#-1083450927b825e790-484f-4586-af29-73c4754ff671
>>  
>> 
>> 
>> Can you figure out what's up with this?
> 
> Once you get past the unit test, it looks like it also broke 
> TestBreakpointCommand.py. Please fix this quickly.
> 
> Fred
> 
>> Jim
>> 
>> BTW, the "reply to" for lldb-commits mails for you is still your apple.com 
>> address.  I don't know where that gets set but you should probably update 
>> that at some point.
>> 
>> 
>> 
>> 
>>> On Apr 27, 2018, at 8:45 AM, Greg Clayton via lldb-commits 
>>>  wrote:
>>> 
>>> Author: gclayton
>>> Date: Fri Apr 27 08:45:58 2018
>>> New Revision: 331049
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=331049&view=rev
>>> Log:
>>> Always normalize FileSpec paths.
>>> 
>>> Always normalizing lldb_private::FileSpec paths will help us get a 
>>> consistent results from comparisons when setting breakpoints and when 
>>> looking for source files. This also removes a lot of complexity from the 
>>> comparison routines. Modified the DWARF line table parser to use the 
>>> normalized compile unit directory if needed.
>>> 
>>> Differential Revision: https://reviews.llvm.org/D45977
>>> 
>>> 
>>> Modified:
>>> lldb/trunk/include/lldb/Core/FileSpecList.h
>>> lldb/trunk/include/lldb/Utility/FileSpec.h
>>> lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
>>> lldb/trunk/source/Core/FileSpecList.cpp
>>> lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
>>> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>>> lldb/trunk/source/Symbol/CompileUnit.cpp
>>> lldb/trunk/source/Symbol/Declaration.cpp
>>> lldb/trunk/source/Utility/FileSpec.cpp
>>> lldb/trunk/unittests/Utility/FileSpecTest.cpp
>>> 
>>> Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=331049&r1=331048&r2=331049&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
>>> +++ lldb/trunk/include/lldb/Core/FileSpecList.h Fri Apr 27 08:45:58 2018
>>> @@ -119,16 +119,11 @@ public:
>>> /// @param[in] full
>>> /// Should FileSpec::Equal be called with "full" true or false.
>>> ///
>>> -  /// @param[in] remove_backup_dots
>>> -  /// Should FileSpec::Equal be called with "remove_backup_dots" true 
>>> or
>>> -  /// false.
>>> -  ///
>>> /// @return
>>> /// The index of the file that matches \a file if it is found,
>>> /// else UINT32_MAX is returned.
>>> //--
>>> -  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
>>> -   bool remove_backup_dots = false) const;
>>> +  size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
>>> 
>>> //--
>>> /// Get file at index.
>>> 
>>> Modified: lldb/trunk/include/lldb/Utility/FileSpec.h
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/FileSpec.h?rev=331049&r1=331048&r2=331049&view=diff
>>> ==
>>> --- lldb/trunk/include/lldb/Utility/FileSpec.h (original)
>>> +++ lldb/trunk/include/lldb/Utility/FileSpec.h Fri Apr 27 08:45:58 2018
>>> @@ -256,8 +256,7 @@ public:
>>> //--
>>> static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
>>> 
>>> -  static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
>>> -bool remove_backups = false);
>>> +  static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
>>> 
>>> //--
>>> /// Case sensitivity of path.
>>> @@ -488,12 +487,6 @@ public:
>>> size_t MemorySize() const;
>>> 
>>> //--
>>> -  /// Normalize a pathname by collapsing redundant separators and
>>> -  /// up-level references.
>>> -  //--
>>> -  FileSpec GetNormalizedPath() const;
>>> -
>>> -  //--
>>> /// Change the file specified with a new path.
>>> 

[Lldb-commits] [PATCH] D45628: [LLDB] Support compressed debug info sections (.zdebug*)

2018-04-27 Thread Erik Welander via Phabricator via lldb-commits
alur added a comment.

Thank you David.

This is still based on the latest revision of the file (+ the non functional 
change patch).

F6048729: nfc.patch 


https://reviews.llvm.org/D45628



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


[Lldb-commits] [PATCH] D46220: Remove premature caching of the global variables list in CompileUnit.

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl created this revision.
aprantl added reviewers: clayborg, jingham.
Herald added a subscriber: JDevlieghere.

Remove premature caching of the global variables list in CompileUnit.
This is fixing a bug where

  
  (lldb) target var g_ptr


would propulate the global variables list with exactly one entry because 
SymbolFileDWARF::ParseVariables() was invoked with a list of DIEs pre-filtered 
by name, such that a subsequent call to

  
  (lldb) fr var --show-globals


would only list that one variable, because CompileUnit::m_variables was already 
initialized, fooling CompileUnit::GetVariableList().


https://reviews.llvm.org/D46220

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


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4219,7 +4219,6 @@
   variable_list_sp = sc.comp_unit->GetVariableList(false);
   if (variable_list_sp.get() == NULL) {
 variable_list_sp.reset(new VariableList());
-sc.comp_unit->SetVariableList(variable_list_sp);
   }
 } else {
   GetObjectFile()->GetModule()->ReportError(
Index: packages/Python/lldbsuite/test/lang/c/global_variables/main.c
===
--- packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -13,12 +13,13 @@
 static const int g_file_static_int = 2;
 const char *g_file_global_cstr = "g_file_global_cstr";
 static const char *g_file_static_cstr = "g_file_static_cstr";
+int *g_ptr = &g_file_global_int;
 
 extern int g_a;
 int main (int argc, char const *argv[])
 {
 g_common_1 = g_file_global_int / g_file_static_int;
 static const char *g_func_static_cstr = "g_func_static_cstr";
 printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
-return g_file_global_int + g_a + g_common_1; // Set break point at this 
line.   break $source:$line; continue; var -global g_a -global g_global_int
+return g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point 
at this line.   break $source:$line; continue; var -global g_a -global 
g_global_int
 }
Index: 
packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
===
--- 
packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ 
packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -39,6 +39,12 @@
 environment = self.registerSharedLibrariesWithTarget(
 target, self.shlib_names)
 
+# Test that static initialized variables can be inspected without 
process.
+self.expect("target variable g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+substrs=['(int *)'])
+self.expect("target variable *g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+substrs=['42'])
+
 # Now launch the process, and do not stop at entry point.
 process = target.LaunchSimple(
 None, environment, self.get_process_working_directory())
@@ -54,17 +60,21 @@
 substrs=[' resolved, hit count = 1'])
 
 # Check that GLOBAL scopes are indicated for the variables.
+self.runCmd("frame variable --show-types --scope --show-globals 
--no-args")
 self.expect(
 "frame variable --show-types --scope --show-globals --no-args",
 VARIABLES_DISPLAYED_CORRECTLY,
 substrs=[
-'GLOBAL: (int) g_file_global_int = 42',
 'STATIC: (const int) g_file_static_int = 2',
+'STATIC: (const char *) g_func_static_cstr',
 'GLOBAL: (const char *) g_file_global_cstr',
 '"g_file_global_cstr"',
+'GLOBAL: (int) g_file_global_int = 42',
+'GLOBAL: (int) g_common_1 = 21',
+'GLOBAL: (int *) g_ptr',
 'STATIC: (const char *) g_file_static_cstr',
-'"g_file_static_cstr"',
-'GLOBAL: (int) g_common_1 = 21'])
+'"g_file_static_cstr"'
+])
 
 # 'frame variable' should support address-of operator.
 self.runCmd("frame variable &g_file_global_int")
@@ -95,3 +105,8 @@
 VARIABLES_DISPLAYED_CORRECTLY,
 matching=False,
 substrs=["can't be resolved"])
+
+# Test that the statically initialized variable can also be
+# inspected *with* a process.
+self.expect("target variable *g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+substrs=['42'])


[Lldb-commits] [PATCH] D46220: Remove premature caching of the global variables list in CompileUnit.

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

This also adds test coverage for r224559, which is how I discovered this bug in 
the first place.


https://reviews.llvm.org/D46220



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


[Lldb-commits] [PATCH] D46088: Refactor GetNextPersistentVariableName into a non-virtual method

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

ping


https://reviews.llvm.org/D46088



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


[Lldb-commits] [PATCH] D46083: Move the persistent variable counter into Target

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

ping.


https://reviews.llvm.org/D46083



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


[Lldb-commits] [PATCH] D46144: Reflow paragraphs in comments.

2018-04-27 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 144420.
aprantl added a comment.

Updated the script based on Pavel's feedback:

  import textwrap
  import commands
  import os
  import sys
  import re
  tmp = "%s.tmp"%sys.argv[1]
  out = open(tmp, "w+")
  with open(sys.argv[1], "r") as f:
header = ""
text = ""
comment = re.compile(r'^( *//) ([^ ].*)$')
special = re.compile(r'^(([A-Z]+[: ])|([0-9]+ )).*$')
for line in f:
match = comment.match(line)
if match and not special.match(match.group(2)):
# skip intentionally short comments.
if not text and len(match.group(2)) < 40:
out.write(line)
continue
  
if text:
text += " " + match.group(2)
else:
header = match.group(1)
text = match.group(2)

continue
  
if text:
filled = textwrap.wrap(text, width=(77-len(header)),
   break_long_words=False)
for l in filled:
out.write(header+" "+l+'\n')
text = ""
  
out.write(line)
  
  os.rename(tmp, sys.argv[1])
  #find source -name '*.cpp' -exec python join-comments.py \{} \;


https://reviews.llvm.org/D46144

Files:
  include/lldb/API/SBAddress.h
  include/lldb/API/SBBroadcaster.h
  include/lldb/API/SBCommandInterpreter.h
  include/lldb/API/SBCommandReturnObject.h
  include/lldb/API/SBData.h
  include/lldb/API/SBExpressionOptions.h
  include/lldb/API/SBFrame.h
  include/lldb/API/SBInstruction.h
  include/lldb/API/SBInstructionList.h
  include/lldb/API/SBProcess.h
  include/lldb/API/SBStream.h
  include/lldb/API/SBSymbol.h
  include/lldb/API/SBTarget.h
  include/lldb/API/SBThreadPlan.h
  include/lldb/API/SBType.h
  include/lldb/API/SBValue.h
  include/lldb/API/SBValueList.h
  include/lldb/Breakpoint/Breakpoint.h
  include/lldb/Breakpoint/BreakpointLocation.h
  include/lldb/Breakpoint/BreakpointLocationCollection.h
  include/lldb/Breakpoint/BreakpointLocationList.h
  include/lldb/Breakpoint/BreakpointName.h
  include/lldb/Breakpoint/BreakpointOptions.h
  include/lldb/Breakpoint/BreakpointResolver.h
  include/lldb/Breakpoint/BreakpointResolverAddress.h
  include/lldb/Breakpoint/BreakpointResolverName.h
  include/lldb/Breakpoint/BreakpointSite.h
  include/lldb/Breakpoint/StoppointLocation.h
  include/lldb/Breakpoint/Watchpoint.h
  include/lldb/Breakpoint/WatchpointList.h
  include/lldb/Breakpoint/WatchpointOptions.h
  include/lldb/Core/Address.h
  include/lldb/Core/AddressRange.h
  include/lldb/Core/AddressResolverName.h
  include/lldb/Core/Broadcaster.h
  include/lldb/Core/Debugger.h
  include/lldb/Core/Disassembler.h
  include/lldb/Core/EmulateInstruction.h
  include/lldb/Core/FormatEntity.h
  include/lldb/Core/IOHandler.h
  include/lldb/Core/MappedHash.h
  include/lldb/Core/Module.h
  include/lldb/Core/ModuleList.h
  include/lldb/Core/ModuleSpec.h
  include/lldb/Core/PluginManager.h
  include/lldb/Core/RangeMap.h
  include/lldb/Core/RegisterValue.h
  include/lldb/Core/STLUtils.h
  include/lldb/Core/Scalar.h
  include/lldb/Core/SearchFilter.h
  include/lldb/Core/Section.h
  include/lldb/Core/SourceManager.h
  include/lldb/Core/StreamBuffer.h
  include/lldb/Core/UniqueCStringMap.h
  include/lldb/Core/UserSettingsController.h
  include/lldb/Core/Value.h
  include/lldb/Core/ValueObject.h
  include/lldb/Core/ValueObjectSyntheticFilter.h
  include/lldb/DataFormatters/DataVisualization.h
  include/lldb/DataFormatters/FormatClasses.h
  include/lldb/DataFormatters/FormatManager.h
  include/lldb/DataFormatters/FormattersContainer.h
  include/lldb/DataFormatters/StringPrinter.h
  include/lldb/DataFormatters/TypeFormat.h
  include/lldb/DataFormatters/TypeSummary.h
  include/lldb/DataFormatters/TypeSynthetic.h
  include/lldb/DataFormatters/TypeValidator.h
  include/lldb/DataFormatters/ValueObjectPrinter.h
  include/lldb/Expression/DiagnosticManager.h
  include/lldb/Expression/ExpressionSourceCode.h
  include/lldb/Expression/ExpressionVariable.h
  include/lldb/Expression/IRMemoryMap.h
  include/lldb/Expression/LLVMUserExpression.h
  include/lldb/Expression/REPL.h
  include/lldb/Expression/UtilityFunction.h
  include/lldb/Host/Debug.h
  include/lldb/Host/Editline.h
  include/lldb/Host/MainLoop.h
  include/lldb/Host/MainLoopBase.h
  include/lldb/Host/PosixApi.h
  include/lldb/Host/Predicate.h
  include/lldb/Host/Socket.h
  include/lldb/Host/SocketAddress.h
  include/lldb/Host/Symbols.h
  include/lldb/Host/TaskPool.h
  include/lldb/Host/XML.h
  include/lldb/Host/common/GetOptInc.h
  include/lldb/Host/common/NativeBreakpoint.h
  include/lldb/Host/common/NativeProcessProtocol.h
  include/lldb/Host/common/NativeRegisterContext.h
  include/lldb/Host/linux/Ptrace.h
  include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
  include/lldb/Interpreter/CommandAlias.h
  include/lldb/Interpreter/CommandCompletions.h
  include/lldb/Interpreter/CommandInterpreter.h
  include/

[Lldb-commits] [PATCH] D46088: Refactor GetNextPersistentVariableName into a non-virtual method

2018-04-27 Thread Jim Ingham via Phabricator via lldb-commits
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

I'm curious how you are going to implement GetPersistentVariablePrefix for a 
language (e.g. swift) that uses multiple prefixes.  You've got a pattern here 
where you always call GetPersistentVariablePrefix, but you're going to have to 
break that pattern for swift.  And then how are you going to handle that in 
generic code w/o having to check the language.

Anyway, you shouldn't hardcode $ twice.




Comment at: source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:672
 ConstString ClangUserExpression::ResultDelegate::GetName() {
-  return m_persistent_state->GetNextPersistentVariableName(*m_target_sp);
+  return m_persistent_state->GetNextPersistentVariableName(*m_target_sp, "$");
 }

Was it just an oversight that you don't call 
m_persistent_state->GetPersistentVariablePrefix here?



https://reviews.llvm.org/D46088



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