blob: 53c8020cea6b6484ae9fec68e8f40901d4da19a2 [file] [log] [blame]
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -06001#include <util/pdbg.hpp>
2
3namespace util
4{
5
6namespace pdbg
7{
8
9//------------------------------------------------------------------------------
10
Zane Shelleya0299852020-11-13 13:38:04 -060011pdbg_target* getTrgt(const libhei::Chip& i_chip)
12{
13 return (pdbg_target*)i_chip.getChip();
14}
15
16//------------------------------------------------------------------------------
17
18const char* getPath(pdbg_target* i_trgt)
19{
20 return pdbg_target_path(i_trgt);
21}
22
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -060023const char* getPath(const libhei::Chip& i_chip)
24{
Zane Shelleya0299852020-11-13 13:38:04 -060025 return getPath(getTrgt(i_chip));
26}
27
28//------------------------------------------------------------------------------
29
30uint32_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
37uint32_t getChipPos(const libhei::Chip& i_chip)
38{
39 return getChipPos(getTrgt(i_chip));
40}
41
42//------------------------------------------------------------------------------
43
44uint8_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
51uint8_t getTrgtType(const libhei::Chip& i_chip)
52{
53 return getTrgtType(getTrgt(i_chip));
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -060054}
55
56//------------------------------------------------------------------------------
57
58} // namespace pdbg
59
60} // namespace util