[Lldb-commits] [PATCH] D131212: Allow host platform to use sdk sysroot directory option when resolving shared modules

2022-08-04 Thread Trevor Joynson via Phabricator via lldb-commits
trevorj created this revision.
Herald added a project: All.
trevorj requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Hi!  We noticed recently that when using the host platform with an sdk sysroot 
set, modules are not resolved using a path prefixed by the set sysroot path.

If I'm just doing something wrong let me know too :)

Thanks!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131212

Files:
  lldb/source/Target/Platform.cpp


Index: lldb/source/Target/Platform.cpp
===
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -201,11 +201,6 @@
 const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp,
 const FileSpecList *module_search_paths_ptr,
 llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) {
-  if (IsHost())
-return ModuleList::GetSharedModule(module_spec, module_sp,
-   module_search_paths_ptr, old_modules,
-   did_create_ptr, false);
-
   // Module resolver lambda.
   auto resolver = [&](const ModuleSpec &spec) {
 Status error(eErrorTypeGeneric);


Index: lldb/source/Target/Platform.cpp
===
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -201,11 +201,6 @@
 const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp,
 const FileSpecList *module_search_paths_ptr,
 llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) {
-  if (IsHost())
-return ModuleList::GetSharedModule(module_spec, module_sp,
-   module_search_paths_ptr, old_modules,
-   did_create_ptr, false);
-
   // Module resolver lambda.
   auto resolver = [&](const ModuleSpec &spec) {
 Status error(eErrorTypeGeneric);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D131212: Allow host platform to use sdk sysroot directory option when resolving shared modules

2022-08-04 Thread Trevor Joynson via Phabricator via lldb-commits
trevorj added a comment.

@JDevlieghere Sure I can provide more context, let me know if you want me to 
clarify anything!

I'm trying to debug production coredumps on a development machine using a 
sysroot folder tree that contains the required shared objects required.

In gdb, I use this via `set sysroot`.
In LLDB, I assume I should do something like `platform select host -S 
/path/to/sysroot`.

After doing either of these I would expect the attempted paths for loading 
shared objects will be prefixed by the configured sysroot.
Unfortunately, when using the `host` platform, it currently ignores the sysroot 
configuration option when trying to load shared objects.
This breaks the `sysroot` setting on the `host` platform.

If I'm doing something wrong feel free to correct me!

Side note, I believe these lines would be okay to remove because it falls back 
to normal resolution.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131212

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


[Lldb-commits] [PATCH] D131212: Allow host platform to use sdk sysroot directory option when resolving shared modules

2022-08-08 Thread Trevor Joynson via Phabricator via lldb-commits
trevorj added a comment.

@clayborg The problem with the second variation is it doesn't prefix the path, 
it just looks for shared objects of the same basename in the folders you 
specify.

I thought that remote-linux requires a server?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131212

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


[Lldb-commits] [PATCH] D131212: Allow host platform to use sdk sysroot directory option when resolving shared modules

2022-08-08 Thread Trevor Joynson via Phabricator via lldb-commits
trevorj added a comment.

> It does not. You _can_ connect to a remote server if you want to, but you 
> don't have to. Many workflows need to select a remote platform to let LLDB 
> know how to locate files when doing symbolication and when loading core 
> files, so you should just be able to use the workflow I suggested that was 
> based on Pavel's comments. Does that work for you?

Trying it out, awesome, I was completely wrong about what remote-linux was then.
Curious, why does the `host` platform support being sent a sysroot parameter 
when selecting it if it doesn't use it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131212

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