summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Prantl <adrian-prantl@users.noreply.github.com>2024-02-23 08:00:58 -0800
committerGitHub <noreply@github.com>2024-02-23 08:00:58 -0800
commit55bc0488af077acb47be70542718d1bc17f3de4f (patch)
tree985b81fbf1c2f27e06868b0e875b19f6c5f9da92
parent08cb1a62f6f401d66513a20e8689c1ef9059fc63 (diff)
Improve and modernize logging for Process::CompleteAttach() (#82717)
Target::SetArchitecture() does not necessarily set the triple that is being passed in, and will unconditionally log the real architecture to the log channel. By flipping the order between the log outputs, the resulting combined log makes a lot more sense to read.
-rw-r--r--lldb/source/Target/Process.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 23a8a66645c0..137795cb8cec 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2937,14 +2937,11 @@ void Process::CompleteAttach() {
DidAttach(process_arch);
if (process_arch.IsValid()) {
+ LLDB_LOG(log,
+ "Process::{0} replacing process architecture with DidAttach() "
+ "architecture: \"{1}\"",
+ __FUNCTION__, process_arch.GetTriple().getTriple());
GetTarget().SetArchitecture(process_arch);
- if (log) {
- const char *triple_str = process_arch.GetTriple().getTriple().c_str();
- LLDB_LOGF(log,
- "Process::%s replacing process architecture with DidAttach() "
- "architecture: %s",
- __FUNCTION__, triple_str ? triple_str : "<null>");
- }
}
// We just attached. If we have a platform, ask it for the process