Extend DebuggerInterface for area information retrieval.

This commit is contained in:
Rene Gollent
2013-04-05 09:11:57 -04:00
parent a5e54e1bcf
commit 6d1e057cac
2 changed files with 25 additions and 2 deletions
@@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, [email protected].
* Copyright 2010-2012, Rene Gollent, [email protected].
* Copyright 2010-2013, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
@@ -23,6 +23,7 @@
#include "ArchitectureX86.h"
#include "ArchitectureX8664.h"
#include "AreaInfo.h"
#include "CpuState.h"
#include "DebugEvent.h"
#include "ImageInfo.h"
@@ -518,6 +519,26 @@ DebuggerInterface::GetImageInfos(BObjectList<ImageInfo>& infos)
}
status_t
DebuggerInterface::GetAreaInfos(BObjectList<AreaInfo>& infos)
{
// get the team's areas
area_info areaInfo;
int32 cookie = 0;
while (get_next_area_info(fTeamID, &cookie, &areaInfo) == B_OK) {
AreaInfo* info = new(std::nothrow) AreaInfo(fTeamID, areaInfo.area,
areaInfo.name, (addr_t)areaInfo.address, areaInfo.size,
areaInfo.ram_size, areaInfo.lock, areaInfo.protection);
if (info == NULL || !infos.AddItem(info)) {
delete info;
return B_NO_MEMORY;
}
}
return B_OK;
}
status_t
DebuggerInterface::GetSymbolInfos(team_id team, image_id image,
BObjectList<SymbolInfo>& infos)
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2010-2012, Rene Gollent, [email protected].
* Copyright 2010-2013, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef DEBUGGER_INTERFACE_H
@@ -17,6 +17,7 @@
class Architecture;
class CpuState;
class DebugEvent;
class AreaInfo;
class ImageInfo;
class SymbolInfo;
class ThreadInfo;
@@ -54,6 +55,7 @@ public:
virtual status_t GetThreadInfos(BObjectList<ThreadInfo>& infos);
virtual status_t GetImageInfos(BObjectList<ImageInfo>& infos);
virtual status_t GetAreaInfos(BObjectList<AreaInfo>& infos);
virtual status_t GetSymbolInfos(team_id team, image_id image,
BObjectList<SymbolInfo>& infos);
virtual status_t GetSymbolInfo(team_id team, image_id image,