util::pdbg functions for path, position, and target type
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I4f4a5b1aa6ab13f60e61d77a866cfc24c7854677
diff --git a/analyzer/analyzer_main.cpp b/analyzer/analyzer_main.cpp
index cf3d195..cf78149 100644
--- a/analyzer/analyzer_main.cpp
+++ b/analyzer/analyzer_main.cpp
@@ -24,22 +24,6 @@
//------------------------------------------------------------------------------
-uint8_t __attrType(pdbg_target* i_trgt)
-{
- uint8_t attr = 0;
- pdbg_target_get_attribute(i_trgt, "ATTR_TYPE", 1, 1, &attr);
- return attr;
-}
-
-uint32_t __attrFapiPos(pdbg_target* i_trgt)
-{
- uint32_t attr = 0;
- pdbg_target_get_attribute(i_trgt, "ATTR_FAPI_POS", 4, 1, &attr);
- return attr;
-}
-
-//------------------------------------------------------------------------------
-
const char* __attn(libhei::AttentionType_t i_attnType)
{
const char* str = "";
@@ -69,10 +53,8 @@
uint32_t __trgt(const libhei::Signature& i_sig)
{
- auto trgt = (pdbg_target*)i_sig.getChip().getChip();
-
- uint8_t type = __attrType(trgt);
- uint32_t pos = __attrFapiPos(trgt);
+ uint8_t type = util::pdbg::getTrgtType(i_sig.getChip());
+ uint32_t pos = util::pdbg::getChipPos(i_sig.getChip());
// Technically, the FapiPos attribute is 32-bit, but not likely to ever go
// over 24-bit.
@@ -96,7 +78,7 @@
// TODO: Will need to grab the model/level from the target attributes when
// they are available. For now, use ATTR_TYPE to determine which
// currently supported value to use supported.
- uint8_t attrType = __attrType(i_trgt);
+ uint8_t attrType = util::pdbg::getTrgtType(i_trgt);
switch (attrType)
{
case 0x05: // PROC