From 761061374fcba55b1b869f3caf38c4998a343377 Mon Sep 17 00:00:00 2001 From: Lucas BAJOLET Date: Fri, 22 Feb 2013 14:04:13 -0500 Subject: [PATCH] nitdbg: Gets a collection nested in a MutableInstance Signed-off-by: Lucas BAJOLET --- src/debugger.nit | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/debugger.nit b/src/debugger.nit index c15963d..09518e5 100644 --- a/src/debugger.nit +++ b/src/debugger.nit @@ -503,6 +503,24 @@ class Debugger return null end + # Gets a collection in a MutableInstance + fun get_primary_collection(container: MutableInstance): nullable SequenceRead[Object] + do + var items_of_array = get_attribute_in_mutable_instance(container, "items") + if items_of_array != null then + var array = container.attributes[items_of_array] + + if array isa PrimitiveInstance[Object] then + var sequenceRead_final = array.val + if sequenceRead_final isa SequenceRead[Object] then + return sequenceRead_final + end + end + end + + return null + end + ####################################################################### ## Breakpoint placing functions ## ####################################################################### -- 1.7.9.5