* Added Size() method.

* Added Debug{First,Next}() methods to allow easy iteration through the
  address spaces in kernel debugger commands.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-01-09 20:21:43 +00:00
parent db28a227c4
commit 509f1174ce
2 changed files with 26 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*
@ -32,6 +32,7 @@ public:
team_id ID() const { return fID; }
addr_t Base() const { return fBase; }
addr_t EndAddress() const { return fEndAddress; }
size_t Size() const { return fEndAddress - fBase + 1; }
size_t FreeSpace() const { return fFreeSpace; }
bool IsBeingDeleted() const { return fDeleting; }
@ -106,6 +107,9 @@ public:
static VMAddressSpace* Get(team_id teamID);
static VMAddressSpace* DebugFirst();
static VMAddressSpace* DebugNext(VMAddressSpace* addressSpace);
protected:
static void _DeleteIfUnreferenced(team_id id);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*
@ -276,6 +276,26 @@ VMAddressSpace::Get(team_id teamID)
}
/*static*/ VMAddressSpace*
VMAddressSpace::DebugFirst()
{
return sAddressSpaceTable.GetIterator().Next();
}
/*static*/ VMAddressSpace*
VMAddressSpace::DebugNext(VMAddressSpace* addressSpace)
{
if (addressSpace == NULL)
return NULL;
AddressSpaceTable::Iterator it
= sAddressSpaceTable.GetIterator(addressSpace->ID());
it.Next();
return it.Next();
}
/*static*/ void
VMAddressSpace::_DeleteIfUnreferenced(team_id id)
{