[Lldb-commits] [PATCH] D65561: SymbolVendorELF: Perform build-id lookup even without a debug link

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The "real" goal is being able to search for external debug files using the 
build-id without them having the gnu_debuglink thingy. :)

That would seem to at odds with your " .gnu_debuglink is considered as a flag" 
assertion, but I am not sure how you came to believe that. The gdb 
documentation for separate debug files 
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html stops short 
of saying that the build-id can be used without the debug link, but it does 
speak of them as two "methods" for finding external debug info, which at least 
to me, is a pretty clear indication that they can be used independently. And 
indeed, if you try to create such a situation, gdb will happily load the debug 
info from the separate file based on the build id alone:

  /tmp/B $ readelf -S a.out | grep gnu # no .gnu_debuglink
[ 2] .note.gnu.build-i NOTE 02c4  02c4
[ 4] .gnu.hash GNU_HASH 0308  0308
[ 7] .gnu.version  VERSYM   0498  0498
[ 8] .gnu.version_rVERNEED  04a8  04a8
  /tmp/B $ gdb
  GNU gdb (Gentoo 8.3 vanilla) 8.3
  ...
  (gdb) set debug-file-directory /tmp/B/D
  (gdb) file a.out
  Reading symbols from a.out...
  Reading symbols from 
/tmp/B/D/.build-id/7e/d1cb4d4300b8ff67f2f2ef5b273666e339a8ba.debug... # <== 
symbols found here

That said, I agree the extra filesystem accesses are bad, and they are a 
completely unintended side-effect of this patch. If that is the only issue, 
then I think this can be easily fixed by first checking whether the main object 
file contains any debug info, and skipping the rest of the lookup in that case.


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

https://reviews.llvm.org/D65561



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


[Lldb-commits] [PATCH] D65717: [lldb][clang] Reflect LangStandard.h move to clang/Basic

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

> building lldb with an existing (pre-Langstandard.h move)
>  clang: is this supposed to work in the general case

No, this isn't something that is supposed to work in the general case. master 
LLDB builds only with master clang. Sometimes you might be able to get away 
with using a slightly older (~a week) clang or llvm (I do to cut down on build 
times), but that is a totally unsupported thing...


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65717



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


[Lldb-commits] [PATCH] D65561: SymbolVendorELF: Perform build-id lookup even without a debug link

2019-08-05 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D65561#1614293 , @labath wrote:

> That would seem to at odds with your " .gnu_debuglink is considered as a 
> flag" assertion, but I am not sure how you came to believe that.


I see I remembered it wrongly, already the initial build-id implementation for 
GDB ignored `.gnu_debuglink` 
.

> That said, I agree the extra filesystem accesses are bad, and they are a 
> completely unintended side-effect of this patch. If that is the only issue, 
> then I think this can be easily fixed by first checking whether the main 
> object file contains any debug info, and skipping the rest of the lookup in 
> that case.

Yes, this is what GDB does:

