[Lldb-commits] [lldb] [lldb][NFC] Add maybe_unused to err used in asserts (PR #98055)

2024-07-08 Thread Keith Smiley via lldb-commits

https://github.com/keith created https://github.com/llvm/llvm-project/pull/98055

None

>From 6a6fc355e3623a0d0aacc465220a562e103e6dfc Mon Sep 17 00:00:00 2001
From: Keith Smiley 
Date: Mon, 8 Jul 2024 10:28:22 -0700
Subject: [PATCH] [lldb][NFC] Add maybe_unused to err used in asserts

---
 lldb/tools/debugserver/source/PThreadMutex.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/tools/debugserver/source/PThreadMutex.h 
b/lldb/tools/debugserver/source/PThreadMutex.h
index a4535dd79172c..17f9fdff5f2d3 100644
--- a/lldb/tools/debugserver/source/PThreadMutex.h
+++ b/lldb/tools/debugserver/source/PThreadMutex.h
@@ -78,13 +78,13 @@ class PThreadMutex {
   };
 
   PThreadMutex() {
-int err;
+[[maybe_unused]] int err;
 err = ::pthread_mutex_init(_mutex, NULL);
 assert(err == 0);
   }
 
   PThreadMutex(int type) {
-int err;
+[[maybe_unused]] int err;
 ::pthread_mutexattr_t attr;
 err = ::pthread_mutexattr_init();
 assert(err == 0);
@@ -97,7 +97,7 @@ class PThreadMutex {
   }
 
   ~PThreadMutex() {
-int err;
+[[maybe_unused]] int err;
 err = ::pthread_mutex_destroy(_mutex);
 if (err != 0) {
   err = Unlock();

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


[Lldb-commits] [clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-21 Thread Keith Smiley via lldb-commits

keith wrote:

looks like the .bazelrc still has mentions of this

https://github.com/llvm/llvm-project/pull/92865
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Allow env override for LLDB_ARGDUMPER_PATH (PR #91688)

2024-05-14 Thread Keith Smiley via lldb-commits

https://github.com/keith closed https://github.com/llvm/llvm-project/pull/91688
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Allow env override for LLDB_ARGDUMPER_PATH (PR #91688)

2024-05-09 Thread Keith Smiley via lldb-commits

https://github.com/keith created https://github.com/llvm/llvm-project/pull/91688

This mirrors the LLDB_DEBUGSERVER_PATH environment variable and allows you to 
have lldb-argdumper in a non-standard location and still use it at runtime.

>From 98ddf4ed99a10c46a43d9a750bd826623a8c7e6f Mon Sep 17 00:00:00 2001
From: Keith Smiley 
Date: Thu, 9 May 2024 18:10:36 -0700
Subject: [PATCH] [lldb] Allow env override for LLDB_ARGDUMPER_PATH

This mirrors the LLDB_DEBUGSERVER_PATH environment variable and allows
you to have lldb-argdumper in a non-standard location and still use it
at runtime.
---
 lldb/source/Host/macosx/objcxx/Host.mm | 35 ++
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/lldb/source/Host/macosx/objcxx/Host.mm 
b/lldb/source/Host/macosx/objcxx/Host.mm
index 4fba5550ba10a..e6f1c0ea3d295 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -1387,18 +1387,31 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo 
_info) {
 Status Host::ShellExpandArguments(ProcessLaunchInfo _info) {
   Status error;
   if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) {
-FileSpec expand_tool_spec = HostInfo::GetSupportExeDir();
-if (!expand_tool_spec) {
-  error.SetErrorString(
-  "could not get support executable directory for lldb-argdumper 
tool");
-  return error;
+FileSpec expand_tool_spec;
+Environment host_env = Host::GetEnvironment();
+std::string env_argdumper_path = host_env.lookup("LLDB_ARGDUMPER_PATH");
+if (!env_argdumper_path.empty()) {
+  expand_tool_spec.SetFile(env_argdumper_path, FileSpec::Style::native);
+  Log *log(GetLog(LLDBLog::Host | LLDBLog::Process));
+  LLDB_LOGF(log,
+"lldb-argdumper exe path set from environment variable: %s",
+env_argdumper_path.c_str());
 }
-expand_tool_spec.AppendPathComponent("lldb-argdumper");
-if (!FileSystem::Instance().Exists(expand_tool_spec)) {
-  error.SetErrorStringWithFormat(
-  "could not find the lldb-argdumper tool: %s",
-  expand_tool_spec.GetPath().c_str());
-  return error;
+bool argdumper_exists = FileSystem::Instance().Exists(env_argdumper_path);
+if (!argdumper_exists) {
+  expand_tool_spec = HostInfo::GetSupportExeDir();
+  if (!expand_tool_spec) {
+error.SetErrorString("could not get support executable directory for "
+ "lldb-argdumper tool");
+return error;
+  }
+  expand_tool_spec.AppendPathComponent("lldb-argdumper");
+  if (!FileSystem::Instance().Exists(expand_tool_spec)) {
+error.SetErrorStringWithFormat(
+"could not find the lldb-argdumper tool: %s",
+expand_tool_spec.GetPath().c_str());
+return error;
+  }
 }
 
 StreamString expand_tool_spec_stream;

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


[Lldb-commits] [lldb] 0c4464a - [lldb] Fix formatted log statement

2021-11-18 Thread Keith Smiley via lldb-commits

Author: Keith Smiley
Date: 2021-11-18T15:09:38-08:00
New Revision: 0c4464a5bd35dd865f568ed68171208e44df16c7

URL: 
https://github.com/llvm/llvm-project/commit/0c4464a5bd35dd865f568ed68171208e44df16c7
DIFF: 
https://github.com/llvm/llvm-project/commit/0c4464a5bd35dd865f568ed68171208e44df16c7.diff

LOG: [lldb] Fix formatted log statement

Previously this would output literally without replacements

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

Added: 


Modified: 
lldb/source/Core/Module.cpp

Removed: 




diff  --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 283e18707dbba..bd0a667171a5a 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1627,10 +1627,10 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name, 
llvm::StringRef sysroot)
 bool Module::MergeArchitecture(const ArchSpec _spec) {
   if (!arch_spec.IsValid())
 return false;
-  LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT | LIBLLDB_LOG_MODULES),
-   "module has arch %s, merging/replacing with arch %s",
-   m_arch.GetTriple().getTriple().c_str(),
-   arch_spec.GetTriple().getTriple().c_str());
+  LLDB_LOGF(GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT | LIBLLDB_LOG_MODULES),
+"module has arch %s, merging/replacing with arch %s",
+m_arch.GetTriple().getTriple().c_str(),
+arch_spec.GetTriple().getTriple().c_str());
   if (!m_arch.IsCompatibleMatch(arch_spec)) {
 // The new architecture is 
diff erent, we just need to replace it.
 return SetArchitecture(arch_spec);



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


[Lldb-commits] [lldb] 0f3254b - [lldb] Improve help for platform put-file

2021-10-05 Thread Keith Smiley via lldb-commits

Author: Keith Smiley
Date: 2021-10-05T10:29:37-07:00
New Revision: 0f3254b29f375d449e815e91d63bef78d9e81354

URL: 
https://github.com/llvm/llvm-project/commit/0f3254b29f375d449e815e91d63bef78d9e81354
DIFF: 
https://github.com/llvm/llvm-project/commit/0f3254b29f375d449e815e91d63bef78d9e81354.diff

LOG: [lldb] Improve help for platform put-file

Previously it was not clear what arguments this required, or what it would do 
if you didn't pass the destination argument.

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

Added: 


Modified: 
lldb/source/Commands/CommandObjectPlatform.cpp

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectPlatform.cpp 
b/lldb/source/Commands/CommandObjectPlatform.cpp
index cd4d880e7..6bfb4c8a0689c 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -1067,7 +1067,18 @@ class CommandObjectPlatformPutFile : public 
CommandObjectParsed {
   CommandObjectPlatformPutFile(CommandInterpreter )
   : CommandObjectParsed(
 interpreter, "platform put-file",
-"Transfer a file from this system to the remote end.", nullptr, 0) 
{
+"Transfer a file from this system to the remote end.",
+"platform put-file  []", 0) {
+SetHelpLong(
+R"(Examples:
+
+(lldb) platform put-file /source/foo.txt /destination/bar.txt
+
+(lldb) platform put-file /source/foo.txt
+
+Relative source file paths are resolved against lldb's local working 
directory.
+
+Omitting the destination places the file in the platform working 
directory.)");
   }
 
   ~CommandObjectPlatformPutFile() override = default;



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