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.
This commit is contained in:
Adrian Prantl
2024-02-23 08:00:58 -08:00
committed by GitHub
parent 08cb1a62f6
commit 55bc0488af

View File

@@ -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