@@ -382,7 +382,6 @@ public UserContainerLoaders<ElementLoader> GetLoaders<ElementLoader>(Loaders loa
382382 ClassScopeExpression exprContainerName ;
383383 }
384384
385- // TODO: This class could possibly be simplified if UserArray was used here
386385 class UserArrayEntry : IUserContainerEntry
387386 {
388387 public UserArrayEntry ( string strPointer , string strSize )
@@ -407,36 +406,30 @@ public UserContainerLoaders<ElementLoader> GetLoaders<ElementLoader>(Loaders loa
407406 // This may not be needed because below elementType is retrieved
408407 // by dereferencing the pointer/array.
409408
410- string pointerName = exprPointer . GetString ( name ) ;
411- string elementType = ExpressionParser . GetValueType ( debugger , '*' + pointerName ) ;
412- if ( elementType == null )
413- return null ;
414-
415- string sizeName = exprSize . GetString ( name ) ;
416- int size = ExpressionParser . LoadSize ( debugger , sizeName ) ;
417- if ( size <= 0 )
409+ string type = ExpressionParser . GetValueType ( debugger , name ) ;
410+ if ( type == null )
418411 return null ;
419412
420- // TODO: This has sense only in C++
421-
422- string arrName = pointerName + ',' + size ;
423- string arrType = elementType + '[' + size + ']' ;
424-
425- ContainerLoader containerLoader = loaders . FindByType ( ExpressionLoader . Kind . Container , arrName , arrType ) as ContainerLoader ;
426- if ( containerLoader == null )
427- return null ;
413+ // NOTE: This could be done in Initialize(),however in all other places
414+ // container is created an initialized during Loading.
415+ // So do this in this case as well.
416+ string id = Util . BaseType ( type ) ;
417+ UserArray containerLoader = new UserArray ( id , exprPointer , exprSize ) ;
418+ containerLoader . Initialize ( debugger , name ) ;
428419
420+ string elementType = containerLoader . ElementType ( type ) ;
421+ string elementName = containerLoader . ElementName ( name , elementType ) ;
429422 ElementLoader elementLoader = loaders . FindByType ( elementKindConstraint ,
430- containerLoader . ElementName ( arrName , elementType ) ,
423+ elementName ,
431424 elementType ) as ElementLoader ;
432425 if ( elementLoader == null )
433426 return null ;
434427
435428 UserContainerLoaders < ElementLoader > result = new UserContainerLoaders < ElementLoader > ( ) ;
436429 result . ContainerLoader = containerLoader ;
437430 result . ElementLoader = elementLoader ;
438- result . ContainerName = arrName ;
439- result . ContainerType = arrType ;
431+ result . ContainerName = name ;
432+ result . ContainerType = type ;
440433 result . ElementType = elementType ;
441434 return result ;
442435 }
0 commit comments