/* If the file has its own symbol tables it has no separate debug
   info.  `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
   SYMTABS/PSYMTABS.  `.gnu_debuglink' may no longer be present with
   `.note.gnu.build-id'.
  ...
else if (!objfile_has_partial_symbols (objfile)   
std::string debugfile = find_separate_debug_file_by_buildid (objfile);


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

https://reviews.llvm.org/D65561



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


[Lldb-commits] [lldb] r367814 - Remove usage of usleep in generic code

2019-08-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Aug  5 01:23:25 2019
New Revision: 367814

URL: http://llvm.org/viewvc/llvm-project?rev=367814&view=rev
Log:
Remove usage of usleep in generic code

This function is not portable, and there are only a handful of usages of
it anyway. Replacing it with std::this_thread::sleep_for enables us to
get rid of the compatibility code in PosixApi.h.

Modified:
lldb/trunk/include/lldb/Host/windows/PosixApi.h
lldb/trunk/source/Host/windows/Windows.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=367814&r1=367813&r2=367814&view=diff
==
--- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original)
+++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Mon Aug  5 01:23:25 2019
@@ -80,7 +80,6 @@ int vasprintf(char **ret, const char *fm
 char *strcasestr(const char *s, const char *find);
 char *realpath(const char *name, char *resolved);
 
-int usleep(uint32_t useconds);
 char *basename(char *path);
 char *dirname(char *path);
 

Modified: lldb/trunk/source/Host/windows/Windows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Windows.cpp?rev=367814&r1=367813&r2=367814&view=diff
==
--- lldb/trunk/source/Host/windows/Windows.cpp (original)
+++ lldb/trunk/source/Host/windows/Windows.cpp Mon Aug  5 01:23:25 2019
@@ -199,11 +199,6 @@ int strncasecmp(const char *s1, const ch
   return strnicmp(s1, s2, n);
 }
 
-int usleep(uint32_t useconds) {
-  Sleep(useconds / 1000);
-  return 0;
-}
-
 #if _MSC_VER < 1900
 namespace lldb_private {
 int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr) {

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp?rev=367814&r1=367813&r2=367814&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
 Mon Aug  5 01:23:25 2019
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Threading.h"
@@ -280,10 +281,9 @@ bool GDBRemoteCommunicationServerPlatfor
 return true;
   }
 }
-usleep(1);
+std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
 
-  // check one more time after the final usleep
   {
 std::lock_guard guard(m_spawned_pids_mutex);
 if (m_spawned_pids.find(pid) == m_spawned_pids.end())
@@ -302,10 +302,10 @@ bool GDBRemoteCommunicationServerPlatfor
 return true;
   }
 }
-usleep(1);
+std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
 
-  // check one more time after the final usleep Scope for locker
+  // check one more time after the final sleep
   {
 std::lock_guard guard(m_spawned_pids_mutex);
 if (m_spawned_pids.find(pid) == m_spawned_pids.end())

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=367814&r1=367813&r2=367814&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Aug  
5 01:23:25 2019
@@ -1032,7 +1032,7 @@ Status ProcessGDBRemote::ConnectToDebugs
 if (retry_count >= max_retry_count)
   break;
 
-usleep(10);
+std::this_thread::sleep_for(std::chrono::milliseconds(100));
   }
 }
   }
@@ -3591,7 +3591,8 @@ bool ProcessGDBRemote::MonitorDebugserve
   // Sleep for a half a second to make sure our inferior process has time to
   // set its exit status before we set it incorrectly when both the debugserver
   // and the inferior process shut down.
-  usleep(50);
+  std::this_thread::sleep_for(std::chrono::milliseconds(500));
+
   // If our process hasn't yet exited, debugserver might have died. If the
   // process did exit, then we are reaping it.
   const StateType state = process_sp->GetState();

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=367814&r1=367813&r2=367814&view=diff

[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added subscribers: stella.stamenova, amccarth, labath.
labath added a comment.

I took @xbolva00's suggestion one step further, and removed the usleep and the 
related compat code in r367814. So, some of your changes are no longer needed 
once you rebase past that.

I have a couple of additional small comments inline, but other than that, this 
seems fine. I'm not sure how active is @zturner these days (@amccarth and 
@stella.stamenova  are probably better reviewers for windows stuff now), but 
this seems pretty straight-forward, so I don't think we have to wait for them.




Comment at: lldb/source/Initialization/SystemInitializerCommon.cpp:28
 #include "lldb/Host/windows/windows.h"
+// for _CrtSetReportMode
+#include 

In r346625, we deleted all/most comments like this. Probably best to not 
introduce new ones...



Comment at: lldb/tools/driver/Platform.h:20
+// pid_t
+#include 
+#endif

It looks like we already have the `HAVE_SYS_TYPES_H` macro, which we can use 
for this purpose, so I'd use that, and move it out of the `_MSC_VER` block as 
we should really include this header on other platforms too (but we probably 
haven't done that because it got included transitively already...)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691



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


[Lldb-commits] [lldb] r367820 - Remove SymbolVendor::GetSymtab

2019-08-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Aug  5 02:21:47 2019
New Revision: 367820

URL: http://llvm.org/viewvc/llvm-project?rev=367820&view=rev
Log:
Remove SymbolVendor::GetSymtab

Summary:
This patch removes the GetSymtab method from the SymbolVendor, which is
a no-op as it's implementation just forwards to the relevant SymbolFile.
Instead it creates a Module::GetSymtab, which calls the SymbolFile
method directly.

All callers have been updated to use the Module method directly instead
of a two phase GetSymbolVendor->GetSymtab search, which leads to reduced
intentation in a lot of deeply nested code.

Reviewers: clayborg, JDevlieghere, jingham

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp

Modified: lldb/trunk/include/lldb/Core/Module.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=367820&r1=367819&r2=367820&view=diff
==
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Mon Aug  5 02:21:47 2019
@@ -656,6 +656,8 @@ public:
   SymbolFile *GetSymbolFile(bool can_create = true,
 Stream *feedback_strm = nullptr);
 
+  Symtab *GetSymtab();
+
   /// Get a reference to the UUID value contained in this object.
   ///
   /// If the executable image file doesn't not have a UUID value built into

Modified: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolVendor.h?rev=367820&r1=367819&r2=367820&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h Mon Aug  5 02:21:47 2019
@@ -118,9 +118,6 @@ public:
 
   FileSpec GetMainFileSpec() const;
 
-  // Get module unified section list symbol table.
-  virtual Symtab *GetSymtab();
-
   /// Notify the SymbolVendor that the file addresses in the Sections
   /// for this module have been changed.
   virtual void SectionFileAddressesChanged();

Modified: lldb/trunk/source/API/SBModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=367820&r1=367819&r2=367820&view=diff
==
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Mon Aug  5 02:21:47 2019
@@ -290,11 +290,8 @@ SBSymbolContextList SBModule::FindCompil
 }
 
 static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
-  if (module_sp) {
-SymbolVendor *symbols = module_sp->GetSymbolVendor();
-if (symbols)
-  return symbols->GetSymtab();
-  }
+  if (module_sp)
+return module_sp->GetSymtab();
   return nullptr;
 }
 
@@ -302,11 +299,8 @@ size_t SBModule::GetNumSymbols() {
   LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols);
 
   ModuleSP module_sp(GetSP());
-  if (module_sp) {
-Symtab *symtab = GetUnifiedSymbolTable(module_sp);
-if (symtab)
-  return symtab->GetNumSymbols();
-  }
+  if (Symtab *symtab = GetUnifiedSymbolTable(module_sp))
+return symtab->GetNumSymbols();
   return 0;
 }
 

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=367820&r1=367819&r2=367820&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Aug  5 02:21:47 2019
@@ -1447,15 +1447,11 @@ static size_t DumpModuleObjfileHeaders(S
 
 static void DumpModuleSymtab(CommandInterpreter &interpreter, Stream &strm,
  Module *module, SortOrder sort_order) {
-  if (module) {
-SymbolVendor *sym_vendor = module->GetSymbolVendor();
-if (sym_vendor) {
-  Symtab *symtab = sym_vendor->GetSymtab();
-  if (symtab)
-symtab->Dump(&strm, interpreter.GetExecutionContext().GetTargetPtr(),
- sort_order);
-}
-  }
+  if (!module)
+return;
+  if (Symtab *symtab = module->GetSymtab())
+symtab->Dump(&strm, interpreter.GetExecutionContext().GetTargetPtr(),
+ sort_order);
 }
 
 static void DumpModuleSections(CommandInterpreter &interpreter, Stream &strm,
@@ -1561,47 +1557,44 @@ static uint32_t LookupSymbolInModule(Com
  Stream &strm, M

[Lldb-commits] [PATCH] D65569: Remove SymbolVendor::GetSymtab

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367820: Remove SymbolVendor::GetSymtab (authored by labath, 
committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65569

Files:
  lldb/trunk/include/lldb/Core/Module.h
  lldb/trunk/include/lldb/Symbol/SymbolVendor.h
  lldb/trunk/source/API/SBModule.cpp
  lldb/trunk/source/Commands/CommandObjectTarget.cpp
  lldb/trunk/source/Core/Address.cpp
  lldb/trunk/source/Core/Module.cpp
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
  lldb/trunk/source/Symbol/SymbolFile.cpp
  lldb/trunk/source/Symbol/SymbolVendor.cpp

Index: lldb/trunk/source/API/SBModule.cpp
===
--- lldb/trunk/source/API/SBModule.cpp
+++ lldb/trunk/source/API/SBModule.cpp
@@ -290,11 +290,8 @@
 }
 
 static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
-  if (module_sp) {
-SymbolVendor *symbols = module_sp->GetSymbolVendor();
-if (symbols)
-  return symbols->GetSymtab();
-  }
+  if (module_sp)
+return module_sp->GetSymtab();
   return nullptr;
 }
 
@@ -302,11 +299,8 @@
   LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols);
 
   ModuleSP module_sp(GetSP());
-  if (module_sp) {
-Symtab *symtab = GetUnifiedSymbolTable(module_sp);
-if (symtab)
-  return symtab->GetNumSymbols();
-  }
+  if (Symtab *symtab = GetUnifiedSymbolTable(module_sp))
+return symtab->GetNumSymbols();
   return 0;
 }
 
Index: lldb/trunk/source/Core/Address.cpp
===
--- lldb/trunk/source/Core/Address.cpp
+++ lldb/trunk/source/Core/Address.cpp
@@ -493,23 +493,19 @@
 switch (sect_type) {
 case eSectionTypeData:
   if (module_sp) {
-SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
-if (sym_vendor) {
-  Symtab *symtab = sym_vendor->GetSymtab();
-  if (symtab) {
-const addr_t file_Addr = GetFileAddress();
-Symbol *symbol =
-symtab->FindSymbolContainingFileAddress(file_Addr);
-if (symbol) {
-  const char *symbol_name = symbol->GetName().AsCString();
-  if (symbol_name) {
-s->PutCString(symbol_name);
-addr_t delta =
-file_Addr - symbol->GetAddressRef().GetFileAddress();
-if (delta)
-  s->Printf(" + %" PRIu64, delta);
-showed_info = true;
-  }
+if (Symtab *symtab = module_sp->GetSymtab()) {
+  const addr_t file_Addr = GetFileAddress();
+  Symbol *symbol =
+  symtab->FindSymbolContainingFileAddress(file_Addr);
+  if (symbol) {
+const char *symbol_name = symbol->GetName().AsCString();
+if (symbol_name) {
+  s->PutCString(symbol_name);
+  addr_t delta =
+  file_Addr - symbol->GetAddressRef().GetFileAddress();
+  if (delta)
+s->Printf(" + %" PRIu64, delta);
+  showed_info = true;
 }
   }
 }
@@ -1003,10 +999,9 @@
   if (module_sp) {
 ObjectFile *obj_file = module_sp->GetObjectFile();
 if (obj_file) {
-  // Give the symbol vendor a chance to add to the unified section list
-  // and to symtab from symbol file
-  if (SymbolVendor *vendor = module_sp->GetSymbolVendor())
-vendor->GetSymtab();
+  // Give the symbol file a chance to add to the unified section list
+  // and to the symtab.
+  module_sp->GetSymtab();
   return obj_file->GetAddressClass(GetFileAddress());
 }
   }
Index: lldb/trunk/source/Core/Module.cpp
===
--- lldb/trunk/source/Core/Module.cpp
+++ lldb/trunk/source/Core/Module.cpp
@@ -1061,6 +1061,12 @@
   return nullptr;
 }
 
+Symtab *Module::GetSymtab() {
+  if (SymbolFile *symbols = GetSymbolFile())
+return symbols->GetSymtab();
+  return nullptr;
+}
+
 void Module::SetFileSpecAndObjectName(const FileSpec &file,
   ConstString object_name) {
   // Container objects whose paths do not specify a file directly can call this
@@ -1231,9 +1237,8 @@
   if (objfile)
 objfile->Dump(s);
 
-  SymbolVendor *symbols = GetSymbolVendor();
-  if (symbols)
-symbols->Dump(s);
+  if (SymbolFile *symbols = GetSymbolFile())
+symbols->Dump(*s);
 
   s->IndentLess();
 }
@@ -1309,13 +1314,9 @@
   Timer scoped_timer(
   func_cat, "Module::FindFirstSymbolWithNameAndType (name = %s, type = %i)",
   name.AsCString(), symbol_type);
-  SymbolVendo

[Lldb-commits] [PATCH] D65561: SymbolVendorELF: Perform build-id lookup even without a debug link

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 213298.
labath added a comment.

- don't go off searching for separate files if the main one already contains 
debug info.


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

https://reviews.llvm.org/D65561

Files:
  lit/Modules/ELF/build-id-case.yaml
  lit/Modules/ELF/gnu-debuglink.yaml
  source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  source/Symbol/LocateSymbolFile.cpp

Index: source/Symbol/LocateSymbolFile.cpp
===
--- source/Symbol/LocateSymbolFile.cpp
+++ source/Symbol/LocateSymbolFile.cpp
@@ -261,107 +261,110 @@
   FileSystem::Instance().Exists(symbol_file_spec))
 return symbol_file_spec;
 
-  const char *symbol_filename = symbol_file_spec.GetFilename().AsCString();
-  if (symbol_filename && symbol_filename[0]) {
-FileSpecList debug_file_search_paths = default_search_paths;
+  FileSpecList debug_file_search_paths = default_search_paths;
+
+  // Add module directory.
+  FileSpec module_file_spec = module_spec.GetFileSpec();
+  // We keep the unresolved pathname if it fails.
+  FileSystem::Instance().ResolveSymbolicLink(module_file_spec,
+ module_file_spec);
+
+  ConstString file_dir = module_file_spec.GetDirectory();
+  {
+FileSpec file_spec(file_dir.AsCString("."));
+FileSystem::Instance().Resolve(file_spec);
+debug_file_search_paths.AppendIfUnique(file_spec);
+  }
 
-// Add module directory.
-FileSpec module_file_spec = module_spec.GetFileSpec();
-// We keep the unresolved pathname if it fails.
-FileSystem::Instance().ResolveSymbolicLink(module_file_spec,
-   module_file_spec);
+  if (ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
 
-ConstString file_dir = module_file_spec.GetDirectory();
+// Add current working directory.
 {
-  FileSpec file_spec(file_dir.AsCString("."));
+  FileSpec file_spec(".");
   FileSystem::Instance().Resolve(file_spec);
   debug_file_search_paths.AppendIfUnique(file_spec);
 }
 
-if (ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
-
-  // Add current working directory.
-  {
-FileSpec file_spec(".");
-FileSystem::Instance().Resolve(file_spec);
-debug_file_search_paths.AppendIfUnique(file_spec);
-  }
-
 #ifndef _WIN32
 #if defined(__NetBSD__)
-  // Add /usr/libdata/debug directory.
-  {
-FileSpec file_spec("/usr/libdata/debug");
-FileSystem::Instance().Resolve(file_spec);
-debug_file_search_paths.AppendIfUnique(file_spec);
-  }
+// Add /usr/libdata/debug directory.
+{
+  FileSpec file_spec("/usr/libdata/debug");
+  FileSystem::Instance().Resolve(file_spec);
+  debug_file_search_paths.AppendIfUnique(file_spec);
+}
 #else
-  // Add /usr/lib/debug directory.
-  {
-FileSpec file_spec("/usr/lib/debug");
-FileSystem::Instance().Resolve(file_spec);
-debug_file_search_paths.AppendIfUnique(file_spec);
-  }
+// Add /usr/lib/debug directory.
+{
+  FileSpec file_spec("/usr/lib/debug");
+  FileSystem::Instance().Resolve(file_spec);
+  debug_file_search_paths.AppendIfUnique(file_spec);
+}
 #endif
 #endif // _WIN32
-}
+  }
 
-std::string uuid_str;
-const UUID &module_uuid = module_spec.GetUUID();
-if (module_uuid.IsValid()) {
-  // Some debug files are stored in the .build-id directory like this:
-  //   /usr/lib/debug/.build-id/ff/e7fe727889ad82bb153de2ad065b2189693315.debug
-  uuid_str = module_uuid.GetAsString("");
-  std::transform(uuid_str.begin(), uuid_str.end(), uuid_str.begin(),
- ::tolower);
-  uuid_str.insert(2, 1, '/');
-  uuid_str = uuid_str + ".debug";
-}
+  std::string uuid_str;
+  const UUID &module_uuid = module_spec.GetUUID();
+  if (module_uuid.IsValid()) {
+// Some debug files are stored in the .build-id directory like this:
+//   /usr/lib/debug/.build-id/ff/e7fe727889ad82bb153de2ad065b2189693315.debug
+uuid_str = module_uuid.GetAsString("");
+std::transform(uuid_str.begin(), uuid_str.end(), uuid_str.begin(),
+   ::tolower);
+uuid_str.insert(2, 1, '/');
+uuid_str = uuid_str + ".debug";
+  }
 
-size_t num_directories = debug_file_search_paths.GetSize();
-for (size_t idx = 0; idx < num_directories; ++idx) {
-  FileSpec dirspec = debug_file_search_paths.GetFileSpecAtIndex(idx);
-  FileSystem::Instance().Resolve(dirspec);
-  if (!FileSystem::Instance().IsDirectory(dirspec))
-continue;
+  size_t num_directories = debug_file_search_paths.GetSize();
+  for (size_t idx = 0; idx < num_directories; ++idx) {
+FileSpec dirspec = debug_file_search_paths.GetFileSpecAtIndex(idx);
+FileSystem::Instance().Resolve(dirspec);
+if (!FileSystem::Instance().IsDirectory(d

[Lldb-commits] [lldb] r367824 - ObjectFile[ELF]: Refactor gnu_debuglink interface

2019-08-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Aug  5 02:55:07 2019
New Revision: 367824

URL: http://llvm.org/viewvc/llvm-project?rev=367824&view=rev
Log:
ObjectFile[ELF]: Refactor gnu_debuglink interface

Summary:
The contents of the gnu_debuglink section were passed through the
GetDebugSymbolFilePaths interface, which was more generic than needed.
As the only class implementing this function is ObjectFileELF, we can
modify the function to return just a single FileSpec (instead of a
list). Also, since the SymbolVendorELF already assumes ELF object files,
we don't have to make this method available on the generic ObjectFile
interface -- instead we can put it on ObjectFileELF directly.

This change also makes is so that if the Module has an explicit symbol
file spec set, we disregard the value the value of the debug link
(instead of doing a secondary lookup using that). I think it makes sense
to honor the users wishes if he had explicitly set the symbol file spec,
and this seems to be consistent with what SymbolVendorMacOSX is doing
(SymbolVendorMacOSX.cpp:125).

The main reason for making these changes is to make the treatment of
build-ids and debug links simpler in the follow-up patch.

Reviewers: clayborg, jankratochvil, mgorny, espindola

Subscribers: emaste, arichardson, MaskRay, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Symbol/ObjectFile.h
lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Modified: lldb/trunk/include/lldb/Symbol/ObjectFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ObjectFile.h?rev=367824&r1=367823&r2=367824&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h Mon Aug  5 02:55:07 2019
@@ -370,17 +370,6 @@ public:
   /// returned.
   virtual UUID GetUUID() = 0;
 
-  /// Gets the symbol file spec list for this object file.
-  ///
-  /// If the object file format contains a debug symbol file link, the values
-  /// will be returned in the FileSpecList.
-  ///
-  /// \return
-  /// Returns filespeclist.
-  virtual lldb_private::FileSpecList GetDebugSymbolFilePaths() {
-return FileSpecList();
-  }
-
   /// Gets the file spec list of libraries re-exported by this object file.
   ///
   /// If the object file format has the notion of one library re-exporting the

Modified: lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h?rev=367824&r1=367823&r2=367824&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h 
(original)
+++ lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h Mon Aug  
5 02:55:07 2019
@@ -85,8 +85,6 @@ public:
 
   UUID GetUUID() override { return m_uuid; }
 
-  FileSpecList GetDebugSymbolFilePaths() override { return FileSpecList(); }
-
   uint32_t GetDependentModules(FileSpecList &files) override { return 0; }
 
   Type CalculateType() override { return eTypeDebugInfo; }

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=367824&r1=367823&r2=367824&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Aug  5 
02:55:07 2019
@@ -816,14 +816,10 @@ UUID ObjectFileELF::GetUUID() {
   return m_uuid;
 }
 
-lldb_private::FileSpecList ObjectFileELF::GetDebugSymbolFilePaths() {
-  FileSpecList file_spec_list;
-
-  if (!m_gnu_debuglink_file.empty()) {
-FileSpec file_spec(m_gnu_debuglink_file);
-file_spec_list.Append(file_spec);
-  }
-  return file_spec_list;
+llvm::Optional ObjectFileELF::GetDebugLink() {
+  if (m_gnu_debuglink_file.empty())
+return llvm::None;
+  return FileSpec(m_gnu_debuglink_file);
 }
 
 uint32_t ObjectFileELF::GetDependentModules(FileSpecList &files) {

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h?rev=367824&r1=367823&r2=367824&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h Mon Aug  5 
02:55:07 2019
@@ -122,7 +122,9 @@ public:
 
   lldb_private::UUID GetUUID() override;
 
-  lldb_private::Fil

[Lldb-commits] [PATCH] D65560: ObjectFile[ELF]: Refactor gnu_debuglink interface

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367824: ObjectFile[ELF]: Refactor gnu_debuglink interface 
(authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65560

Files:
  lldb/trunk/include/lldb/Symbol/ObjectFile.h
  lldb/trunk/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Index: lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -71,86 +71,76 @@
   if (!uuid)
 return nullptr;
 
-  // Get the .gnu_debuglink file (if specified).
-  FileSpecList file_spec_list = obj_file->GetDebugSymbolFilePaths();
-
-  // If the module specified a filespec, use it first.
-  FileSpec debug_symbol_fspec(module_sp->GetSymbolFileFileSpec());
-  if (debug_symbol_fspec)
-file_spec_list.Insert(0, debug_symbol_fspec);
+  // If the module specified a filespec, use that.
+  FileSpec fspec = module_sp->GetSymbolFileFileSpec();
+  // Otherwise, try gnu_debuglink, if one exists.
+  if (!fspec)
+fspec = obj_file->GetDebugLink().getValueOr(FileSpec());
 
   // If we have no debug symbol files, then nothing to do.
-  if (file_spec_list.IsEmpty())
+  if (!fspec)
 return nullptr;
 
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
  module_sp->GetFileSpec().GetPath().c_str());
 
-  for (size_t idx = 0; idx < file_spec_list.GetSize(); ++idx) {
-ModuleSpec module_spec;
-const FileSpec fspec = file_spec_list.GetFileSpecAtIndex(idx);
-
-module_spec.GetFileSpec() = obj_file->GetFileSpec();
-FileSystem::Instance().Resolve(module_spec.GetFileSpec());
-module_spec.GetSymbolFileSpec() = fspec;
-module_spec.GetUUID() = uuid;
-FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
-FileSpec dsym_fspec =
-Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
-if (dsym_fspec) {
-  DataBufferSP dsym_file_data_sp;
-  lldb::offset_t dsym_file_data_offset = 0;
-  ObjectFileSP dsym_objfile_sp =
-  ObjectFile::FindPlugin(module_sp, &dsym_fspec, 0,
- FileSystem::Instance().GetByteSize(dsym_fspec),
- dsym_file_data_sp, dsym_file_data_offset);
-  if (dsym_objfile_sp) {
-// This objfile is for debugging purposes. Sadly, ObjectFileELF won't
-// be able to figure this out consistently as the symbol file may not
-// have stripped the code sections, etc.
-dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
-
-SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
-if (symbol_vendor) {
-  // Get the module unified section list and add our debug sections to
-  // that.
-  SectionList *module_section_list = module_sp->GetSectionList();
-  SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
-
-  static const SectionType g_sections[] = {
-  eSectionTypeDWARFDebugAbbrev,   eSectionTypeDWARFDebugAddr,
-  eSectionTypeDWARFDebugAranges,  eSectionTypeDWARFDebugCuIndex,
-  eSectionTypeDWARFDebugFrame,eSectionTypeDWARFDebugInfo,
-  eSectionTypeDWARFDebugLine, eSectionTypeDWARFDebugLoc,
-  eSectionTypeDWARFDebugMacInfo,  eSectionTypeDWARFDebugPubNames,
-  eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges,
-  eSectionTypeDWARFDebugStr,  eSectionTypeDWARFDebugStrOffsets,
-  eSectionTypeELFSymbolTable, eSectionTypeDWARFGNUDebugAltLink,
-  };
-  for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]);
-   ++idx) {
-SectionType section_type = g_sections[idx];
-SectionSP section_sp(
-objfile_section_list->FindSectionByType(section_type, true));
-if (section_sp) {
-  SectionSP module_section_sp(
-  module_section_list->FindSectionByType(section_type, true));
-  if (module_section_sp)
-module_section_list->ReplaceSection(module_section_sp->GetID(),
-section_sp);
-  else
-module_section_list->AddSection(section_sp);
-}
-  }
-
-  symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
-  r

[Lldb-commits] [lldb] r367830 - [lldb][NFC] Remove unimplemented ClangExpressionSourceCode::GetNumBodyLines

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 04:08:47 2019
New Revision: 367830

URL: http://llvm.org/viewvc/llvm-project?rev=367830&view=rev
Log:
[lldb][NFC] Remove unimplemented ClangExpressionSourceCode::GetNumBodyLines

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h?rev=367830&r1=367829&r2=367830&view=diff
==
--- 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h 
(original)
+++ 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h 
Mon Aug  5 04:08:47 2019
@@ -30,8 +30,6 @@ public:
 return new ClangExpressionSourceCode("$__lldb_expr", prefix, body, true);
   }
 
-  uint32_t GetNumBodyLines();
-
   /// Generates the source code that will evaluate the expression.
   ///
   /// \param text output parameter containing the source code string.


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


[Lldb-commits] [lldb] r367835 - Fix PDB tests after r367820

2019-08-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Aug  5 04:29:01 2019
New Revision: 367835

URL: http://llvm.org/viewvc/llvm-project?rev=367835&view=rev
Log:
Fix PDB tests after r367820

The commit changed Module dumping code to call SymbolFile::Dump
directly, which meant that we were no longer showing the plugin name in
the output (as that was done in the SymbolVendor).

This adds the plugin name printing code to the SymbolFile dump method,
and tweak the assertions in the PDB tests to match it correctly.

Modified:
lldb/trunk/lit/SymbolFile/PDB/class-layout.test
lldb/trunk/lit/SymbolFile/PDB/compilands.test
lldb/trunk/lit/SymbolFile/PDB/func-symbols.test
lldb/trunk/lit/SymbolFile/PDB/type-quals.test
lldb/trunk/lit/SymbolFile/PDB/typedefs.test
lldb/trunk/lit/SymbolFile/PDB/variables.test
lldb/trunk/source/Symbol/SymbolFile.cpp

Modified: lldb/trunk/lit/SymbolFile/PDB/class-layout.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/class-layout.test?rev=367835&r1=367834&r2=367835&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/class-layout.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/class-layout.test Mon Aug  5 04:29:01 2019
@@ -13,7 +13,7 @@ RUN: lldb-test symbols %T/ClassLayoutTes
 RUN: lldb-test symbols %T/ClassLayoutTest.cpp.exe | FileCheck 
--check-prefix=CLASS %s
 
 CHECK: Module [[MOD:.*]]
-CHECK: {{^[0-9A-F]+}}: SymbolVendor pdb ([[MOD]])
+CHECK: SymbolFile pdb ([[MOD]])
 CHECK: {{^[0-9A-F]+}}:   CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", 
file = '{{.*}}\ClassLayoutTest.cpp'
 
 ENUM:  name = "Enum", size = 4,  decl = ClassLayoutTest.cpp:5

Modified: lldb/trunk/lit/SymbolFile/PDB/compilands.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/compilands.test?rev=367835&r1=367834&r2=367835&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/compilands.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/compilands.test Mon Aug  5 04:29:01 2019
@@ -7,5 +7,5 @@ RUN: env LLDB_USE_NATIVE_PDB_READER=0 ll
 ; Link default libraries
 
 CHECK: Module [[CU:.*]]
-CHECK: {{^[0-9A-F]+}}: SymbolVendor pdb ([[CU]])
+CHECK: SymbolFile pdb ([[CU]])
 CHECK: {{^[0-9A-F]+}}:   CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", 
file = '{{.*}}\CompilandsTest.cpp'

Modified: lldb/trunk/lit/SymbolFile/PDB/func-symbols.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/func-symbols.test?rev=367835&r1=367834&r2=367835&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/func-symbols.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/func-symbols.test Mon Aug  5 04:29:01 2019
@@ -7,7 +7,7 @@ RUN: lldb-test symbols %T/FuncSymbolsTes
 ; In this test, We don't check demangled name of a mangled function.
 
 CHECK-ONE: Module [[MD:.*]]
-CHECK-ONE-DAG: {{.*}}: SymbolVendor pdb ([[MD]])
+CHECK-ONE-DAG: SymbolFile pdb ([[MD]])
 CHECK-ONE-DAG: [[TY0:.*]]:   Type{[[UID0:.*]]} , name = "Func_arg_array", decl 
= FuncSymbolsTestMain.cpp:3, compiler_type = {{.*}} int (int *)
 CHECK-ONE-DAG: [[TY1:.*]]:   Type{[[UID1:.*]]} , name = "Func_arg_void", decl 
= FuncSymbolsTestMain.cpp:4, compiler_type = {{.*}} void (void)
 CHECK-ONE-DAG: [[TY2:.*]]:   Type{[[UID2:.*]]} , name = "Func_arg_none", decl 
= FuncSymbolsTestMain.cpp:5, compiler_type = {{.*}} void (void)

Modified: lldb/trunk/lit/SymbolFile/PDB/type-quals.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/type-quals.test?rev=367835&r1=367834&r2=367835&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/type-quals.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/type-quals.test Mon Aug  5 04:29:01 2019
@@ -4,7 +4,7 @@ RUN: %build --compiler=msvc --mode=link
 RUN: lldb-test symbols %T/TypeQualsTest.cpp.exe | FileCheck %s
 
 CHECK: Module [[MOD:.*]]
-CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor pdb ([[MOD]])
+CHECK-DAG: SymbolFile pdb ([[MOD]])
 CHECK-DAG:  Type{{.*}} , name = "const int", size = 4, compiler_type = 
{{.*}} const int
 CHECK-DAG:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int *
 CHECK-DAG:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int **const

Modified: lldb/trunk/lit/SymbolFile/PDB/typedefs.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/typedefs.test?rev=367835&r1=367834&r2=367835&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/typedefs.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/typedefs.test Mon Aug  5 04:29:01 2019
@@ -12,7 +12,7 @@ RUN: lldb-test symbols %T/SimpleTypesTes
 ; both of them is the same.
 
 CHECK: Module [[MOD:.*]]
-CHECK: {{^[0-9A-F]+}}: SymbolVendor pdb ([[MOD]])
+CHECK: SymbolFile pdb ([[MOD]])
 CHECK-DAG: name = "char32_

[Lldb-commits] [lldb] r367842 - [lldb] Move redundant persistent variable counter to ClangPersistentVariables

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 05:32:59 2019
New Revision: 367842

URL: http://llvm.org/viewvc/llvm-project?rev=367842&view=rev
Log:
[lldb] Move redundant persistent variable counter to ClangPersistentVariables

Currently Target::m_next_persistent_variable_index is counting up
for our persistent variables ($0, $1, ...) but we also have a
unused counter that is supposed to do this in
ClangPersistentVariables but that stays always at 0 (because
we currently increase the target counter when we should increase
that unused counter).

This patch removes the counter in Target and lets the documented
counter in ClangPersistentVariables do the variable counting.

Patch *should* be NFC, but it might unexpectedly bring LLDB to
new code paths that could contain exciting new bugs to fix.

Modified:
lldb/trunk/include/lldb/Expression/ExpressionVariable.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Expression/ExpressionVariable.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h

Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=367842&r1=367841&r2=367842&view=diff
==
--- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original)
+++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Mon Aug  5 05:32:59 
2019
@@ -223,8 +223,8 @@ public:
uint32_t addr_byte_size) = 0;
 
   /// Return a new persistent variable name with the specified prefix.
-  ConstString GetNextPersistentVariableName(Target &target,
-llvm::StringRef prefix);
+  virtual ConstString GetNextPersistentVariableName(Target &target,
+llvm::StringRef prefix) = 0;
 
   virtual llvm::StringRef
   GetPersistentVariablePrefix(bool is_error = false) const = 0;

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=367842&r1=367841&r2=367842&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Mon Aug  5 05:32:59 2019
@@ -1106,11 +1106,6 @@ public:
 
   lldb::ExpressionVariableSP GetPersistentVariable(ConstString name);
 
-  /// Return the next available number for numbered persistent variables.
-  unsigned GetNextPersistentVariableIndex() {
-return m_next_persistent_variable_index++;
-  }
-
   lldb::addr_t GetPersistentSymbol(ConstString name);
 
   /// This method will return the address of the starting function for
@@ -1320,7 +1315,6 @@ protected:
   bool m_valid;
   bool m_suppress_stop_hooks;
   bool m_is_dummy_target;
-  unsigned m_next_persistent_variable_index = 0;
 
   static void ImageSearchPathsChanged(const PathMappingList &path_list,
   void *baton);

Modified: lldb/trunk/source/Expression/ExpressionVariable.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionVariable.cpp?rev=367842&r1=367841&r2=367842&view=diff
==
--- lldb/trunk/source/Expression/ExpressionVariable.cpp (original)
+++ lldb/trunk/source/Expression/ExpressionVariable.cpp Mon Aug  5 05:32:59 2019
@@ -76,13 +76,3 @@ void PersistentExpressionState::Register
 }
   }
 }
-
-ConstString PersistentExpressionState::GetNextPersistentVariableName(
-Target &target, llvm::StringRef Prefix) {
-  llvm::SmallString<64> name;
-  {
-llvm::raw_svector_ostream os(name);
-os << Prefix << target.GetNextPersistentVariableIndex();
-  }
-  return ConstString(name);
-}

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h?rev=367842&r1=367841&r2=367842&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
Mon Aug  5 05:32:59 2019
@@ -45,8 +45,18 @@ public:
   uint32_t addr_byte_size) override;
 
   void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
-  llvm::StringRef
-  GetPersistentVariablePrefix(bool is_error) const override {
+
+  ConstString GetNextPersistentVariableName(Target &target,
+  llvm::StringRef prefix) override {
+llvm::SmallString<64> name;
+{
+  llvm::raw_svector_ostream os(name);
+  os << prefix << m_next_persistent_variable_id++;
+}
+return ConstString(name);
+  }
+
+  llvm::StringRef GetPersistentVariablePrefix(bool is_error) const override {
 return "$";

[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding a current working directory in a VFS mapping.

2019-08-05 Thread Sam McCall via Phabricator via lldb-commits
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

It seems conceptually a little strange to have the working directory be part of 
a serialized "FS", as it's fundamentally a property of a process and only 
transiently a property of the VFS.
I don't know this is fatal (not sure what else the RedirectingFileSystem might 
be used for.

What's the reason to store this as part of the VFS rather than as a separate 
attribute of the larger reproducer structure?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65677



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


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding a current working directory in a VFS mapping.

2019-08-05 Thread Sam McCall via Phabricator via lldb-commits
sammccall requested changes to this revision.
sammccall added a comment.
This revision now requires changes to proceed.

Oops, didn't mean to mark as accepted.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65677



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


[Lldb-commits] [PATCH] D65739: [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: jingham, clayborg.

It seems this was an unintended side-effect of D26698 
. AFAICT, these
functions did return an empty string before that patch, and the patch
contained code which attempted to ensure that, but those efforts were
negated by ConstString::AsCString, which by default returns a nullptr
even for empty strings.

This patch:

- fixes the GetOutput/Error methods to really return empty strings
- adds and explicit test for that
- removes a workaround in lldbtest.py, which was masking this problem from our 
other tests


https://reviews.llvm.org/D65739

Files:
  packages/Python/lldbsuite/test/lldbtest.py
  
packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
  source/API/SBCommandReturnObject.cpp


Index: source/API/SBCommandReturnObject.cpp
===
--- source/API/SBCommandReturnObject.cpp
+++ source/API/SBCommandReturnObject.cpp
@@ -72,10 +72,8 @@
   LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetOutput);
 
   if (m_opaque_up) {
-llvm::StringRef output = m_opaque_up->GetOutputData();
-ConstString result(output.empty() ? llvm::StringRef("") : output);
-
-return result.AsCString();
+ConstString output(m_opaque_up->GetOutputData());
+return output.AsCString(/*value_if_empty*/ "");
   }
 
   return nullptr;
