PHAL: Fix pdbg target traversal error path issues
Existing pdbg target traversal call back function continues
traversal incase any attribute read failure on entity path
associated target. This logic is wrong, should be continue
collecting available attribute information and stop traversal
in this case.
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I1865558962ffb3a715760a060e0054110b4da470
diff --git a/extensions/phal/phal_error.cpp b/extensions/phal/phal_error.cpp
index a5f79a7..531379d 100644
--- a/extensions/phal/phal_error.cpp
+++ b/extensions/phal/phal_error.cpp
@@ -108,6 +108,9 @@
return continueTgtTraversal;
}
+ // Found Target, now collect the required attributes associated to the
+ // target. Incase of any attribute read failure, initialize the data with
+ // default value.
try
{
// Get location code information
@@ -116,7 +119,6 @@
}
catch (const std::exception& e)
{
- // log message and continue with default data
log<level::ERR>(fmt::format("getLocationCode({}): Exception({})",
pdbg_target_path(target), e.what())
.c_str());
@@ -124,14 +126,17 @@
if (DT_GET_PROP(ATTR_PHYS_DEV_PATH, target, targetInfo->physDevPath))
{
- log<level::ERR>("Could not read PHYS_DEV_PATH attribute");
- return requireAttrNotFound;
+ log<level::ERR>(
+ fmt::format("Could not read({}) PHYS_DEV_PATH attribute",
+ pdbg_target_path(target))
+ .c_str());
}
if (DT_GET_PROP(ATTR_MRU_ID, target, targetInfo->mruId))
{
- log<level::ERR>("Could not read MRU_ID attribute");
- return requireAttrNotFound;
+ log<level::ERR>(fmt::format("Could not read({}) ATTR_MRU_ID attribute",
+ pdbg_target_path(target))
+ .c_str());
}
return requireAttrFound;