Skip to content

Commit c158d64

Browse files
committed
Improve and modernize logging for Process::CompleteAttach() (llvm#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. (cherry picked from commit 55bc048)
1 parent f5bf0e4 commit c158d64

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
@@ -3091,14 +3091,11 @@ void Process::CompleteAttach() {
30913091
DidAttach(process_arch);
30923092

30933093
if (process_arch.IsValid()) {
3094+
LLDB_LOG(log,
3095+
"Process::{0} replacing process architecture with DidAttach() "
3096+
"architecture: \"{1}\"",
3097+
__FUNCTION__, process_arch.GetTriple().getTriple());
30943098
GetTarget().SetArchitecture(process_arch);
3095-
if (log) {
3096-
const char *triple_str = process_arch.GetTriple().getTriple().c_str();
3097-
LLDB_LOGF(log,
3098-
"Process::%s replacing process architecture with DidAttach() "
3099-
"architecture: %s",
3100-
__FUNCTION__, triple_str ? triple_str : "<null>");
3101-
}
31023099
}
31033100

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

0 commit comments

Comments
 (0)