@@ -85,9 +83,8 @@
   LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetError);
 
   if (m_opaque_up) {
-llvm::StringRef output = m_opaque_up->GetErrorData();
-ConstString result(output.empty() ? llvm::StringRef("") : output);
-return result.AsCString();
+ConstString output(m_opaque_up->GetErrorData());
+return output.AsCString(/*value_if_empty*/ "");
   }
 
   return nullptr;
Index: 
packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
===
--- 
packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ 
packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -12,6 +12,7 @@
 class CommandInterpreterAPICase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
 
 def setUp(self):
 # Call super's setUp().
@@ -72,3 +73,19 @@
 
 if self.TraceOn():
 lldbutil.print_stacktraces(process)
+
+@add_test_categories(['pyapi'])
+def test_command_output(self):
+"""Test command output handling."""
+ci = self.dbg.GetCommandInterpreter()
+self.assertTrue(ci, VALID_COMMAND_INTERPRETER)
+
+# Test that a command which produces no output returns "" instead of
+# None.
+res = lldb.SBCommandReturnObject()
+ci.HandleCommand("settings set use-color false", res)
+self.assertTrue(res.Succeeded())
+self.assertIsNotNone(res.GetOutput())
+self.assertEquals(res.GetOutput(), "")
+self.assertIsNotNone(res.GetError())
+self.assertEquals(res.GetError(), "")
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -2318,8 +2318,6 @@
 with recording(self, trace) as sbuf:
 print("looking at:", output, file=sbuf)
 
-if output is None:
-output = ""
 # The heading says either "Expecting" or "Not expecting".
 heading = "Expecting" if matching else "Not expecting"
 


Index: source/API/SBCommandReturnObject.cpp
===
--- source/API/SBCommandReturnObject.cpp
+++ source/API/SBCommandReturnObject.cpp
@@ -72,10 +72,8 @@
   LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetOutput);
 
   if (m_opaque_up) {
-llvm::StringRef output = m_opaque_up->GetOutputData();
-ConstString result(output.empty() ? llvm::StringRef("") : output);
-
-return result.AsCString();
+ConstString output(m_opaque_up->GetOutputData());
+return output.AsCString(/*value_if_empty*/ "");
   }
 
   return nullptr;
@@ -85,9 +83,8 @@
   LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetError);
 
   if (m_opaque_up) {
-llvm::StringRef output = m_opaque_up->GetErrorData();
-ConstString result(output.empty() ? llvm::StringRef("") : output);
-return result.AsCString();
+ConstString output(m_opaque_up->GetErrorData());
+return output.AsCString(/*value_if_empty*/ "");
   }
 
   return nullptr;
Index: packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
===
--- packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ packages/Python/lldbsuite/test

[Lldb-commits] [lldb] r367843 - [lldb][NFC] Clang format GetNextPersistentVariableName signature

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 05:37:54 2019
New Revision: 367843

URL: http://llvm.org/viewvc/llvm-project?rev=367843&view=rev
Log:
[lldb][NFC] Clang format GetNextPersistentVariableName signature

