Skip to content

Commit 55bc048

Browse files
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.
1 parent 08cb1a6 commit 55bc048

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lldb/source/Target/Process.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,14 +2937,11 @@ void Process::CompleteAttach() {
29372937
DidAttach(process_arch);
29382938

29392939
if (process_arch.IsValid()) {
2940+
LLDB_LOG(log,
2941+
"Process::{0} replacing process architecture with DidAttach() "
2942+
"architecture: \"{1}\"",
2943+
__FUNCTION__, process_arch.GetTriple().getTriple());
29402944
GetTarget().SetArchitecture(process_arch);
2941-
if (log) {
2942-
const char *triple_str = process_arch.GetTriple().getTriple().c_str();
2943-
LLDB_LOGF(log,
2944-
"Process::%s replacing process architecture with DidAttach() "
2945-
"architecture: %s",
2946-
__FUNCTION__, triple_str ? triple_str : "<null>");
2947-
}
29482945
}
29492946

29502947
// We just attached. If we have a platform, ask it for the process

0 commit comments

Comments
 (0)