~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/Mono.Debugging/Mono.Debugging.Evaluation/ExceptionInfoSource.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
using Mono.Debugging.Client;
29
29
using Mono.Debugging.Backend;
30
30
using System.Collections.Generic;
 
31
using System.Text.RegularExpressions;
31
32
 
32
33
namespace Mono.Debugging.Evaluation
33
34
{
131
132
                                return ObjectValue.CreateUnknown ("StackTrace");
132
133
                        
133
134
                        List<ObjectValue> frames = new List<ObjectValue> ();
 
135
 
 
136
                        var regex = new Regex ("at (.*) in (.*):(.*)");
134
137
                        
135
138
                        foreach (string sframe in trace.Split ('\n')) {
136
139
                                string txt = sframe.Trim (' ', '\r','\n');
137
140
                                string file = "";
138
141
                                int line = 0;
139
142
                                int col = 0;
 
143
                                var match = regex.Match (sframe);
 
144
                                if (match.Success) {
 
145
                                        txt = match.Groups [1].ToString ();
 
146
                                        file = match.Groups [2].ToString ();
 
147
                                        int.TryParse (match.Groups [3].ToString (), out line);
 
148
                                }
140
149
                                ObjectValue fileVal = ObjectValue.CreatePrimitive (null, new ObjectPath("File"), "", new EvaluationResult (file), ObjectValueFlags.None);
141
150
                                ObjectValue lineVal = ObjectValue.CreatePrimitive (null, new ObjectPath("Line"), "", new EvaluationResult (line.ToString ()), ObjectValueFlags.None);
142
151
                                ObjectValue colVal = ObjectValue.CreatePrimitive (null, new ObjectPath("Column"), "", new EvaluationResult (col.ToString ()), ObjectValueFlags.None);