Modified:
lldb/trunk/include/lldb/Expression/ExpressionVariable.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h

Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=367843&r1=367842&r2=367843&view=diff
==
--- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original)
+++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Mon Aug  5 05:37:54 
2019
@@ -224,7 +224,7 @@ public:
 
   /// Return a new persistent variable name with the specified prefix.
   virtual ConstString GetNextPersistentVariableName(Target &target,
-llvm::StringRef prefix) = 0;
+llvm::StringRef prefix) = 
0;
 
   virtual llvm::StringRef
   GetPersistentVariablePrefix(bool is_error = false) const = 0;

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h?rev=367843&r1=367842&r2=367843&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
Mon Aug  5 05:37:54 2019
@@ -47,7 +47,7 @@ public:
   void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
 
   ConstString GetNextPersistentVariableName(Target &target,
-  llvm::StringRef prefix) override {
+llvm::StringRef prefix) override {
 llvm::SmallString<64> name;
 {
   llvm::raw_svector_ostream os(name);


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


[Lldb-commits] [PATCH] D65647: Fix line table resolution near the end of a section

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 213342.
labath added a comment.
Herald added a reviewer: jdoerfert.

- redo the patch to keep the logic inside the line table code. I've been

considering whether to do that my self. On one hand, this functionality seems
like it could be useful in other places, but OTOH, the bool argument api is not
really nice. I guess we can keep it this way until we come up with a better way
to do that.

I've kept the module unit test as it seems useful regardless of the fact that
I'm not changing that code.


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

https://reviews.llvm.org/D65647

Files:
  lit/SymbolFile/DWARF/debug-line-basic.s
  lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
  lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
  lit/SymbolFile/DWARF/dir-separator-posix.s
  lit/SymbolFile/DWARF/dir-separator-windows.s
  source/Symbol/LineTable.cpp
  unittests/Core/CMakeLists.txt
  unittests/Core/Inputs/resolve-file-address.yaml
  unittests/Core/ModuleTest.cpp

Index: unittests/Core/ModuleTest.cpp
===
--- /dev/null
+++ unittests/Core/ModuleTest.cpp
@@ -0,0 +1,67 @@
+//===-- ModuleTest.cpp --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/Core/Module.h"
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
+#include "TestingSupport/TestUtilities.h"
+#include "lldb/Core/Section.h"
+#include "lldb/Host/HostInfo.h"
+#include "llvm/Support/FileUtilities.h"
+#include "llvm/Testing/Support/Error.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+namespace {
+class ModuleTest : public testing::Test {
+public:
+  static void SetUpTestCase() {
+FileSystem::Initialize();
+HostInfo::Initialize();
+ObjectFileELF::Initialize();
+SymbolFileSymtab::Initialize();
+  }
+
+  static void TearDownTestCase() {
+SymbolFileSymtab::Terminate();
+ObjectFileELF::Terminate();
+HostInfo::Terminate();
+FileSystem::Terminate();
+  }
+};
+} // namespace
+
+llvm::Optional resolveFileAddress(Module &M, addr_t FileAddr) {
+  Address A;
+  if (M.ResolveFileAddress(FileAddr, A))
+return A;
+  return llvm::None;
+}
+
+TEST_F(ModuleTest, ResolveFileAddress) {
+  llvm::SmallString<128> Obj;
+  ASSERT_EQ(llvm::sys::fs::createTemporaryFile("resolve-file-address-%%",
+   "obj", Obj),
+std::error_code());
+  llvm::FileRemover Deleter(Obj);
+  ASSERT_THAT_ERROR(ReadYAMLObjectFile("resolve-file-address.yaml", Obj),
+llvm::Succeeded());
+
+  ModuleSpec Spec{FileSpec(Obj)};
+  Spec.GetSymbolFileSpec().SetFile(Obj, FileSpec::Style::native);
+  auto M = std::make_shared(Spec);
+
+  ASSERT_TRUE(M->GetSectionList());
+  SectionSP S = M->GetSectionList()->FindSectionByName(ConstString(".text"));
+  ASSERT_TRUE(S);
+
+  EXPECT_EQ(resolveFileAddress(*M, 0x1000), Address(S, 0));
+  EXPECT_EQ(resolveFileAddress(*M, 0x1100), llvm::None);
+}
Index: unittests/Core/Inputs/resolve-file-address.yaml
===
--- /dev/null
+++ unittests/Core/Inputs/resolve-file-address.yaml
@@ -0,0 +1,12 @@
+--- !ELF
+FileHeader:  
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_EXEC
+  Machine: EM_X86_64
+Sections:
+  - Name:.text
+Type:SHT_PROGBITS
+Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
+Address: 0x1000
+Size:0x100
Index: unittests/Core/CMakeLists.txt
===
--- unittests/Core/CMakeLists.txt
+++ unittests/Core/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_lldb_unittest(LLDBCoreTests
   MangledTest.cpp
+  ModuleTest.cpp
   RichManglingContextTest.cpp
   StreamCallbackTest.cpp
   UniqueCStringMapTest.cpp
@@ -18,5 +19,6 @@
 
 set(test_inputs
   mangled-function-names.yaml
+  resolve-file-address.yaml
   )
 add_unittest_inputs(LLDBCoreTests "${test_inputs}")
Index: source/Symbol/LineTable.cpp
===
--- source/Symbol/LineTable.cpp
+++ source/Symbol/LineTable.cpp
@@ -241,33 +241,47 @@
 
 bool LineTable::ConvertEntryAtIndexToLineEntry(uint32_t idx,
LineEntry &line_entry) {
-  if (idx < m_entries.size()) {
-const Entry &entry = m_entries[idx];
-ModuleSP module_sp(m_comp_unit->GetModule());
-if (module_sp &&
-module_sp->ResolveFileAddress(entry.file_addr,
-   

[Lldb-commits] [lldb] r367857 - [lldb][NFC] Fix documentation for ClangPersistentVariables::m_next_persistent_variable_id

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 06:40:39 2019
New Revision: 367857

URL: http://llvm.org/viewvc/llvm-project?rev=367857&view=rev
Log:
[lldb][NFC] Fix documentation for 
ClangPersistentVariables::m_next_persistent_variable_id

Modified:

lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp?rev=367857&r1=367856&r2=367857&view=diff
==
--- 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp 
Mon Aug  5 06:40:39 2019
@@ -23,8 +23,7 @@ using namespace lldb;
 using namespace lldb_private;
 
 ClangPersistentVariables::ClangPersistentVariables()
-: lldb_private::PersistentExpressionState(LLVMCastKind::eKindClang),
-  m_next_persistent_variable_id(0) {}
+: lldb_private::PersistentExpressionState(LLVMCastKind::eKindClang) {}
 
 ExpressionVariableSP ClangPersistentVariables::CreatePersistentVariable(
 const lldb::ValueObjectSP &valobj_sp) {

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h?rev=367857&r1=367856&r2=367857&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h 
Mon Aug  5 06:40:39 2019
@@ -76,8 +76,8 @@ public:
   }
 
 private:
-  uint32_t m_next_persistent_variable_id; ///< The counter used by
-  ///GetNextResultName().
+  // The counter used by GetNextPersistentVariableName
+  uint32_t m_next_persistent_variable_id = 0;
 
   typedef llvm::DenseMap PersistentDeclMap;
   PersistentDeclMap


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


[Lldb-commits] [PATCH] D65717: [lldb][clang] Reflect LangStandard.h move to clang/Basic

2019-08-05 Thread Rainer Orth via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367865: [lldb][clang] Reflect LangStandard.h move to 
clang/Basic (authored by ro, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65717?vs=213240&id=213354#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65717

Files:
  lldb/trunk/source/Symbol/ClangASTContext.cpp


Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -47,11 +47,11 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/FileSystemOptions.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetOptions.h"
 #include "clang/Frontend/FrontendOptions.h"
-#include "clang/Frontend/LangStandard.h"
 #include "clang/Sema/Sema.h"
 
 #ifdef LLDB_DEFINED_NDEBUG_FOR_CLANG
@@ -111,10 +111,10 @@
 static inline bool
 ClangASTContextSupportsLanguage(lldb::LanguageType language) {
   return language == eLanguageTypeUnknown || // Clang is the default type 
system
- Language::LanguageIsC(language) ||
- Language::LanguageIsCPlusPlus(language) ||
- Language::LanguageIsObjC(language) ||
- Language::LanguageIsPascal(language) ||
+ lldb_private::Language::LanguageIsC(language) ||
+ lldb_private::Language::LanguageIsCPlusPlus(language) ||
+ lldb_private::Language::LanguageIsObjC(language) ||
+ lldb_private::Language::LanguageIsPascal(language) ||
  // Use Clang for Rust until there is a proper language plugin for it
  language == eLanguageTypeRust ||
  language == eLanguageTypeExtRenderScript ||
@@ -571,7 +571,7 @@
   // Set some properties which depend solely on the input kind; it would be
   // nice to move these to the language standard, and have the driver resolve
   // the input kind + language standard.
-  if (IK.getLanguage() == InputKind::Asm) {
+  if (IK.getLanguage() == clang::Language::Asm) {
 Opts.AsmPreprocessor = 1;
   } else if (IK.isObjectiveC()) {
 Opts.ObjC = 1;
@@ -582,26 +582,26 @@
   if (LangStd == LangStandard::lang_unspecified) {
 // Based on the base language, pick one.
 switch (IK.getLanguage()) {
-case InputKind::Unknown:
-case InputKind::LLVM_IR:
-case InputKind::RenderScript:
+case clang::Language::Unknown:
+case clang::Language::LLVM_IR:
+case clang::Language::RenderScript:
   llvm_unreachable("Invalid input kind!");
-case InputKind::OpenCL:
+case clang::Language::OpenCL:
   LangStd = LangStandard::lang_opencl10;
   break;
-case InputKind::CUDA:
+case clang::Language::CUDA:
   LangStd = LangStandard::lang_cuda;
   break;
-case InputKind::Asm:
-case InputKind::C:
-case InputKind::ObjC:
+case clang::Language::Asm:
+case clang::Language::C:
+case clang::Language::ObjC:
   LangStd = LangStandard::lang_gnu99;
   break;
-case InputKind::CXX:
-case InputKind::ObjCXX:
+case clang::Language::CXX:
+case clang::Language::ObjCXX:
   LangStd = LangStandard::lang_gnucxx98;
   break;
-case InputKind::HIP:
+case clang::Language::HIP:
   LangStd = LangStandard::lang_hip;
   break;
 }
@@ -901,8 +901,9 @@
 LangOptions *ClangASTContext::getLanguageOptions() {
   if (m_language_options_up == nullptr) {
 m_language_options_up.reset(new LangOptions());
-ParseLangArgs(*m_language_options_up, InputKind::ObjCXX, 
GetTargetTriple());
-//InitializeLangOptions(*m_language_options_up, InputKind::ObjCXX);
+ParseLangArgs(*m_language_options_up, clang::Language::ObjCXX,
+  GetTargetTriple());
+//InitializeLangOptions(*m_language_options_up, Language::ObjCXX);
   }
   return m_language_options_up.get();
 }


Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -47,11 +47,11 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/FileSystemOptions.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetOptions.h"
 #include "clang/Frontend/FrontendOptions.h"
-#include "clang/Frontend/LangStandard.h"
 #include "clang/Sema/Sema.h"
 
 #ifdef LLDB_DEFINED_NDEBUG_FOR_CLANG
@@ -111,10 +111,10 @@
 static inline bool
 ClangASTContextSupportsLanguage(lldb::LanguageType language) {
   return language == eLanguageTypeUnknown || // Clang is the de

[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth added a comment.

Yes, zturner isn't as active here as he was before.

I'm happy to review patches regarding LLDB on Windows, even though I don't know 
much about Mingw.




Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:19
 #endif
+#ifdef __MINGW32__
+// usleep

xbolva00 wrote:
> Maybe drop usleep and use C++’s
> 
> https://en.cppreference.com/w/cpp/thread/sleep_for ?
+1.  usleep is deprecated in POSIX and is essentially meaningless on Windows 
(in terms of how the scheduler works) unless you're waiting 1000 or more 
microseconds.  At this point, sleep_for is likely to be better supported by the 
platforms.



Comment at: lldb/tools/lldb-vscode/VSCode.cpp:19
 #define NOMINMAX
+#ifndef __MINGW32__
 #include 

I would suggest moving the `#ifndef __MINGW32__` up a line to keep the NOMINMAX 
adjacent to the include of Windows.h.  NOMINMAX is relevant only to Windows.h.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:55
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;

Nothing in the rest of this .cpp file uses PATH_MAX, so just delete the 
`#define` instead of executing it conditionally.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691



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


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding a current working directory in a VFS mapping.

2019-08-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65677#1614595 , @sammccall wrote:

> It seems conceptually a little strange to have the working directory be part 
> of a serialized "FS", as it's fundamentally a property of a process and only 
> transiently a property of the VFS.
>  I don't know this is fatal (not sure what else the RedirectingFileSystem 
> might be used for.
>
> What's the reason to store this as part of the VFS rather than as a separate 
> attribute of the larger reproducer structure?


From the reproducer's perspective I would argue that it is a property of the 
VFS. More often than not, the working directory won't exist during replay. That 
needs to be modeled somewhere, and VFS is the obvious candidate. Indeed, the 
VFS already deals with the working directories today. You need special handling 
for this scenario though, because you cannot rely on the underlying (external) 
FS to do the right thing and might have side effects. At the same time, you 
might need to change the current working directory, which is fully supported 
with the current implementation as well. Also note that this functionality is 
completely optional. If no current working directory is set in the yaml 
mapping, things behave like they do today.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65677



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


[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

2019-08-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65611#1613052 , @clayborg wrote:

> Also be careful if the user uses a symlink to not resolve the link. If a user 
> tries to debug clang++:
>
>   $ ls -AFlG 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
>   -rwxr-xr-x  1 root  wheel  8156 Jul 12 21:48 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
>   lrwxr-xr-x  1 root  wheel 5 Jul 25 07:57 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++@
>  -> clang
>
>
> We don't want to resolve it to "clang" or it will change the behavior for any 
> program that checks argv[0] and doesn't something different depending on what 
> that values is.


That's a good point, and something I hadn't considered. If my memory serves me 
right `ResolvePath` doesn't call realpath, but I'd have to double check for 
sure.

One thing I liked about this is that when you're debugging something in your 
PATH it will show you the absolute path, like `/bin/ls` instead of just `ls`.


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

https://reviews.llvm.org/D65611



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


[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

2019-08-05 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D65611#1615018 , @JDevlieghere 
wrote:

> In D65611#1613052 , @clayborg wrote:
>
> > Also be careful if the user uses a symlink to not resolve the link. If a 
> > user tries to debug clang++:
> >
> >   $ ls -AFlG 
> > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
> >   -rwxr-xr-x  1 root  wheel  8156 Jul 12 21:48 
> > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
> >   lrwxr-xr-x  1 root  wheel 5 Jul 25 07:57 
> > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++@
> >  -> clang
> >
> >
> > We don't want to resolve it to "clang" or it will change the behavior for 
> > any program that checks argv[0] and doesn't something different depending 
> > on what that values is.
>
>
> That's a good point, and something I hadn't considered. If my memory serves 
> me right `ResolvePath` doesn't call realpath, but I'd have to double check 
> for sure.


Please do!

> One thing I liked about this is that when you're debugging something in your 
> PATH it will show you the absolute path, like `/bin/ls` instead of just `ls`.

This can be nice, but people also have come to expect interesting things from 
the "argv[0]" over the years. This code is fragile and we do have tests, but we 
should make sure we have plenty of tests to make sure we don't regress. clang 
and clang++ should be a good example to use as clang won't enable C++ by 
default if argv[0] isn't clang++


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

https://reviews.llvm.org/D65611



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


[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

So what if the user doesn't do `lldb ./foo` but instead does `file ./foo` at 
the lldb comand prompt? Then, you'll be back at square one as far as 
reproducers are concerned...


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

https://reviews.llvm.org/D65611



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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Greg Clayton via lldb-commits
The issue is found when parsing the "hb_font_make_immutable" function:


0x00084270: DW_TAG_subprogram
  DW_AT_low_pc  (0x2fb0)
  DW_AT_high_pc (0x2fe4)
  DW_AT_frame_base  (DW_OP_reg29 W29)
  DW_AT_name("hb_font_make_immutable")
  DW_AT_decl_file   (".harfbuzz/src/hb-font.cc")
  DW_AT_decl_line   (1514)
  DW_AT_external(0x01)
  DW_AT_APPLE_optimized (0x01)

0x0008428d:   DW_TAG_formal_parameter
DW_AT_location  (0x8852
   [0x2fb0,  0x2fc0): DW_OP_reg0 W0
   [0x2fc0,  0x2fe0): DW_OP_reg19 W19)
DW_AT_name  ("font")
DW_AT_decl_file (".harfbuzz/src/hb-font.cc")
DW_AT_decl_line (1514)
DW_AT_type  (0x0008431c "hb_font_t*")


The parameter has type 0x0008431c:

0x0008431c: DW_TAG_pointer_type
  DW_AT_type(0x00084322 "hb_font_t")

Which points to 0x00084322:

0x00084322: DW_TAG_typedef
  DW_AT_type(0x00084202 "hb_font_t")
  DW_AT_name("hb_font_t")
  DW_AT_decl_file   (".harfbuzz/src/hb-font.h")
  DW_AT_decl_line   (40)

which points to:

0x00084202: DW_TAG_structure_type
  DW_AT_calling_convention  (DW_CC_pass_by_value)
  DW_AT_name("hb_font_t")
  DW_AT_byte_size   (0x68)
  DW_AT_declaration (0x01)

Boom we crash when parsing the function type. This was compiled with a 
derivative of clang version 6.0.0.

My attempt at a minimal test case was:

$ cat main.cpp
#include "ByValue.h"

void f(ByValueTD *arg) {}

int main() {
  return 0;
}
$ cat ByValue.h
struct ByValue {
   ~ByValue() = default;
};
typedef ByValue ByValueTD;


The I try to compile with:

$ clang++ -g -O0 -std=gnu++11 -stdlib=libc++ -flimit-debug-info main.cpp

But the DWARF from more recent clangs will remove the DW_CC_pass_by_value from 
the ByValue. See the DIE at 0x0082 in the DWARF below, it doesn't contain 
the "DW_AT_calling_convention  (DW_CC_pass_by_value)" anymore.


0x000b: DW_TAG_compile_unit
  DW_AT_producer("Apple LLVM version 10.0.1 
(clang-1001.0.46.4)")
  DW_AT_language(DW_LANG_C_plus_plus)
  DW_AT_name("main.cpp")
  DW_AT_stmt_list   (0x)
  DW_AT_comp_dir("/Users/gclayton/Documents/src/cc_calling")
  DW_AT_low_pc  (0x00010f90)
  DW_AT_high_pc (0x00010faf)

0x002a:   DW_TAG_subprogram
DW_AT_low_pc(0x00010f90)
DW_AT_high_pc   (0x00010f9a)
DW_AT_frame_base(DW_OP_reg6 RBP)
DW_AT_linkage_name  ("_Z1fP7ByValue")
DW_AT_name  ("f")
DW_AT_decl_file 
("/Users/gclayton/Documents/src/cc_calling/main.cpp")
DW_AT_decl_line (3)
DW_AT_external  (true)

0x0043: DW_TAG_formal_parameter
  DW_AT_location(DW_OP_fbreg -8)
  DW_AT_name("arg")
  DW_AT_decl_file   
("/Users/gclayton/Documents/src/cc_calling/main.cpp")
  DW_AT_decl_line   (3)
  DW_AT_type(0x0072 "ByValueTD*")

0x0051: NULL

0x0052:   DW_TAG_subprogram
DW_AT_low_pc(0x00010fa0)
DW_AT_high_pc   (0x00010faf)
DW_AT_frame_base(DW_OP_reg6 RBP)
DW_AT_name  ("main")
DW_AT_decl_file 
("/Users/gclayton/Documents/src/cc_calling/main.cpp")
DW_AT_decl_line (5)
DW_AT_type  (0x006b "int")
DW_AT_external  (true)

0x006b:   DW_TAG_base_type
DW_AT_name  ("int")
DW_AT_encoding  (DW_ATE_signed)
DW_AT_byte_size (0x04)

0x0072:   DW_TAG_pointer_type
DW_AT_type  (0x0077 "ByValueTD")

0x0077:   DW_TAG_typedef
DW_AT_type  (0x0082 "ByValue")
DW_AT_name  ("ByValueTD")
DW_AT_decl_file 
("/Users/gclayton/Documents/src/cc_calling/./ByValue.h")
DW_AT_decl_line (4)

0x0082:   DW_TAG_structure_type
DW_AT_name  ("ByValue")
DW_AT_declaration   (true)

0x0087:   NULL


If we compile with -fno-limit-debug-info we get the "DW_AT_calling_convention 
(DW_CC_pass_by_value)":

0x000b: DW_TAG_compile_unit
  DW_AT_producer("Apple LLVM version 10.0.1 
(clang-1001.0.46.4)")
  DW_AT_language(DW_LANG_C_plus_plus)
  DW_AT_name("main.cpp")
  DW_AT_stmt_list   (0x)
  DW_AT

[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

or `lldb -o "file ./foo"` for that matter. I've seen people who are unaware of 
`-O` do that when they want to execute stuff before the target is set...


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

https://reviews.llvm.org/D65611



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


[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

2019-08-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65611#1615083 , @labath wrote:

> So what if the user doesn't do `lldb ./foo` but instead does `file ./foo` at 
> the lldb comand prompt? Then, you'll be back at square one as far as 
> reproducers are concerned...


We definitely need the VFS change for the reproducers, no argument there. My 
earlier comment was more about the change in general, orthogonal to the 
reproducers.


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

https://reviews.llvm.org/D65611



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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Greg Clayton via lldb-commits
I also tried to obj2yaml the good DWARF and change it, but once you add bytes 
all of the section sizes and offsets are off so that was not very fruitful, so 
I ran into errors when trying to convert the yaml back to and ELF file.

Greg


> On Aug 5, 2019, at 10:01 AM, Greg Clayton  wrote:
> 
> The issue is found when parsing the "hb_font_make_immutable" function:
> 
> 
> 0x00084270: DW_TAG_subprogram
>   DW_AT_low_pc(0x2fb0)
>   DW_AT_high_pc   (0x2fe4)
>   DW_AT_frame_base(DW_OP_reg29 W29)
>   DW_AT_name  ("hb_font_make_immutable")
>   DW_AT_decl_file (".harfbuzz/src/hb-font.cc 
> ")
>   DW_AT_decl_line (1514)
>   DW_AT_external  (0x01)
>   DW_AT_APPLE_optimized   (0x01)
> 
> 0x0008428d:   DW_TAG_formal_parameter
> DW_AT_location(0x8852
>[0x2fb0,  0x2fc0): DW_OP_reg0 W0
>[0x2fc0,  0x2fe0): DW_OP_reg19 W19)
> DW_AT_name("font")
> DW_AT_decl_file   (".harfbuzz/src/hb-font.cc 
> ")
> DW_AT_decl_line   (1514)
> DW_AT_type(0x0008431c "hb_font_t*")
> 
> 
> The parameter has type 0x0008431c:
> 
> 0x0008431c: DW_TAG_pointer_type
>   DW_AT_type  (0x00084322 "hb_font_t")
> 
> Which points to 0x00084322:
> 
> 0x00084322: DW_TAG_typedef
>   DW_AT_type  (0x00084202 "hb_font_t")
>   DW_AT_name  ("hb_font_t")
>   DW_AT_decl_file (".harfbuzz/src/hb-font.h")
>   DW_AT_decl_line (40)
> 
> which points to:
> 
> 0x00084202: DW_TAG_structure_type
>   DW_AT_calling_convention(DW_CC_pass_by_value)
>   DW_AT_name  ("hb_font_t")
>   DW_AT_byte_size (0x68)
>   DW_AT_declaration   (0x01)
> 
> Boom we crash when parsing the function type. This was compiled with a 
> derivative of clang version 6.0.0.
> 
> My attempt at a minimal test case was:
> 
> $ cat main.cpp
> #include "ByValue.h"
> 
> void f(ByValueTD *arg) {}
> 
> int main() {
>   return 0;
> }
> $ cat ByValue.h
> struct ByValue {
>~ByValue() = default;
> };
> typedef ByValue ByValueTD;
> 
> 
> The I try to compile with:
> 
> $ clang++ -g -O0 -std=gnu++11 -stdlib=libc++ -flimit-debug-info main.cpp
> 
> But the DWARF from more recent clangs will remove the DW_CC_pass_by_value 
> from the ByValue. See the DIE at 0x0082 in the DWARF below, it doesn't 
> contain the "DW_AT_calling_convention(DW_CC_pass_by_value)" anymore.
> 
> 
> 0x000b: DW_TAG_compile_unit
>   DW_AT_producer  ("Apple LLVM version 10.0.1 
> (clang-1001.0.46.4)")
>   DW_AT_language  (DW_LANG_C_plus_plus)
>   DW_AT_name  ("main.cpp")
>   DW_AT_stmt_list (0x)
>   DW_AT_comp_dir  ("/Users/gclayton/Documents/src/cc_calling")
>   DW_AT_low_pc(0x00010f90)
>   DW_AT_high_pc   (0x00010faf)
> 
> 0x002a:   DW_TAG_subprogram
> DW_AT_low_pc  (0x00010f90)
> DW_AT_high_pc (0x00010f9a)
> DW_AT_frame_base  (DW_OP_reg6 RBP)
> DW_AT_linkage_name("_Z1fP7ByValue")
> DW_AT_name("f")
> DW_AT_decl_file   
> ("/Users/gclayton/Documents/src/cc_calling/main.cpp")
> DW_AT_decl_line   (3)
> DW_AT_external(true)
> 
> 0x0043: DW_TAG_formal_parameter
>   DW_AT_location  (DW_OP_fbreg -8)
>   DW_AT_name  ("arg")
>   DW_AT_decl_file 
> ("/Users/gclayton/Documents/src/cc_calling/main.cpp")
>   DW_AT_decl_line (3)
>   DW_AT_type  (0x0072 "ByValueTD*")
> 
> 0x0051: NULL
> 
> 0x0052:   DW_TAG_subprogram
> DW_AT_low_pc  (0x00010fa0)
> DW_AT_high_pc (0x00010faf)
> DW_AT_frame_base  (DW_OP_reg6 RBP)
> DW_AT_name("main")
> DW_AT_decl_file   
> ("/Users/gclayton/Documents/src/cc_calling/main.cpp")
> DW_AT_decl_line   (5)
> DW_AT_type(0x006b "int")
> DW_AT_external(true)
> 
> 0x006b:   DW_TAG_base_type
> DW_AT_name("int")
> DW_AT_encoding(DW_ATE_signed)
> DW_AT_byte_size   (0x04)
> 
> 0x0072:   DW_TAG_pointer_type
> DW_AT_type(0x0077 "ByValueTD")
> 
> 0x0077:   DW_TAG_typedef
> DW_AT_type(0x0082 "ByValue")
> DW_AT_name("ByValueTD")
> DW_AT_decl_file   
> ("/Users/gclayton/Docum

Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread via lldb-commits
> I also tried to obj2yaml the good DWARF and change it, but once you
> add bytes all of the section sizes and offsets are off so that was
> not very fruitful, so I ran into errors when trying to convert the
> yaml back to and ELF file.
>
> Greg

Yet another case where a "DWARF assembler" would be useful.
--paulr

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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Greg Clayton via lldb-commits


> On Aug 5, 2019, at 11:11 AM,  
>  wrote:
> 
>> I also tried to obj2yaml the good DWARF and change it, but once you
>> add bytes all of the section sizes and offsets are off so that was
>> not very fruitful, so I ran into errors when trying to convert the
>> yaml back to and ELF file.
>> 
>> Greg
> 
> Yet another case where a "DWARF assembler" would be useful.

Yeah, that is why I made the DWARFGenerator class in 
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp so I can hand craft DWARF 
where I can change offsets and move stuff around. It doesn't create an ELF file 
with section contents for .text or anything though.


> --paulr
> 

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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Pavel Labath via lldb-commits

On 05/08/2019 20:20, Greg Clayton via lldb-commits wrote:




On Aug 5, 2019, at 11:11 AM,   
wrote:


I also tried to obj2yaml the good DWARF and change it, but once you
add bytes all of the section sizes and offsets are off so that was
not very fruitful, so I ran into errors when trying to convert the
yaml back to and ELF file.

Greg


Yet another case where a "DWARF assembler" would be useful.


Yeah, that is why I made the DWARFGenerator class in 
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp so I can hand craft DWARF 
where I can change offsets and move stuff around. It doesn't create an ELF file 
with section contents for .text or anything though.



While it definitely leaves a lot to be desired, I have found it 
relatively easy to take the output of "clang -S", and then tweak the 
generated dwarf assembly to produce the kind of output I need for 
testing various edge cases.


This case also does not sound particularly hard. I'd probably do it by 
taking one of the existing DWARF .s test files and modify it to trigger 
this situation. My first candidate would be 
lit/SymbolFile/DWARF/forward-declarations.s -- it already has a struct 
with a DW_AT_declaration attribute, so probably all that's needed is to 
add a DW_AT_calling_convention to it. The assembly is already updated to 
use symbolic addresses, so no manual fixups of offsets should be needed.


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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Greg Clayton via lldb-commits


> On Aug 5, 2019, at 11:54 AM, Pavel Labath  wrote:
> 
> On 05/08/2019 20:20, Greg Clayton via lldb-commits wrote:
>>> On Aug 5, 2019, at 11:11 AM,  
>>>  wrote:
>>> 
 I also tried to obj2yaml the good DWARF and change it, but once you
 add bytes all of the section sizes and offsets are off so that was
 not very fruitful, so I ran into errors when trying to convert the
 yaml back to and ELF file.
 
 Greg
>>> 
>>> Yet another case where a "DWARF assembler" would be useful.
>> Yeah, that is why I made the DWARFGenerator class in 
>> llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp so I can hand craft DWARF 
>> where I can change offsets and move stuff around. It doesn't create an ELF 
>> file with section contents for .text or anything though.
> 
> While it definitely leaves a lot to be desired, I have found it relatively 
> easy to take the output of "clang -S", and then tweak the generated dwarf 
> assembly to produce the kind of output I need for testing various edge cases.
> 
> This case also does not sound particularly hard. I'd probably do it by taking 
> one of the existing DWARF .s test files and modify it to trigger this 
> situation. My first candidate would be 
> lit/SymbolFile/DWARF/forward-declarations.s -- it already has a struct with a 
> DW_AT_declaration attribute, so probably all that's needed is to add a 
> DW_AT_calling_convention to it. The assembly is already updated to use 
> symbolic addresses, so no manual fixups of offsets should be needed.


Great idea... I always forget about .s files. I was a able to make one from my 
example code when compiled with -flimit-debug-info and then add in the 
DW_AT_calling_convention attribute with a value of DW_CC_pass_by_value. I can 
crash things now so I should be able to make a test case.

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


Re: [Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

2019-08-05 Thread Greg Clayton via lldb-commits
so I can crash LLDB now with:

$ clang -c main.s
$ lldb main.o
(lldb) target create "main.o"
Current executable set to 'main.o' (x86_64).
(lldb) image lookup --verbose --address 0x0008

I can make a python test that can easily do this. Is there a better way that 
people would prefer?

We need something that will get the function for the address and get the 
function's type. Doing this will cause the function type to be realized. This 
is the only way to get the "ByValue" type to be created since looking up the 
type will fail because it is a declaration, but if it is used as a parameter, 
it will be made.

I attached my mach-o .s files below in case anyone wants it.



main.s
Description: Binary data


> On Aug 5, 2019, at 11:54 AM, Pavel Labath  wrote:
> 
> On 05/08/2019 20:20, Greg Clayton via lldb-commits wrote:
>>> On Aug 5, 2019, at 11:11 AM,  
>>>  wrote:
>>> 
 I also tried to obj2yaml the good DWARF and change it, but once you
 add bytes all of the section sizes and offsets are off so that was
 not very fruitful, so I ran into errors when trying to convert the
 yaml back to and ELF file.
 
 Greg
>>> 
>>> Yet another case where a "DWARF assembler" would be useful.
>> Yeah, that is why I made the DWARFGenerator class in 
>> llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp so I can hand craft DWARF 
>> where I can change offsets and move stuff around. It doesn't create an ELF 
>> file with section contents for .text or anything though.
> 
> While it definitely leaves a lot to be desired, I have found it relatively 
> easy to take the output of "clang -S", and then tweak the generated dwarf 
> assembly to produce the kind of output I need for testing various edge cases.
> 
> This case also does not sound particularly hard. I'd probably do it by taking 
> one of the existing DWARF .s test files and modify it to trigger this 
> situation. My first candidate would be 
> lit/SymbolFile/DWARF/forward-declarations.s -- it already has a struct with a 
> DW_AT_declaration attribute, so probably all that's needed is to add a 
> DW_AT_calling_convention to it. The assembly is already updated to use 
> symbolic addresses, so no manual fixups of offsets should be needed.
> 
> pl

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


[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Haibo Huang via Phabricator via lldb-commits
hhb added inline comments.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:55
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;

amccarth wrote:
> Nothing in the rest of this .cpp file uses PATH_MAX, so just delete the 
> `#define` instead of executing it conditionally.
PATH_MAX is used in SendProcessEvent (line 283)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691



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


[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Haibo Huang via Phabricator via lldb-commits
hhb updated this revision to Diff 213448.
hhb marked 4 inline comments as done.
hhb added a comment.

Fix comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691

Files:
  lldb/include/lldb/Host/windows/PosixApi.h
  lldb/source/Host/windows/FileSystem.cpp
  lldb/source/Initialization/SystemInitializerCommon.cpp
  lldb/tools/driver/Platform.h
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -50,7 +50,9 @@
 #include "VSCode.h"
 
 #if defined(_WIN32)
+#ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;
 constexpr const char *dev_null_path = "nul";
 
Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -15,8 +15,10 @@
 #include "llvm/Support/FormatVariadic.h"
 
 #if defined(_WIN32)
+#ifndef __MINGW32__
 #define NOMINMAX
 #include 
+#endif // __MINGW32__
 #include 
 #include 
 #endif
Index: lldb/tools/driver/Platform.h
===
--- lldb/tools/driver/Platform.h
+++ lldb/tools/driver/Platform.h
@@ -15,6 +15,9 @@
 #if defined(_MSC_VER)
 #include 
 #endif
+#if HAVE_SYS_TYPES_H
+#include 
+#endif
 #include "lldb/Host/windows/windows.h"
 #include 
 
Index: lldb/source/Initialization/SystemInitializerCommon.cpp
===
--- lldb/source/Initialization/SystemInitializerCommon.cpp
+++ lldb/source/Initialization/SystemInitializerCommon.cpp
@@ -25,6 +25,7 @@
 #if defined(_WIN32)
 #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
 #include "lldb/Host/windows/windows.h"
+#include 
 #endif
 
 #include "llvm/Support/TargetSelect.h"
Index: lldb/source/Host/windows/FileSystem.cpp
===
--- lldb/source/Host/windows/FileSystem.cpp
+++ lldb/source/Host/windows/FileSystem.cpp
@@ -8,6 +8,7 @@
 
 #include "lldb/Host/windows/windows.h"
 
+#include 
 #include 
 #include 
 #include 
Index: lldb/include/lldb/Host/windows/PosixApi.h
===
--- lldb/include/lldb/Host/windows/PosixApi.h
+++ lldb/include/lldb/Host/windows/PosixApi.h
@@ -45,6 +45,15 @@
 #define S_IRWXG 0
 #define S_IRWXO 0
 
+#ifdef __MINGW32__
+// pyconfig.h typedefs this.  We require python headers to be included before
+// any LLDB headers, but there's no way to prevent python's pid_t definition
+// from leaking, so this is the best option.
+#ifndef NO_PID_T
+#include 
+#endif
+#endif // __MINGW32__
+
 #ifdef _MSC_VER
 
 // PRIxxx format macros for printf()
@@ -80,6 +89,8 @@
 char *strcasestr(const char *s, const char *find);
 char *realpath(const char *name, char *resolved);
 
+#ifdef _MSC_VER
+
 int usleep(uint32_t useconds);
 char *basename(char *path);
 char *dirname(char *path);
@@ -87,6 +98,8 @@
 int strcasecmp(const char *s1, const char *s2);
 int strncasecmp(const char *s1, const char *s2, size_t n);
 
+#endif // _MSC_VER
+
 // empty functions
 inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r367922 - [lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 13:31:47 2019
New Revision: 367922

URL: http://llvm.org/viewvc/llvm-project?rev=367922&view=rev
Log:
[lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr

The UpdateLanguageForExpr should only update the language, but over
time it started to do also do different things related to the generation
of the expression source code. This patch refactors all the source code
generation part into its own function.

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=367922&r1=367921&r2=367922&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp 
Mon Aug  5 13:31:47 2019
@@ -378,10 +378,21 @@ static void SetupDeclVendor(ExecutionCon
   }
 }
 
-void ClangUserExpression::UpdateLanguageForExpr(
+void ClangUserExpression::UpdateLanguageForExpr() {
+  m_expr_lang = lldb::LanguageType::eLanguageTypeUnknown;
+  if (m_options.GetExecutionPolicy() == eExecutionPolicyTopLevel)
+return;
+  if (m_in_cplusplus_method)
+m_expr_lang = lldb::eLanguageTypeC_plus_plus;
+  else if (m_in_objectivec_method)
+m_expr_lang = lldb::eLanguageTypeObjC;
+  else
+m_expr_lang = lldb::eLanguageTypeC;
+}
+
+void ClangUserExpression::CreateSourceCode(
 DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx,
 std::vector modules_to_import, bool for_completion) {
-  m_expr_lang = lldb::LanguageType::eLanguageTypeUnknown;
 
   std::string prefix = m_expr_prefix;
 
@@ -390,14 +401,7 @@ void ClangUserExpression::UpdateLanguage
   } else {
 std::unique_ptr source_code(
 ClangExpressionSourceCode::CreateWrapped(prefix.c_str(),
-m_expr_text.c_str()));
-
-if (m_in_cplusplus_method)
-  m_expr_lang = lldb::eLanguageTypeC_plus_plus;
-else if (m_in_objectivec_method)
-  m_expr_lang = lldb::eLanguageTypeObjC;
-else
-  m_expr_lang = lldb::eLanguageTypeC;
+ m_expr_text.c_str()));
 
 if (!source_code->GetText(m_transformed_text, m_expr_lang,
   m_in_static_method, exe_ctx, !m_ctx_obj,
@@ -506,8 +510,8 @@ bool ClangUserExpression::PrepareForPars
   LLDB_LOG(log, "List of imported modules in expression: {0}",
llvm::make_range(used_modules.begin(), used_modules.end()));
 
-  UpdateLanguageForExpr(diagnostic_manager, exe_ctx, used_modules,
-for_completion);
+  UpdateLanguageForExpr();
+  CreateSourceCode(diagnostic_manager, exe_ctx, used_modules, for_completion);
   return true;
 }
 

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h?rev=367922&r1=367921&r2=367922&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h Mon 
Aug  5 13:31:47 2019
@@ -176,10 +176,11 @@ private:
 DiagnosticManager &diagnostic_manager) override;
 
   std::vector GetModulesToImport(ExecutionContext &exe_ctx);
-  void UpdateLanguageForExpr(DiagnosticManager &diagnostic_manager,
- ExecutionContext &exe_ctx,
- std::vector modules_to_import,
- bool for_completion);
+  void CreateSourceCode(DiagnosticManager &diagnostic_manager,
+ExecutionContext &exe_ctx,
+std::vector modules_to_import,
+bool for_completion);
+  void UpdateLanguageForExpr();
   bool SetupPersistentState(DiagnosticManager &diagnostic_manager,
ExecutionContext &exe_ctx);
   bool PrepareForParsing(DiagnosticManager &diagnostic_manager,


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


[Lldb-commits] [lldb] r367936 - [lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable

2019-08-05 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Aug  5 14:43:53 2019
New Revision: 367936

URL: http://llvm.org/viewvc/llvm-project?rev=367936&view=rev
Log:
[lldb][NFC] Document and refactor 
ClangPersistentVariables::RemovePersistentVariable

Modified:

lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp?rev=367936&r1=367935&r2=367936&view=diff
==
--- 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp 
Mon Aug  5 14:43:53 2019
@@ -42,13 +42,25 @@ void ClangPersistentVariables::RemovePer
 lldb::ExpressionVariableSP variable) {
   RemoveVariable(variable);
 
-  const char *name = variable->GetName().AsCString();
+  // Check if the removed variable was the last one that was created. If yes,
+  // reuse the variable id for the next variable.
 
-  if (*name != '$')
+  // Nothing to do if we have not assigned a variable id so far.
+  if (m_next_persistent_variable_id == 0)
 return;
-  name++;
 
-  if (strtoul(name, nullptr, 0) == m_next_persistent_variable_id - 1)
+  llvm::StringRef name = variable->GetName().GetStringRef();
+  // Remove the prefix from the variable that only the indes is left.
+  if (!name.consume_front(GetPersistentVariablePrefix(false)))
+return;
+
+  // Check if the variable contained a variable id.
+  uint32_t variable_id;
+  if (name.getAsInteger(10, variable_id))
+return;
+  // If it's the most recent variable id that was assigned, make sure that this
+  // variable id will be used for the next persistent variable.
+  if (variable_id == m_next_persistent_variable_id - 1)
 m_next_persistent_variable_id--;
 }
 


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


[Lldb-commits] [PATCH] D65566: [lldb][CMake] Workaround debugserver code-signing issue in generated Xcode project

2019-08-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65566#1612051 , @sgraenitz wrote:

> In D65566#1611007 , @JDevlieghere 
> wrote:
>
> > Is there a way to use the debugserver in the framework instead?
>
>
> This patch is about the debugserver in the framework. It must be signed, 
> because the lldb driver uses it implicitly and, apparently, that is the 
> correct behavior.
>  debugserver is built as `bin/debugserver` and copied to 
> `bin/LLDB.framework/Resources/debugserver` (the latter is currently not 
> signed in Xcode builds).


Ok, thanks, I misunderstood and thought it was the other way around.

>> This seems like the inverse of the problem we had earlier with the RPATHs, 
>> where we would fix them up in the build tree after copying them.
> 
> It's purely about the functionality of the build-tree lldb.
> 
> BTW The problem you may refer to (--> 
> https://reviews.llvm.org/D61952#change-2C1slKxbErMH ?) is unrelated, but it's 
> still existing when installing with the framework. Currently it doesn't show 
> up upstream, because in practice configuration-order defines install-order. 
> So, we are good as long as tools that go into the framework are configured 
> after the framework.

Yep, that's the thing I had in mind.

Anyway, what I was trying to express is that this change feels ad-hoc and I'm 
wondering if we can tackle it more structurally.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65566



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


[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth marked an inline comment as done.
amccarth added inline comments.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:55
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;

hhb wrote:
> amccarth wrote:
> > Nothing in the rest of this .cpp file uses PATH_MAX, so just delete the 
> > `#define` instead of executing it conditionally.
> PATH_MAX is used in SendProcessEvent (line 283)
Got it.  When I asked Phabricator to show me all the lines, it didn't show me 
_all_ the lines.

That said, it seems unfortunate that it's yet another fixed-length filename 
buffer instead of getting a ConstString from the FileSpec.  But that's outside 
the scope of this change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691



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


[Lldb-commits] [PATCH] D65781: [CompilerType] Remove an unused function.

2019-08-05 Thread Davide Italiano via Phabricator via lldb-commits
davide created this revision.
davide added reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss.
Herald added a project: LLDB.

This simplifies the interface, as I'm trying to understand how
we can upstream swift support.

rdar://problem/36377967


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65781

Files:
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/CompilerType.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/CompilerType.cpp

Index: lldb/source/Symbol/CompilerType.cpp
===
--- lldb/source/Symbol/CompilerType.cpp
+++ lldb/source/Symbol/CompilerType.cpp
@@ -729,13 +729,6 @@
   return UINT32_MAX;
 }
 
-size_t CompilerType::ConvertStringToFloatValue(const char *s, uint8_t *dst,
-   size_t dst_size) const {
-  if (IsValid())
-return m_type_system->ConvertStringToFloatValue(m_type, s, dst, dst_size);
-  return 0;
-}
-
 // Dumping types
 #define DEPTH_INCREMENT 2
 
Index: lldb/source/Symbol/ClangASTContext.cpp
===
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -9067,39 +9067,6 @@
   return CompilerType();
 }
 
-size_t
-ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) {
-  if (type) {
-clang::QualType qual_type(GetCanonicalQualType(type));
-uint32_t count = 0;
-bool is_complex = false;
-if (IsFloatingPointType(type, count, is_complex)) {
-  // TODO: handle complex and vector types
-  if (count != 1)
-return false;
-
-  llvm::StringRef s_sref(s);
-  llvm::APFloat ap_float(getASTContext()->getFloatTypeSemantics(qual_type),
- s_sref);
-
-  const uint64_t bit_size = getASTContext()->getTypeSize(qual_type);
-  const uint64_t byte_size = bit_size / 8;
-  if (dst_size >= byte_size) {
-Scalar scalar = ap_float.bitcastToAPInt().zextOrTrunc(
-llvm::NextPowerOf2(byte_size) * 8);
-lldb_private::Status get_data_error;
-if (scalar.GetAsMemoryData(dst, byte_size,
-   lldb_private::endian::InlHostByteOrder(),
-   get_data_error))
-  return byte_size;
-  }
-}
-  }
-  return 0;
-}
-
 // Dumping types
 #define DEPTH_INCREMENT 2
 
Index: lldb/include/lldb/Symbol/TypeSystem.h
===
--- lldb/include/lldb/Symbol/TypeSystem.h
+++ lldb/include/lldb/Symbol/TypeSystem.h
@@ -376,12 +376,6 @@
lldb::offset_t data_offset,
size_t data_byte_size) = 0;
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  virtual size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) = 0;
-
   // TODO: Determine if these methods should move to ClangASTContext.
 
   virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type,
Index: lldb/include/lldb/Symbol/CompilerType.h
===
--- lldb/include/lldb/Symbol/CompilerType.h
+++ lldb/include/lldb/Symbol/CompilerType.h
@@ -336,13 +336,6 @@
 
   bool IsMeaninglessWithoutDynamicResolution() const;
 
-  // Pointers & References
-
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(const char *s, uint8_t *dst,
-   size_t dst_size) const;
-
   // Dumping types
 
 #ifndef NDEBUG
Index: lldb/include/lldb/Symbol/ClangASTContext.h
===
--- lldb/include/lldb/Symbol/ClangASTContext.h
+++ lldb/include/lldb/Symbol/ClangASTContext.h
@@ -879,12 +879,6 @@
   static CompilerType CreateMemberPointerType(const CompilerType &type,
   const CompilerType &pointee_type);
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) override;
-
   // Dumping types
 #ifndef NDEBUG
   /// Convenience LLVM-style dump method for use in the debugger only.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-c

[Lldb-commits] [PATCH] D65781: [CompilerType] Remove an unused function.

2019-08-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Interesting...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65781



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


[Lldb-commits] [lldb] r367946 - [CompilerType] Remove an unused function.

2019-08-05 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Aug  5 16:18:00 2019
New Revision: 367946

URL: http://llvm.org/viewvc/llvm-project?rev=367946&view=rev
Log:
[CompilerType] Remove an unused function.

Summary:
This simplifies the interface, as I'm trying to understand how
we can upstream swift support.



Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss

Subscribers: lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerType.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=367946&r1=367945&r2=367946&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Aug  5 16:18:00 2019
@@ -879,12 +879,6 @@ public:
   static CompilerType CreateMemberPointerType(const CompilerType &type,
   const CompilerType 
&pointee_type);
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) override;
-
   // Dumping types
 #ifndef NDEBUG
   /// Convenience LLVM-style dump method for use in the debugger only.

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=367946&r1=367945&r2=367946&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Aug  5 16:18:00 2019
@@ -336,13 +336,6 @@ public:
 
   bool IsMeaninglessWithoutDynamicResolution() const;
 
-  // Pointers & References
-
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(const char *s, uint8_t *dst,
-   size_t dst_size) const;
-
   // Dumping types
 
 #ifndef NDEBUG

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=367946&r1=367945&r2=367946&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Mon Aug  5 16:18:00 2019
@@ -376,12 +376,6 @@ public:
lldb::offset_t data_offset,
size_t data_byte_size) = 0;
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  virtual size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) = 0;
-
   // TODO: Determine if these methods should move to ClangASTContext.
 
   virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type,

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=367946&r1=367945&r2=367946&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Aug  5 16:18:00 2019
@@ -9067,39 +9067,6 @@ ClangASTContext::CreateMemberPointerType
   return CompilerType();
 }
 
-size_t
-ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) {
-  if (type) {
-clang::QualType qual_type(GetCanonicalQualType(type));
-uint32_t count = 0;
-bool is_complex = false;
-if (IsFloatingPointType(type, count, is_complex)) {
-  // TODO: handle complex and vector types
-  if (count != 1)
-return false;
-
-  llvm::StringRef s_sref(s);
-  llvm::APFloat ap_float(getASTContext()->getFloatTypeSemantics(qual_type),
- s_sref);
-
-  const uint64_t bit_size = getASTContext()->getTypeSize(qual_type);
-  const uint64_t byte_size = bit_size / 8;
-  if (dst_size >= byte_size) {
-Scalar scalar = ap_float.bitcastToAPInt().zextOrTrunc(
-llvm::NextPowerOf2(byte_size) * 8);
-lldb_private::Status get_data_e

[Lldb-commits] [PATCH] D65781: [CompilerType] Remove an unused function.

2019-08-05 Thread Davide Italiano via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367946: [CompilerType] Remove an unused function. (authored 
by davide, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65781?vs=213487&id=213488#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65781

Files:
  lldb/trunk/include/lldb/Symbol/ClangASTContext.h
  lldb/trunk/include/lldb/Symbol/CompilerType.h
  lldb/trunk/include/lldb/Symbol/TypeSystem.h
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Symbol/CompilerType.cpp

Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -9067,39 +9067,6 @@
   return CompilerType();
 }
 
-size_t
-ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) {
-  if (type) {
-clang::QualType qual_type(GetCanonicalQualType(type));
-uint32_t count = 0;
-bool is_complex = false;
-if (IsFloatingPointType(type, count, is_complex)) {
-  // TODO: handle complex and vector types
-  if (count != 1)
-return false;
-
-  llvm::StringRef s_sref(s);
-  llvm::APFloat ap_float(getASTContext()->getFloatTypeSemantics(qual_type),
- s_sref);
-
-  const uint64_t bit_size = getASTContext()->getTypeSize(qual_type);
-  const uint64_t byte_size = bit_size / 8;
-  if (dst_size >= byte_size) {
-Scalar scalar = ap_float.bitcastToAPInt().zextOrTrunc(
-llvm::NextPowerOf2(byte_size) * 8);
-lldb_private::Status get_data_error;
-if (scalar.GetAsMemoryData(dst, byte_size,
-   lldb_private::endian::InlHostByteOrder(),
-   get_data_error))
-  return byte_size;
-  }
-}
-  }
-  return 0;
-}
-
 // Dumping types
 #define DEPTH_INCREMENT 2
 
Index: lldb/trunk/source/Symbol/CompilerType.cpp
===
--- lldb/trunk/source/Symbol/CompilerType.cpp
+++ lldb/trunk/source/Symbol/CompilerType.cpp
@@ -729,13 +729,6 @@
   return UINT32_MAX;
 }
 
-size_t CompilerType::ConvertStringToFloatValue(const char *s, uint8_t *dst,
-   size_t dst_size) const {
-  if (IsValid())
-return m_type_system->ConvertStringToFloatValue(m_type, s, dst, dst_size);
-  return 0;
-}
-
 // Dumping types
 #define DEPTH_INCREMENT 2
 
Index: lldb/trunk/include/lldb/Symbol/CompilerType.h
===
--- lldb/trunk/include/lldb/Symbol/CompilerType.h
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h
@@ -336,13 +336,6 @@
 
   bool IsMeaninglessWithoutDynamicResolution() const;
 
-  // Pointers & References
-
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(const char *s, uint8_t *dst,
-   size_t dst_size) const;
-
   // Dumping types
 
 #ifndef NDEBUG
Index: lldb/trunk/include/lldb/Symbol/TypeSystem.h
===
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h
@@ -376,12 +376,6 @@
lldb::offset_t data_offset,
size_t data_byte_size) = 0;
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  virtual size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) = 0;
-
   // TODO: Determine if these methods should move to ClangASTContext.
 
   virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type,
Index: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
===
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h
@@ -879,12 +879,6 @@
   static CompilerType CreateMemberPointerType(const CompilerType &type,
   const CompilerType &pointee_type);
 
-  // Converts "s" to a floating point value and place resulting floating point
-  // bytes in the "dst" buffer.
-  size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
-   const char *s, uint8_t *dst,
-   size_t dst_size) override;
-
   // Dumping 

[Lldb-commits] [PATCH] D65782: [CompilerType] Simplify the interface a bit more..

2019-08-05 Thread Davide Italiano via Phabricator via lldb-commits
davide created this revision.
davide added reviewers: shafik, JDevlieghere, alex, compnerd, teemperor.
Herald added a project: LLDB.

.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
confident this was introduced to support swift, where
static types [without dynamic counterpart] don't carry a lot
of value. Since then, the formatters and dynamic type resolution
has been rewritten, and we employ different solutions. This function
is unused here too, so let's get read of it.

rdar://problem/36377967


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65782

Files:
  lldb/include/lldb/Symbol/CompilerType.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/Symbol/CompilerType.cpp
  lldb/source/Symbol/TypeSystem.cpp

Index: lldb/source/Symbol/TypeSystem.cpp
===
--- lldb/source/Symbol/TypeSystem.cpp
+++ lldb/source/Symbol/TypeSystem.cpp
@@ -125,10 +125,6 @@
   return eLazyBoolCalculate;
 }
 
-bool TypeSystem::IsMeaninglessWithoutDynamicResolution(void *type) {
-  return false;
-}
-
 ConstString TypeSystem::DeclGetMangledName(void *opaque_decl) {
   return ConstString();
 }
Index: lldb/source/Symbol/CompilerType.cpp
===
--- lldb/source/Symbol/CompilerType.cpp
+++ lldb/source/Symbol/CompilerType.cpp
@@ -709,12 +709,6 @@
   return eLazyBoolCalculate;
 }
 
-bool CompilerType::IsMeaninglessWithoutDynamicResolution() const {
-  if (IsValid())
-return m_type_system->IsMeaninglessWithoutDynamicResolution(m_type);
-  return false;
-}
-
 // Get the index of the child of "clang_type" whose name matches. This function
 // doesn't descend into the children, but only looks one level deep and name
 // matches can include base class names.
Index: lldb/source/DataFormatters/FormatManager.cpp
===
--- lldb/source/DataFormatters/FormatManager.cpp
+++ lldb/source/DataFormatters/FormatManager.cpp
@@ -183,15 +183,13 @@
 reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
   }
 
-  if (!compiler_type.IsMeaninglessWithoutDynamicResolution()) {
-entries.push_back(
-{type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
+  entries.push_back(
+  {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
 
-ConstString display_type_name(compiler_type.GetDisplayTypeName());
-if (display_type_name != type_name)
-  entries.push_back({display_type_name, reason, did_strip_ptr,
- did_strip_ref, did_strip_typedef});
-  }
+  ConstString display_type_name(compiler_type.GetDisplayTypeName());
+  if (display_type_name != type_name)
+entries.push_back({display_type_name, reason, did_strip_ptr, did_strip_ref,
+   did_strip_typedef});
 
   for (bool is_rvalue_ref = true, j = true;
j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) {
@@ -565,10 +563,8 @@
lldb::DynamicValueType use_dynamic) {
   ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable(
   use_dynamic, valobj.IsSynthetic());
-  if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) {
-if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution())
-  return valobj_sp->GetQualifiedTypeName();
-  }
+  if (valobj_sp && valobj_sp->GetCompilerType().IsValid())
+return valobj_sp->GetQualifiedTypeName();
   return ConstString();
 }
 
Index: lldb/include/lldb/Symbol/TypeSystem.h
===
--- lldb/include/lldb/Symbol/TypeSystem.h
+++ lldb/include/lldb/Symbol/TypeSystem.h
@@ -454,20 +454,6 @@
 
   virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
 
-  // Type systems can have types that are placeholder types, which are meant to
-  // indicate the presence of a type, but offer no actual information about
-  // said types, and leave the burden of actually figuring type information out
-  // to dynamic type resolution. For instance a language with a generics
-  // system, can use placeholder types to indicate "type argument goes here",
-  // without promising uniqueness of the placeholder, nor attaching any
-  // actually idenfiable information to said placeholder. This API allows type
-  // systems to tell LLDB when such a type has been encountered In response,
-  // the debugger can react by not using this type as a cache entry in any
-  // type-specific way For instance, LLDB will currently not cache any
-  // formatters that are discovered on such a type as attributable to the
-  // meaningless type itself, instead preferring to use the dynamic type
-  virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
-
 protected:
   const LLVMCastKind m_kind; // Support for llvm casting
   SymbolFile *m_sym_file;
Inde

[Lldb-commits] [PATCH] D65782: [CompilerType] Simplify the interface a bit more..

2019-08-05 Thread Alex Gaynor via Phabricator via lldb-commits
alex added a comment.

I was marked as a review on this, but I suspect you intended to get some other 
Alex :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65782



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


[Lldb-commits] [lldb] r367956 - [CMake] Remove check for the readline target.

2019-08-05 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Aug  5 16:54:13 2019
New Revision: 367956

URL: http://llvm.org/viewvc/llvm-project?rev=367956&view=rev
Log:
[CMake] Remove check for the readline target.

This was introduced when we were building a custom readline Python
module on Linux [1]. Now that the readline  target doesn't exist
anymore, it's safe to remove this dependency.

This fixes https://llvm.org/PR25136

[1] https://reviews.llvm.org/D13268

Modified:
lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=367956&r1=367955&r2=367956&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Aug  5 16:54:13 2019
@@ -209,10 +209,7 @@ if (NOT LLDB_DISABLE_PYTHON)
 DEPENDS ${lldb_scripts_dir}/lldb.py
 COMMENT "Python script sym-linking LLDB Python API")
 
-if (TARGET readline)
-  set(readline_dep readline)
-endif()
-add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper 
${readline_dep})
+add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper)
 set_target_properties(finish_swig swig_wrapper PROPERTIES FOLDER "lldb 
misc")
 
 # Ensure we do the python post-build step when building lldb.


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


[Lldb-commits] [lldb] r367957 - [CompilerType] Simplify the interface a bit more..

2019-08-05 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Aug  5 17:01:52 2019
New Revision: 367957

URL: http://llvm.org/viewvc/llvm-project?rev=367957&view=rev
Log:
[CompilerType] Simplify the interface a bit more..

Summary:
.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
confident this was introduced to support swift, where
static types [without dynamic counterpart] don't carry a lot
of value. Since then, the formatters and dynamic type resolution
has been rewritten, and we employ different solutions. This function
is unused here too, so let's get read of it.



Reviewers: shafik, JDevlieghere, alex, compnerd, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=367957&r1=367956&r2=367957&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Aug  5 17:01:52 2019
@@ -334,8 +334,6 @@ public:
 
   LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const;
 
-  bool IsMeaninglessWithoutDynamicResolution() const;
-
   // Dumping types
 
 #ifndef NDEBUG

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=367957&r1=367956&r2=367957&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Mon Aug  5 17:01:52 2019
@@ -454,20 +454,6 @@ public:
 
   virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
 
-  // Type systems can have types that are placeholder types, which are meant to
-  // indicate the presence of a type, but offer no actual information about
-  // said types, and leave the burden of actually figuring type information out
-  // to dynamic type resolution. For instance a language with a generics
-  // system, can use placeholder types to indicate "type argument goes here",
-  // without promising uniqueness of the placeholder, nor attaching any
-  // actually idenfiable information to said placeholder. This API allows type
-  // systems to tell LLDB when such a type has been encountered In response,
-  // the debugger can react by not using this type as a cache entry in any
-  // type-specific way For instance, LLDB will currently not cache any
-  // formatters that are discovered on such a type as attributable to the
-  // meaningless type itself, instead preferring to use the dynamic type
-  virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
-
 protected:
   const LLVMCastKind m_kind; // Support for llvm casting
   SymbolFile *m_sym_file;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=367957&r1=367956&r2=367957&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Aug  5 17:01:52 2019
@@ -183,15 +183,13 @@ void FormatManager::GetPossibleMatches(
 reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
   }
 
-  if (!compiler_type.IsMeaninglessWithoutDynamicResolution()) {
-entries.push_back(
-{type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
-
-ConstString display_type_name(compiler_type.GetDisplayTypeName());
-if (display_type_name != type_name)
-  entries.push_back({display_type_name, reason, did_strip_ptr,
- did_strip_ref, did_strip_typedef});
-  }
+  entries.push_back(
+  {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
+
+  ConstString display_type_name(compiler_type.GetDisplayTypeName());
+  if (display_type_name != type_name)
+entries.push_back({display_type_name, reason, did_strip_ptr, did_strip_ref,
+   did_strip_typedef});
 
   for (bool is_rvalue_ref = true, j = true;
j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) 
{
@@ -565,10 +563,8 @@ ConstString FormatManager::GetTypeForCac
lldb::DynamicValueType use_dynamic) 
{
   ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable(
   use_dynamic, valobj.IsSynthetic());
-  if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) {
-if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution())
- 

[Lldb-commits] [PATCH] D65782: [CompilerType] Simplify the interface a bit more..

2019-08-05 Thread Davide Italiano via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367957: [CompilerType] Simplify the interface a bit more.. 
(authored by davide, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65782?vs=213492&id=213496#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65782

Files:
  lldb/trunk/include/lldb/Symbol/CompilerType.h
  lldb/trunk/include/lldb/Symbol/TypeSystem.h
  lldb/trunk/source/DataFormatters/FormatManager.cpp
  lldb/trunk/source/Symbol/CompilerType.cpp
  lldb/trunk/source/Symbol/TypeSystem.cpp

Index: lldb/trunk/include/lldb/Symbol/CompilerType.h
===
--- lldb/trunk/include/lldb/Symbol/CompilerType.h
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h
@@ -334,8 +334,6 @@
 
   LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const;
 
-  bool IsMeaninglessWithoutDynamicResolution() const;
-
   // Dumping types
 
 #ifndef NDEBUG
Index: lldb/trunk/include/lldb/Symbol/TypeSystem.h
===
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h
@@ -454,20 +454,6 @@
 
   virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
 
-  // Type systems can have types that are placeholder types, which are meant to
-  // indicate the presence of a type, but offer no actual information about
-  // said types, and leave the burden of actually figuring type information out
-  // to dynamic type resolution. For instance a language with a generics
-  // system, can use placeholder types to indicate "type argument goes here",
-  // without promising uniqueness of the placeholder, nor attaching any
-  // actually idenfiable information to said placeholder. This API allows type
-  // systems to tell LLDB when such a type has been encountered In response,
-  // the debugger can react by not using this type as a cache entry in any
-  // type-specific way For instance, LLDB will currently not cache any
-  // formatters that are discovered on such a type as attributable to the
-  // meaningless type itself, instead preferring to use the dynamic type
-  virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
-
 protected:
   const LLVMCastKind m_kind; // Support for llvm casting
   SymbolFile *m_sym_file;
Index: lldb/trunk/source/Symbol/CompilerType.cpp
===
--- lldb/trunk/source/Symbol/CompilerType.cpp
+++ lldb/trunk/source/Symbol/CompilerType.cpp
@@ -709,12 +709,6 @@
   return eLazyBoolCalculate;
 }
 
-bool CompilerType::IsMeaninglessWithoutDynamicResolution() const {
-  if (IsValid())
-return m_type_system->IsMeaninglessWithoutDynamicResolution(m_type);
-  return false;
-}
-
 // Get the index of the child of "clang_type" whose name matches. This function
 // doesn't descend into the children, but only looks one level deep and name
 // matches can include base class names.
Index: lldb/trunk/source/Symbol/TypeSystem.cpp
===
--- lldb/trunk/source/Symbol/TypeSystem.cpp
+++ lldb/trunk/source/Symbol/TypeSystem.cpp
@@ -125,10 +125,6 @@
   return eLazyBoolCalculate;
 }
 
-bool TypeSystem::IsMeaninglessWithoutDynamicResolution(void *type) {
-  return false;
-}
-
 ConstString TypeSystem::DeclGetMangledName(void *opaque_decl) {
   return ConstString();
 }
Index: lldb/trunk/source/DataFormatters/FormatManager.cpp
===
--- lldb/trunk/source/DataFormatters/FormatManager.cpp
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp
@@ -183,15 +183,13 @@
 reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
   }
 
-  if (!compiler_type.IsMeaninglessWithoutDynamicResolution()) {
-entries.push_back(
-{type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
+  entries.push_back(
+  {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
 
-ConstString display_type_name(compiler_type.GetDisplayTypeName());
-if (display_type_name != type_name)
-  entries.push_back({display_type_name, reason, did_strip_ptr,
- did_strip_ref, did_strip_typedef});
-  }
+  ConstString display_type_name(compiler_type.GetDisplayTypeName());
+  if (display_type_name != type_name)
+entries.push_back({display_type_name, reason, did_strip_ptr, did_strip_ref,
+   did_strip_typedef});
 
   for (bool is_rvalue_ref = true, j = true;
j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) {
@@ -565,10 +563,8 @@
lldb::DynamicValueType use_dynamic) {
   ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailab

[Lldb-commits] [PATCH] D65782: [CompilerType] Simplify the interface a bit more..

2019-08-05 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

In D65782#1615959 , @alex wrote:

> I was marked as a review on this, but I suspect you intended to get some 
> other Alex :-)


yes, sorry. My bad.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65782



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


[Lldb-commits] [lldb] r367963 - Revert "[CompilerType] Simplify the interface a bit more.."

2019-08-05 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Aug  5 17:42:11 2019
New Revision: 367963

URL: http://llvm.org/viewvc/llvm-project?rev=367963&view=rev
Log:
Revert "[CompilerType] Simplify the interface a bit more.."

There's actually a test downstream that fails with this.
I think we can still get rid of it, but I need to do some work
there first.

Modified:
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=367963&r1=367962&r2=367963&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Aug  5 17:42:11 2019
@@ -334,6 +334,8 @@ public:
 
   LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const;
 
+  bool IsMeaninglessWithoutDynamicResolution() const;
+
   // Dumping types
 
 #ifndef NDEBUG

Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=367963&r1=367962&r2=367963&view=diff
==
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Mon Aug  5 17:42:11 2019
@@ -454,6 +454,20 @@ public:
 
   virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
 
+  // Type systems can have types that are placeholder types, which are meant to
+  // indicate the presence of a type, but offer no actual information about
+  // said types, and leave the burden of actually figuring type information out
+  // to dynamic type resolution. For instance a language with a generics
+  // system, can use placeholder types to indicate "type argument goes here",
+  // without promising uniqueness of the placeholder, nor attaching any
+  // actually idenfiable information to said placeholder. This API allows type
+  // systems to tell LLDB when such a type has been encountered In response,
+  // the debugger can react by not using this type as a cache entry in any
+  // type-specific way For instance, LLDB will currently not cache any
+  // formatters that are discovered on such a type as attributable to the
+  // meaningless type itself, instead preferring to use the dynamic type
+  virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
+
 protected:
   const LLVMCastKind m_kind; // Support for llvm casting
   SymbolFile *m_sym_file;

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=367963&r1=367962&r2=367963&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Aug  5 17:42:11 2019
@@ -183,13 +183,15 @@ void FormatManager::GetPossibleMatches(
 reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
   }
 
-  entries.push_back(
-  {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
-
-  ConstString display_type_name(compiler_type.GetDisplayTypeName());
-  if (display_type_name != type_name)
-entries.push_back({display_type_name, reason, did_strip_ptr, did_strip_ref,
-   did_strip_typedef});
+  if (!compiler_type.IsMeaninglessWithoutDynamicResolution()) {
+entries.push_back(
+{type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
+
+ConstString display_type_name(compiler_type.GetDisplayTypeName());
+if (display_type_name != type_name)
+  entries.push_back({display_type_name, reason, did_strip_ptr,
+ did_strip_ref, did_strip_typedef});
+  }
 
   for (bool is_rvalue_ref = true, j = true;
j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) 
{
@@ -563,8 +565,10 @@ ConstString FormatManager::GetTypeForCac
lldb::DynamicValueType use_dynamic) 
{
   ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable(
   use_dynamic, valobj.IsSynthetic());
-  if (valobj_sp && valobj_sp->GetCompilerType().IsValid())
-return valobj_sp->GetQualifiedTypeName();
+  if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) {
+if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution())
+  return valobj_sp->GetQualifiedTypeName();
+  }
   return ConstString();
 }
 

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=367963&r1=367962&r2=367963&view=diff
=

[Lldb-commits] [PATCH] D65784: [lldb] delete "--platform-path" option from "target create"

2019-08-05 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour created this revision.
kusmour added a reviewer: xiaobai.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

This option is dead. lldb under platform mode can resolve the path wether it's 
on remote platform or not
clean the option to avoid misleading


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65784

Files:
  lldb/source/Commands/CommandObjectTarget.cpp


Index: lldb/source/Commands/CommandObjectTarget.cpp
===
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -220,9 +220,6 @@
 m_option_group(), m_arch_option(),
 m_core_file(LLDB_OPT_SET_1, false, "core", 'c', 0, eArgTypeFilename,
 "Fullpath to a core file to use for this target."),
-m_platform_path(LLDB_OPT_SET_1, false, "platform-path", 'P', 0,
-eArgTypePath,
-"Path to the remote file to use for this target."),
 m_symbol_file(LLDB_OPT_SET_1, false, "symfile", 's', 0,
   eArgTypeFilename,
   "Fullpath to a stand alone debug "
@@ -248,7 +245,6 @@
 
 m_option_group.Append(&m_arch_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_core_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-m_option_group.Append(&m_platform_path, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_remote_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_add_dependents, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
@@ -472,7 +468,6 @@
   OptionGroupOptions m_option_group;
   OptionGroupArchitecture m_arch_option;
   OptionGroupFile m_core_file;
-  OptionGroupFile m_platform_path;
   OptionGroupFile m_symbol_file;
   OptionGroupFile m_remote_file;
   OptionGroupDependents m_add_dependents;


Index: lldb/source/Commands/CommandObjectTarget.cpp
===
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -220,9 +220,6 @@
 m_option_group(), m_arch_option(),
 m_core_file(LLDB_OPT_SET_1, false, "core", 'c', 0, eArgTypeFilename,
 "Fullpath to a core file to use for this target."),
-m_platform_path(LLDB_OPT_SET_1, false, "platform-path", 'P', 0,
-eArgTypePath,
-"Path to the remote file to use for this target."),
 m_symbol_file(LLDB_OPT_SET_1, false, "symfile", 's', 0,
   eArgTypeFilename,
   "Fullpath to a stand alone debug "
@@ -248,7 +245,6 @@
 
 m_option_group.Append(&m_arch_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_core_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-m_option_group.Append(&m_platform_path, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_remote_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
 m_option_group.Append(&m_add_dependents, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
@@ -472,7 +468,6 @@
   OptionGroupOptions m_option_group;
   OptionGroupArchitecture m_arch_option;
   OptionGroupFile m_core_file;
-  OptionGroupFile m_platform_path;
   OptionGroupFile m_symbol_file;
   OptionGroupFile m_remote_file;
   OptionGroupDependents m_add_dependents;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Haibo Huang via Phabricator via lldb-commits
hhb updated this revision to Diff 213505.
hhb added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691

Files:
  lldb/include/lldb/Host/windows/PosixApi.h
  lldb/source/Host/windows/FileSystem.cpp
  lldb/source/Initialization/SystemInitializerCommon.cpp
  lldb/tools/driver/Platform.h
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -50,7 +50,9 @@
 #include "VSCode.h"
 
 #if defined(_WIN32)
+#ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;
 constexpr const char *dev_null_path = "nul";
 
Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -15,8 +15,10 @@
 #include "llvm/Support/FormatVariadic.h"
 
 #if defined(_WIN32)
+#ifndef __MINGW32__
 #define NOMINMAX
 #include 
+#endif // __MINGW32__
 #include 
 #include 
 #endif
Index: lldb/tools/driver/Platform.h
===
--- lldb/tools/driver/Platform.h
+++ lldb/tools/driver/Platform.h
@@ -15,6 +15,9 @@
 #if defined(_MSC_VER)
 #include 
 #endif
+#if HAVE_SYS_TYPES_H
+#include 
+#endif
 #include "lldb/Host/windows/windows.h"
 #include 
 
Index: lldb/source/Initialization/SystemInitializerCommon.cpp
===
--- lldb/source/Initialization/SystemInitializerCommon.cpp
+++ lldb/source/Initialization/SystemInitializerCommon.cpp
@@ -25,6 +25,7 @@
 #if defined(_WIN32)
 #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
 #include "lldb/Host/windows/windows.h"
+#include 
 #endif
 
 #include "llvm/Support/TargetSelect.h"
Index: lldb/source/Host/windows/FileSystem.cpp
===
--- lldb/source/Host/windows/FileSystem.cpp
+++ lldb/source/Host/windows/FileSystem.cpp
@@ -8,6 +8,7 @@
 
 #include "lldb/Host/windows/windows.h"
 
+#include 
 #include 
 #include 
 #include 
Index: lldb/include/lldb/Host/windows/PosixApi.h
===
--- lldb/include/lldb/Host/windows/PosixApi.h
+++ lldb/include/lldb/Host/windows/PosixApi.h
@@ -45,6 +45,15 @@
 #define S_IRWXG 0
 #define S_IRWXO 0
 
+#ifdef __MINGW32__
+// pyconfig.h typedefs this.  We require python headers to be included before
+// any LLDB headers, but there's no way to prevent python's pid_t definition
+// from leaking, so this is the best option.
+#ifndef NO_PID_T
+#include 
+#endif
+#endif // __MINGW32__
+
 #ifdef _MSC_VER
 
 // PRIxxx format macros for printf()
@@ -80,12 +89,16 @@
 char *strcasestr(const char *s, const char *find);
 char *realpath(const char *name, char *resolved);
 
+#ifdef _MSC_VER
+
 char *basename(char *path);
 char *dirname(char *path);
 
 int strcasecmp(const char *s1, const char *s2);
 int strncasecmp(const char *s1, const char *s2, size_t n);
 
+#endif // _MSC_VER
+
 // empty functions
 inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65784: [lldb] delete "--platform-path" option from "target create"

2019-08-05 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Yeah, it's not currently hooked up to anything; I'm returning to 
remote-platform testing soon, if we've lost some necessary functionality I can 
re-add it, but this option right now isn't doing anything.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65784



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


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding a current working directory in a VFS mapping.

2019-08-05 Thread Bruno Cardoso Lopes via Phabricator via lldb-commits
bruno added a comment.



>> It seems conceptually a little strange to have the working directory be part 
>> of a serialized "FS", as it's fundamentally a property of a process and only 
>> transiently a property of the VFS.

I tend to agree with @sammccall, it's odd that something that's usually 
transient to be considered an intrinsic part of the described filesystem. 
However, I also understand that the current way things are modeled in LLVM 
might not help with the big picture here. I'd like to know if you tried other 
approaches and why they failed. Would it be reasonable to instead have a 
property that list something resembling "preferred search paths" for the VFS in 
question? Seems more natural that the VFS could have the notion of where to 
look at things first (which can also be a list) instead of encoding a property 
that is usually transient.

> From the reproducer's perspective I would argue that it is a property of the 
> VFS. More often than not, the working directory won't exist during replay. 
> That needs to be modeled somewhere, and VFS is the obvious candidate.

What happens when besides a `current-working-directory` in the YAML, the user 
also passes `-working-directory` to clang? What's the expected semantics? On 
the LLDB side, could the reproducer be passing something like clang does with 
`-working-directory` for the purpose of having extra ways to find things? I'd 
imagine such mechanism to prepend some path to relative searches, which would 
yield a virtual absolute path to lookup at the VFS?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65677



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


[Lldb-commits] [lldb] r367975 - Remove unused function 'SetMangledCounterparts' (NFC)

2019-08-05 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Aug  5 21:01:58 2019
New Revision: 367975

URL: http://llvm.org/viewvc/llvm-project?rev=367975&view=rev
Log:
Remove unused function 'SetMangledCounterparts' (NFC)

This function is not referenced.

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

Modified: lldb/trunk/source/Utility/ConstString.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ConstString.cpp?rev=367975&r1=367974&r2=367975&view=diff
==
--- lldb/trunk/source/Utility/ConstString.cpp (original)
+++ lldb/trunk/source/Utility/ConstString.cpp Mon Aug  5 21:01:58 2019
@@ -59,23 +59,6 @@ public:
 return nullptr;
   }
 
-  bool SetMangledCounterparts(const char *key_ccstr, const char *value_ccstr) {
-if (key_ccstr != nullptr && value_ccstr != nullptr) {
-  {
-const uint8_t h = hash(llvm::StringRef(key_ccstr));
-llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex);
-GetStringMapEntryFromKeyData(key_ccstr).setValue(value_ccstr);
-  }
-  {
-const uint8_t h = hash(llvm::StringRef(value_ccstr));
-llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex);
-GetStringMapEntryFromKeyData(value_ccstr).setValue(key_ccstr);
-  }
-  return true;
-}
-return false;
-  }
-
   const char *GetConstCString(const char *cstr) {
 if (cstr != nullptr)
   return GetConstCStringWithLength(cstr, strlen(cstr));


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


[Lldb-commits] [lldb] r367978 - [Gardening] Remove dead code from ASTDumper (NFC)

2019-08-05 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Aug  5 21:46:02 2019
New Revision: 367978

URL: http://llvm.org/viewvc/llvm-project?rev=367978&view=rev
Log:
[Gardening] Remove dead code from ASTDumper (NFC)

These functions are not referenced.

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

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp?rev=367978&r1=367977&r2=367978&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp Mon Aug  5 
21:46:02 2019
@@ -75,8 +75,6 @@ ASTDumper::ASTDumper(const CompilerType
 
 const char *ASTDumper::GetCString() { return m_dump.c_str(); }
 
-void ASTDumper::ToSTDERR() { fprintf(stderr, "%s\n", m_dump.c_str()); }
-
 void ASTDumper::ToLog(Log *log, const char *prefix) {
   size_t len = m_dump.length() + 1;
 
@@ -104,5 +102,3 @@ void ASTDumper::ToLog(Log *log, const ch
 
   free(alloc);
 }
-
-void ASTDumper::ToStream(lldb::StreamSP &stream) { stream->PutCString(m_dump); 
}


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


[Lldb-commits] [lldb] r367976 - [Gardening] Remove dead code from IOHandler (NFC)

2019-08-05 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Aug  5 21:45:55 2019
New Revision: 367976

URL: http://llvm.org/viewvc/llvm-project?rev=367976&view=rev
Log:
[Gardening] Remove dead code from IOHandler (NFC)

These functions are not referenced.

Modified:
lldb/trunk/source/Core/IOHandler.cpp

Modified: lldb/trunk/source/Core/IOHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=367976&r1=367975&r2=367976&view=diff
==
--- lldb/trunk/source/Core/IOHandler.cpp (original)
+++ lldb/trunk/source/Core/IOHandler.cpp Mon Aug  5 21:45:55 2019
@@ -957,8 +957,6 @@ public:
   void SetBackground(int color_pair_idx) {
 ::wbkgd(m_window, COLOR_PAIR(color_pair_idx));
   }
-  void UnderlineOn() { AttributeOn(A_UNDERLINE); }
-  void UnderlineOff() { AttributeOff(A_UNDERLINE); }
 
   void PutCStringTruncated(const char *s, int right_pad) {
 int bytes_left = GetWidth() - GetCursorX();
@@ -1210,19 +1208,6 @@ public:
 return eKeyNotHandled;
   }
 
-  bool SetActiveWindow(Window *window) {
-const size_t num_subwindows = m_subwindows.size();
-for (size_t i = 0; i < num_subwindows; ++i) {
-  if (m_subwindows[i].get() == window) {
-m_prev_active_window_idx = m_curr_active_window_idx;
-::top_panel(window->m_panel);
-m_curr_active_window_idx = i;
-return true;
-  }
-}
-return false;
-  }
-
   WindowSP GetActiveWindow() {
 if (!m_subwindows.empty()) {
   if (m_curr_active_window_idx >= m_subwindows.size()) {
@@ -1407,8 +1392,6 @@ public:
 
   int GetKeyValue() const { return m_key_value; }
 
-  void SetKeyValue(int key_value) { m_key_value = key_value; }
-
   std::string &GetName() { return m_name; }
 
   std::string &GetKeyName() { return m_key_name; }


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


[Lldb-commits] [lldb] r367977 - [Gardening] Remove dead code from ScriptInterpreterPython (NFC)

2019-08-05 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Aug  5 21:45:59 2019
New Revision: 367977

URL: http://llvm.org/viewvc/llvm-project?rev=367977&view=rev
Log:
[Gardening] Remove dead code from ScriptInterpreterPython (NFC)

The terminal state is never saved or restored.

Modified:

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=367977&r1=367976&r2=367977&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
Mon Aug  5 21:45:59 2019
@@ -448,9 +448,9 @@ ScriptInterpreterPythonImpl::ScriptInter
   m_sys_module_dict(PyInitialValue::Invalid), m_run_one_line_function(),
   m_run_one_line_str_global(),
   m_dictionary_name(m_debugger.GetInstanceName().AsCString()),
-  m_terminal_state(), m_active_io_handler(eIOHandlerNone),
-  m_session_is_active(false), m_pty_slave_is_open(false),
-  m_valid_session(true), m_lock_count(0), m_command_thread_state(nullptr) {
+  m_active_io_handler(eIOHandlerNone), m_session_is_active(false),
+  m_pty_slave_is_open(false), m_valid_session(true), m_lock_count(0),
+  m_command_thread_state(nullptr) {
   InitializePrivate();
 
   m_dictionary_name.append("_dict");
@@ -611,22 +611,6 @@ ScriptInterpreterPythonImpl::CreateInsta
 
 void ScriptInterpreterPythonImpl::ResetOutputFileHandle(FILE *fh) {}
 
-void ScriptInterpreterPythonImpl::SaveTerminalState(int fd) {
-  // Python mucks with the terminal state of STDIN. If we can possibly avoid
-  // this by setting the file handles up correctly prior to entering the
-  // interpreter we should. For now we save and restore the terminal state on
-  // the input file handle.
-  m_terminal_state.Save(fd, false);
-}
-
-void ScriptInterpreterPythonImpl::RestoreTerminalState() {
-  // Python mucks with the terminal state of STDIN. If we can possibly avoid
-  // this by setting the file handles up correctly prior to entering the
-  // interpreter we should. For now we save and restore the terminal state on
-  // the input file handle.
-  m_terminal_state.Restore();
-}
-
 void ScriptInterpreterPythonImpl::LeaveSession() {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
   if (log)

Modified: 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h?rev=367977&r1=367976&r2=367977&view=diff
==
--- 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
 (original)
+++ 
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
 Mon Aug  5 21:45:59 2019
@@ -347,10 +347,6 @@ public:
 
   void LeaveSession();
 
-  void SaveTerminalState(int fd);
-
-  void RestoreTerminalState();
-
   uint32_t IsExecutingPython() const { return m_lock_count > 0; }
 
   uint32_t IncrementLockCount() { return ++m_lock_count; }
@@ -387,7 +383,6 @@ public:
   PythonObject m_run_one_line_function;
   PythonObject m_run_one_line_str_global;
   std::string m_dictionary_name;
-  TerminalState m_terminal_state;
   ActiveIOHandler m_active_io_handler;
   bool m_session_is_active;
   bool m_pty_slave_is_open;


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


[Lldb-commits] [PATCH] D65691: Various build fixes for lldb on MinGW

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:55
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;

amccarth wrote:
> hhb wrote:
> > amccarth wrote:
> > > Nothing in the rest of this .cpp file uses PATH_MAX, so just delete the 
> > > `#define` instead of executing it conditionally.
> > PATH_MAX is used in SendProcessEvent (line 283)
> Got it.  When I asked Phabricator to show me all the lines, it didn't show me 
> _all_ the lines.
> 
> That said, it seems unfortunate that it's yet another fixed-length filename 
> buffer instead of getting a ConstString from the FileSpec.  But that's 
> outside the scope of this change.
The problem is that you're dealing with the SBFileSpec here, and that makes 
things slightly complicated (stable api, not being able to return c++ objects 
through it, etc...).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65691



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


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding a current working directory in a VFS mapping.

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I just wanted to note that the CWD is not the only thing about a filesystem 
that's transient -- it's contents can change over time too. This is 
particularly important for a long-lived process like lldb, which explicitly 
supports things like rebuilding an executable and then relaunching it within 
the same debugger session, and it also creates and deletes some files itself. 
So, I expect that lldb reproducers will, sooner or later, need to learn to deal 
with filesystems which change over time, but AFAIK the current yaml vfs thingy 
does not support anything like that.

Now, I am not familiar with the design principles or the implementation of the 
VFS classes, so I have no idea whether this speaks for or against this change, 
but I though it may be interesting to note that..


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65677



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


[Lldb-commits] [lldb] r367983 - Fix line table resolution near the end of a section

2019-08-05 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Aug  5 23:52:05 2019
New Revision: 367983

URL: http://llvm.org/viewvc/llvm-project?rev=367983&view=rev
Log:
Fix line table resolution near the end of a section

Summary:
lld r367537 changed the way the linker organizes sections and segments.
This exposed an lldb bug and caused some tests to fail.

In all of the failing tests the root cause was the same -- when we were
trying to resolve the last address in the line_table section, we failed
because it pointed past the end of the section.

This patch changes the line table address resolution code to back up the
address by one for end-of-sequence entries. This ensures the address
still points inside a section/module even if the line table sequence
ends at the very end of a section.

It also reverts the linker flags which were added to the failing tests
to restore previous behavior.

Reviewers: clayborg, jingham

Subscribers: mgorny, MaskRay, lldb-commits

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

Modified:
lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
lldb/trunk/source/Symbol/LineTable.cpp

Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s?rev=367983&r1=367982&r2=367983&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s Mon Aug  5 23:52:05 2019
@@ -1,7 +1,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t -o "image dump line-table -v a.c" -o exit | FileCheck %s
 
 

Modified: 
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s?rev=367983&r1=367982&r2=367983&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s 
(original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s 
Mon Aug  5 23:52:05 2019
@@ -5,7 +5,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t -s %S/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit 
-o exit | FileCheck %s
 
 # CHECK-LABEL: image dump line-table a.c

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s?rev=367983&r1=367982&r2=367983&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s Mon Aug  5 
23:52:05 2019
@@ -4,7 +4,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t -s %S/Inputs/dir-separator-windows.lldbinit -o exit | 
FileCheck %s
 
 # CHECK-LABEL: image dump line-table a.c

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s?rev=367983&r1=367982&r2=367983&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s Mon Aug  5 23:52:05 
2019
@@ -4,7 +4,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t -s %S/Inputs/dir-separator-posix.lldbinit -o exit | FileCheck 
%s
 
 # CHECK-LABEL: image dump line-table a.c

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s?rev=367983&r1=367982&r2=367983&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s Mon Aug  5 23:52:05 
2019
@@ -4,7 +4,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t 

[Lldb-commits] [PATCH] D65647: Fix line table resolution near the end of a section

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
labath marked an inline comment as done.
Closed by commit rL367983: Fix line table resolution near the end of a section 
(authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65647?vs=213342&id=213527#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65647

Files:
  lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s
  lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
  lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
  lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s
  lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
  lldb/trunk/source/Symbol/LineTable.cpp

Index: lldb/trunk/source/Symbol/LineTable.cpp
===
--- lldb/trunk/source/Symbol/LineTable.cpp
+++ lldb/trunk/source/Symbol/LineTable.cpp
@@ -241,33 +241,47 @@
 
 bool LineTable::ConvertEntryAtIndexToLineEntry(uint32_t idx,
LineEntry &line_entry) {
-  if (idx < m_entries.size()) {
-const Entry &entry = m_entries[idx];
-ModuleSP module_sp(m_comp_unit->GetModule());
-if (module_sp &&
-module_sp->ResolveFileAddress(entry.file_addr,
-  line_entry.range.GetBaseAddress())) {
-  if (!entry.is_terminal_entry && idx + 1 < m_entries.size())
-line_entry.range.SetByteSize(m_entries[idx + 1].file_addr -
- entry.file_addr);
-  else
-line_entry.range.SetByteSize(0);
-
-  line_entry.file =
-  m_comp_unit->GetSupportFiles().GetFileSpecAtIndex(entry.file_idx);
-  line_entry.original_file =
-  m_comp_unit->GetSupportFiles().GetFileSpecAtIndex(entry.file_idx);
-  line_entry.line = entry.line;
-  line_entry.column = entry.column;
-  line_entry.is_start_of_statement = entry.is_start_of_statement;
-  line_entry.is_start_of_basic_block = entry.is_start_of_basic_block;
-  line_entry.is_prologue_end = entry.is_prologue_end;
-  line_entry.is_epilogue_begin = entry.is_epilogue_begin;
-  line_entry.is_terminal_entry = entry.is_terminal_entry;
-  return true;
-}
-  }
-  return false;
+  if (idx >= m_entries.size())
+return false;
+
+  const Entry &entry = m_entries[idx];
+  ModuleSP module_sp(m_comp_unit->GetModule());
+  if (!module_sp)
+return false;
+
+  addr_t file_addr = entry.file_addr;
+
+  // A terminal entry can point outside of a module or a section. Decrement the
+  // address to ensure it resolves correctly.
+  if (entry.is_terminal_entry)
+--file_addr;
+
+  if (!module_sp->ResolveFileAddress(file_addr,
+ line_entry.range.GetBaseAddress()))
+return false;
+
+  // Now undo the decrement above.
+  if (entry.is_terminal_entry)
+line_entry.range.GetBaseAddress().Slide(1);
+
+  if (!entry.is_terminal_entry && idx + 1 < m_entries.size())
+line_entry.range.SetByteSize(m_entries[idx + 1].file_addr -
+ entry.file_addr);
+  else
+line_entry.range.SetByteSize(0);
+
+  line_entry.file =
+  m_comp_unit->GetSupportFiles().GetFileSpecAtIndex(entry.file_idx);
+  line_entry.original_file =
+  m_comp_unit->GetSupportFiles().GetFileSpecAtIndex(entry.file_idx);
+  line_entry.line = entry.line;
+  line_entry.column = entry.column;
+  line_entry.is_start_of_statement = entry.is_start_of_statement;
+  line_entry.is_start_of_basic_block = entry.is_start_of_basic_block;
+  line_entry.is_prologue_end = entry.is_prologue_end;
+  line_entry.is_epilogue_begin = entry.is_epilogue_begin;
+  line_entry.is_terminal_entry = entry.is_terminal_entry;
+  return true;
 }
 
 uint32_t LineTable::FindLineEntryIndexByFileIndex(
Index: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
===
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
@@ -5,7 +5,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RUN: ld.lld %t.o -o %t
 # RUN: %lldb %t -s %S/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit -o exit | FileCheck %s
 
 # CHECK-LABEL: image dump line-table a.c
Index: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
===
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
@@ -4,7 +4,7 @@
 # REQUIRES: lld, x86
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld -z separate-code %t.o -o %t
+# RU

[Lldb-commits] [PATCH] D65647: Fix line table resolution near the end of a section

2019-08-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

(I eventually decided to skip the test, as without the extra flag, the same 
functionality can be exercised in a much more conventional way with "image 
lookup -a")


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65647



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