Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 1 | #include <util/pdbg.hpp> |
| 2 | |
| 3 | namespace util |
| 4 | { |
| 5 | |
| 6 | namespace pdbg |
| 7 | { |
| 8 | |
| 9 | //------------------------------------------------------------------------------ |
| 10 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame^] | 11 | pdbg_target* getTrgt(const libhei::Chip& i_chip) |
| 12 | { |
| 13 | return (pdbg_target*)i_chip.getChip(); |
| 14 | } |
| 15 | |
| 16 | //------------------------------------------------------------------------------ |
| 17 | |
| 18 | const char* getPath(pdbg_target* i_trgt) |
| 19 | { |
| 20 | return pdbg_target_path(i_trgt); |
| 21 | } |
| 22 | |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 23 | const char* getPath(const libhei::Chip& i_chip) |
| 24 | { |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame^] | 25 | return getPath(getTrgt(i_chip)); |
| 26 | } |
| 27 | |
| 28 | //------------------------------------------------------------------------------ |
| 29 | |
| 30 | uint32_t getChipPos(pdbg_target* i_trgt) |
| 31 | { |
| 32 | uint32_t attr = 0; |
| 33 | pdbg_target_get_attribute(i_trgt, "ATTR_FAPI_POS", 4, 1, &attr); |
| 34 | return attr; |
| 35 | } |
| 36 | |
| 37 | uint32_t getChipPos(const libhei::Chip& i_chip) |
| 38 | { |
| 39 | return getChipPos(getTrgt(i_chip)); |
| 40 | } |
| 41 | |
| 42 | //------------------------------------------------------------------------------ |
| 43 | |
| 44 | uint8_t getTrgtType(pdbg_target* i_trgt) |
| 45 | { |
| 46 | uint8_t attr = 0; |
| 47 | pdbg_target_get_attribute(i_trgt, "ATTR_TYPE", 1, 1, &attr); |
| 48 | return attr; |
| 49 | } |
| 50 | |
| 51 | uint8_t getTrgtType(const libhei::Chip& i_chip) |
| 52 | { |
| 53 | return getTrgtType(getTrgt(i_chip)); |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | //------------------------------------------------------------------------------ |
| 57 | |
| 58 | } // namespace pdbg |
| 59 | |
| 60 | } // namespace util |