From 6d1e057cac861b242bae4b26d48473b166a2f15b Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 5 Apr 2013 08:50:41 -0400 Subject: [PATCH] Extend DebuggerInterface for area information retrieval. --- .../debugger_interface/DebuggerInterface.cpp | 23 ++++++++++++++++++- .../debugger_interface/DebuggerInterface.h | 4 +++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index 585327d633..0bcb36bbb5 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2010-2012, Rene Gollent, rene@gollent.com. + * Copyright 2010-2013, Rene Gollent, rene@gollent.com. * 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& infos) } +status_t +DebuggerInterface::GetAreaInfos(BObjectList& 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& infos) diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.h b/src/apps/debugger/debugger_interface/DebuggerInterface.h index bdf9b2c9c9..3f8d2a09c6 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.h @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2010-2012, Rene Gollent, rene@gollent.com. + * Copyright 2010-2013, Rene Gollent, rene@gollent.com. * 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& infos); virtual status_t GetImageInfos(BObjectList& infos); + virtual status_t GetAreaInfos(BObjectList& infos); virtual status_t GetSymbolInfos(team_id team, image_id image, BObjectList& infos); virtual status_t GetSymbolInfo(team_id team, image_id image,