mirror of
https://github.com/dingusdev/dingusppc.git
synced 2026-04-21 09:16:48 +00:00
debugger: add regions command.
To dump the list of memory regions.
This commit is contained in:
@@ -89,6 +89,7 @@ static void show_help() {
|
||||
cout << " setmem X=V.T -- set memory at address X to value V of size T" << endl;
|
||||
cout << " T can be b(byte), w(word), d(double)," << endl;
|
||||
cout << " q(quad) or c(character)." << endl;
|
||||
cout << " regions -- dump memory regions" << endl;
|
||||
cout << " profile C N -- run subcommand C on profile N" << endl;
|
||||
cout << " supported subcommands:" << endl;
|
||||
cout << " 'show' - show profile report" << endl;
|
||||
@@ -881,6 +882,10 @@ void DppcDebugger::enter_debugger() {
|
||||
cout << "Unknown debugging context: " << expr_str << endl;
|
||||
}
|
||||
#endif
|
||||
} else if (cmd == "regions") {
|
||||
cmd = "";
|
||||
if (mem_ctrl_instance)
|
||||
mem_ctrl_instance->dump_regions();
|
||||
} else if (cmd == "printenv") {
|
||||
cmd = "";
|
||||
if (ofnvram->init())
|
||||
|
||||
@@ -372,3 +372,13 @@ uint8_t *MemCtrlBase::get_region_hostmem_ptr(const uint32_t addr) {
|
||||
else
|
||||
return (addr - reg_desc->start) + reg_desc->mem_ptr;
|
||||
}
|
||||
|
||||
|
||||
void MemCtrlBase::dump_regions()
|
||||
{
|
||||
int i = 0;
|
||||
for (auto& entry : address_map) {
|
||||
printf("%2d: %s\n", i, get_entry_str(entry).c_str());
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
|
||||
uint8_t *get_region_hostmem_ptr(const uint32_t addr);
|
||||
|
||||
void dump_regions();
|
||||
|
||||
protected:
|
||||
bool add_mem_region(
|
||||
uint32_t start_addr, uint32_t size, uint32_t dest_addr, uint32_t type,
|
||||
|
||||
Reference in New Issue
Block a user