[Lldb-commits] [lldb] ec3e290 - [lldb] Log when we cannot find an equivalent for a gdb register type
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 20 02:27:04 PDT 2022
Author: David Spickett
Date: 2022-09-20T09:26:55Z
New Revision: ec3e290502db5ab7dbaa067e674c5ee6cb34ac10
URL: https://github.com/llvm/llvm-project/commit/ec3e290502db5ab7dbaa067e674c5ee6cb34ac10
DIFF: https://github.com/llvm/llvm-project/commit/ec3e290502db5ab7dbaa067e674c5ee6cb34ac10.diff
LOG: [lldb] Log when we cannot find an equivalent for a gdb register type
This happens if the type is described elsewhere in target xml as a
<flags> or <struct>.
Also hardcode the function names into the log messages because
if you use __FUNCTION__ in a lambda you just get "operator()".
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D134043
Added:
Modified:
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 373a767d32da..09b4436e8fa0 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4022,8 +4022,10 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
if (!feature_node)
return false;
+ Log *log(GetLog(GDBRLog::Process));
+
feature_node.ForEachChildElementWithName(
- "reg", [&target_info, ®isters](const XMLNode ®_node) -> bool {
+ "reg", [&target_info, ®isters, log](const XMLNode ®_node) -> bool {
std::string gdb_group;
std::string gdb_type;
DynamicRegisterInfo::Register reg_info;
@@ -4032,9 +4034,9 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
// FIXME: we're silently ignoring invalid data here
reg_node.ForEachAttribute([&target_info, &gdb_group, &gdb_type,
- &encoding_set, &format_set, ®_info](
- const llvm::StringRef &name,
- const llvm::StringRef &value) -> bool {
+ &encoding_set, &format_set, ®_info,
+ log](const llvm::StringRef &name,
+ const llvm::StringRef &value) -> bool {
if (name == "name") {
reg_info.name.SetString(value);
} else if (name == "bitsize") {
@@ -4091,10 +4093,10 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
SplitCommaSeparatedRegisterNumberString(
value, reg_info.invalidate_regs, 0);
} else {
- Log *log(GetLog(GDBRLog::Process));
LLDB_LOGF(log,
- "ProcessGDBRemote::%s unhandled reg attribute %s = %s",
- __FUNCTION__, name.data(), value.data());
+ "ProcessGDBRemote::ParseRegisters unhandled reg "
+ "attribute %s = %s",
+ name.data(), value.data());
}
return true; // Keep iterating through all attributes
});
@@ -4116,6 +4118,12 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
// them as vector (similarly to xmm/ymm)
reg_info.format = eFormatVectorOfUInt8;
reg_info.encoding = eEncodingVector;
+ } else {
+ LLDB_LOGF(
+ log,
+ "ProcessGDBRemote::ParseRegisters Could not determine lldb"
+ "format and encoding for gdb type %s",
+ gdb_type.c_str());
}
}
@@ -4133,7 +4141,6 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
}
if (reg_info.byte_size == 0) {
- Log *log(GetLog(GDBRLog::Process));
LLDB_LOGF(log,
"ProcessGDBRemote::%s Skipping zero bitsize register %s",
__FUNCTION__, reg_info.name.AsCString());
More information about the lldb-commits
mailing list