From 89881c9b4d3c9681dff55c84b83ced38879d5b89 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Wed, 24 Aug 2011 17:30:42 -0300 Subject: [PATCH] Cache source files. --- .../Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs index d17fac5dd8d..fac5133cfa1 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs @@ -525,8 +525,18 @@ namespace Mono.Debugger.Soft return GetSourceFiles (false); } + string[] source_files; + string[] source_files_full_path; public string[] GetSourceFiles (bool return_full_paths) { - return vm.conn.Type_GetSourceFiles (id, return_full_paths); + string[] res = return_full_paths ? source_files_full_path : source_files; + if (res == null) { + res = vm.conn.Type_GetSourceFiles (id, return_full_paths); + if (return_full_paths) + source_files_full_path = res; + else + source_files = res; + } + return res; } public C.TypeDefinition Metadata { -- 2.11.4.GIT