From 9e4a5c5fdc8d9ea22ddefc25fa939a4c3b2b329f Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 1 Oct 2009 09:40:41 +0000 Subject: [PATCH] Since arrays can be multi-dimensional, a single index does not suffice to identify an element. We use the name string of the TypeComponent as index path. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33395 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/model/TypeComponentPath.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/apps/debugger/model/TypeComponentPath.h b/src/apps/debugger/model/TypeComponentPath.h index 4f927e2c34..831d22a01e 100644 --- a/src/apps/debugger/model/TypeComponentPath.h +++ b/src/apps/debugger/model/TypeComponentPath.h @@ -11,6 +11,7 @@ #include #include +#include "ArrayIndexPath.h" #include "Type.h" @@ -68,12 +69,20 @@ struct TypeComponent { this->name = name; } - void SetToArrayElement(type_kind typeKind, uint64 index) + void SetToArrayElement(type_kind typeKind, const BString& indexPath) { this->componentKind = TYPE_COMPONENT_ARRAY_ELEMENT; this->typeKind = typeKind; - this->index = index; - this->name = name; + this->index = 0; + this->name = indexPath; + } + + bool SetToArrayElement(type_kind typeKind, const ArrayIndexPath& indexPath) + { + this->componentKind = TYPE_COMPONENT_ARRAY_ELEMENT; + this->typeKind = typeKind; + this->index = 0; + return indexPath.GetPathString(this->name); } uint32 HashValue() const;