本文整理汇总了C#中Mono.Debugging.Client.SourceLocation类的典型用法代码示例。如果您正苦于以下问题:C# SourceLocation类的具体用法?C# SourceLocation怎么用?C# SourceLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceLocation类属于Mono.Debugging.Client命名空间,在下文中一共展示了SourceLocation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SoftEvaluationContext
public SoftEvaluationContext(SoftDebuggerSession session, StackFrame frame, DC.EvaluationOptions options)
: base(options)
{
Frame = frame;
Thread = frame.Thread;
Domain = frame.Domain;
string method = frame.Method.Name;
if (frame.Method.DeclaringType != null)
method = frame.Method.DeclaringType.FullName + "." + method;
var location = new DC.SourceLocation (method, frame.FileName, frame.LineNumber, frame.ColumnNumber, frame.EndLineNumber, frame.EndColumnNumber, frame.Location.SourceFileHash);
string language;
if (frame.Method != null) {
language = frame.IsNativeTransition ? "Transition" : "Managed";
} else {
language = "Native";
}
Evaluator = session.GetEvaluator (new DC.StackFrame (frame.ILOffset, location, language, session.IsExternalCode (frame), true));
Adapter = session.Adaptor;
this.session = session;
stackVersion = session.StackVersion;
sourceAvailable = !string.IsNullOrEmpty (frame.FileName) && System.IO.File.Exists (frame.FileName);
}
开发者ID:nerzhulart,项目名称:debugger-libs,代码行数:25,代码来源:SoftEvaluationContext.cs
示例2: ResolveType
static string ResolveType (string identifier, SourceLocation location)
{
switch (identifier) {
case "SomeClassInNamespace":
return "MonoDevelop.Debugger.Tests.TestApp.SomeClassInNamespace";
case "ParentNestedClass":
return "MonoDevelop.Debugger.Tests.TestApp.TestEvaluationParent.ParentNestedClass";
case "NestedClass":
return "MonoDevelop.Debugger.Tests.TestApp.TestEvaluation.NestedClass";
case "TestEvaluation":
return "MonoDevelop.Debugger.Tests.TestApp.TestEvaluation";
case "NestedGenericClass`2":
return "MonoDevelop.Debugger.Tests.TestApp.TestEvaluation.NestedGenericClass";
case "Dictionary`2":
return "System.Collections.Generic.Dictionary";
case "Thing`1":
return "Thing";
case "A":
return "A";
case "B":
return "B";
case "C":
return "C";
case "System":
return "System";
case "MonoDevelop":
return "MonoDevelop";
case "SomeEnum":
return "SomeEnum";
}
return null;
}
开发者ID:lkalif,项目名称:monodevelop,代码行数:32,代码来源:EvaluationTests.cs
示例3: StackFrame
public StackFrame (long address, SourceLocation location, string language, bool isExternalCode, bool hasDebugInfo)
{
this.address = address;
this.location = location;
this.language = language;
this.isExternalCode = isExternalCode;
this.hasDebugInfo = hasDebugInfo;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:8,代码来源:StackFrame.cs
示例4: CreateStackFrame
DC.StackFrame CreateStackFrame (MDB.StackFrame frame)
{
string method = frame.Method.Name;
if (frame.Method.DeclaringType != null)
method = frame.Method.DeclaringType.FullName + "." + method;
var location = new DC.SourceLocation (method, frame.FileName, frame.LineNumber);
var lang = frame.Method != null? "Managed" : "Native";
return new DC.StackFrame (frame.ILOffset, frame.Method.FullName, location, lang, session.IsExternalCode (frame), true);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:9,代码来源:SoftDebuggerBacktrace.cs
示例5: CreateStackFrame
DC.StackFrame CreateStackFrame (MDB.StackFrame frame)
{
MDB.MethodMirror method = frame.Method;
MDB.TypeMirror type = method.DeclaringType;
string methodName = method.Name;
if (type != null)
methodName = type.FullName + "." + methodName;
var location = new DC.SourceLocation (methodName, SoftDebuggerSession.NormalizePath (frame.FileName), frame.LineNumber);
var lang = frame.Method != null ? "Managed" : "Native";
return new DC.StackFrame (frame.ILOffset, method.FullName, location, lang, session.IsExternalCode (frame), true, type.Module.FullyQualifiedName, type.FullName);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:11,代码来源:SoftDebuggerBacktrace.cs
示例6: StackFrame
public StackFrame (long address, string addressSpace, SourceLocation location, string language, bool isExternalCode, bool hasDebugInfo, string fullModuleName, string fullTypeName)
{
this.address = address;
this.addressSpace = addressSpace;
this.location = location;
this.language = language;
this.isExternalCode = isExternalCode;
this.hasDebugInfo = hasDebugInfo;
this.fullModuleName = fullModuleName;
this.fullTypeName = fullTypeName;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:11,代码来源:StackFrame.cs
示例7: SoftEvaluationContext
public SoftEvaluationContext (SoftDebuggerSession session, StackFrame frame, DC.EvaluationOptions options): base (options)
{
Frame = frame;
Thread = frame.Thread;
string method = frame.Method.Name;
if (frame.Method.DeclaringType != null)
method = frame.Method.DeclaringType.FullName + "." + method;
var location = new DC.SourceLocation (method, frame.FileName, frame.LineNumber);
var lang = frame.Method != null? "Managed" : "Native";
Evaluator = session.GetEvaluator (new DC.StackFrame (frame.ILOffset, location, lang, session.IsExternalCode (frame), true));
Adapter = session.Adaptor;
this.session = session;
this.stackVersion = session.StackVersion;
sourceAvailable = !string.IsNullOrEmpty (frame.FileName) && System.IO.File.Exists (frame.FileName);
}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:17,代码来源:SoftEvaluationContext.cs
示例8: Start
protected void Start (string test)
{
TargetRuntime runtime;
switch (EngineId) {
case "MonoDevelop.Debugger.Win32":
runtime = Runtime.SystemAssemblyService.GetTargetRuntime ("MS.NET");
break;
case "Mono.Debugger.Soft":
runtime = Runtime.SystemAssemblyService.GetTargetRuntimes ()
.OfType<MonoTargetRuntime> ()
.OrderByDescending(o => o.Version)
.FirstOrDefault ();
break;
default:
runtime = Runtime.SystemAssemblyService.DefaultRuntime;
break;
}
if (runtime == null) {
Assert.Ignore ("Runtime not found for: {0}", EngineId);
return;
}
Console.WriteLine ("Target Runtime: " + runtime.DisplayRuntimeName + " " + runtime.Version);
// main/build/tests
FilePath path = Path.GetDirectoryName (GetType ().Assembly.Location);
var exe = Path.Combine (path, "MonoDevelop.Debugger.Tests.TestApp.exe");
var cmd = new DotNetExecutionCommand ();
cmd.TargetRuntime = runtime;
cmd.Command = exe;
cmd.Arguments = test;
if (Platform.IsWindows) {
var monoRuntime = runtime as MonoTargetRuntime;
if (monoRuntime != null) {
var psi = new System.Diagnostics.ProcessStartInfo (Path.Combine (monoRuntime.Prefix, "bin", "pdb2mdb.bat"), cmd.Command);
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
System.Diagnostics.Process.Start (psi).WaitForExit ();
}
}
var dsi = engine.CreateDebuggerStartInfo (cmd);
var soft = dsi as SoftDebuggerStartInfo;
if (soft != null) {
var assemblyName = AssemblyName.GetAssemblyName (exe);
soft.UserAssemblyNames = new List<AssemblyName> ();
soft.UserAssemblyNames.Add (assemblyName);
}
Session = engine.CreateSession ();
var ops = new DebuggerSessionOptions ();
ops.EvaluationOptions = EvaluationOptions.DefaultOptions;
ops.EvaluationOptions.AllowTargetInvoke = AllowTargetInvokes;
ops.EvaluationOptions.EvaluationTimeout = 100000;
path = path.ParentDirectory.ParentDirectory.Combine ("src", "addins", "MonoDevelop.Debugger", "MonoDevelop.Debugger.Tests.TestApp", test + ".cs").FullPath;
SourceFile = TextFile.ReadFile (path);
TestName = test;
AddBreakpoint ("break");
var done = new ManualResetEvent (false);
Session.OutputWriter = (isStderr, text) => Console.WriteLine ("PROC:" + text);
Session.TargetHitBreakpoint += (sender, e) => {
done.Set ();
Frame = e.Backtrace.GetFrame (0);
lastStoppedPosition = Frame.SourceLocation;
targetStoppedEvent.Set ();
};
Session.TargetExceptionThrown += (sender, e) => {
Frame = e.Backtrace.GetFrame (0);
for (int i = 0; i < e.Backtrace.FrameCount; i++) {
if (!e.Backtrace.GetFrame (i).IsExternalCode) {
Frame = e.Backtrace.GetFrame (i);
break;
}
}
lastStoppedPosition = Frame.SourceLocation;
targetStoppedEvent.Set ();
};
Session.TargetStopped += (sender, e) => {
Frame = e.Backtrace.GetFrame (0);
lastStoppedPosition = Frame.SourceLocation;
targetStoppedEvent.Set ();
};
var targetExited = new ManualResetEvent (false);
Session.TargetExited += delegate {
targetExited.Set ();
};
//.........这里部分代码省略.........
开发者ID:newky2k,项目名称:monodevelop,代码行数:101,代码来源:DebugTests.cs
示例9: Resolve
public abstract string Resolve (DebuggerSession session, SourceLocation location, string exp);
开发者ID:pgoron,项目名称:monodevelop,代码行数:1,代码来源:ExpressionEvaluator.cs
示例10: OnResolveExpression
/// <summary>
/// Called when an expression needs to be resolved
/// </summary>
/// <param name='expression'>
/// The expression
/// </param>
/// <param name='location'>
/// The source code location
/// </param>
/// <returns>
/// The resolved expression
/// </returns>
protected virtual string OnResolveExpression (string expression, SourceLocation location)
{
return defaultResolver.Resolve (this, location, expression);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:16,代码来源:DebuggerSession.cs
示例11: UpdateSourceFile
public void UpdateSourceFile(string newFilePath)
{
location = new SourceLocation (location.MethodName, newFilePath, location.Line, location.Column, location.EndLine, location.EndColumn, location.FileHash);
}
开发者ID:peterdocter,项目名称:debugger-libs,代码行数:4,代码来源:StackFrame.cs
示例12: CreateStackFrame
DC.StackFrame CreateStackFrame (MDB.StackFrame frame)
{
MDB.MethodMirror method = frame.Method;
MDB.TypeMirror type = method.DeclaringType;
string fileName = frame.FileName;
string typeFullName = null;
string typeFQN = null;
string methodName;
if (fileName != null)
fileName = SoftDebuggerSession.NormalizePath (fileName);
if (method.VirtualMachine.Version.AtLeast (2, 12) && method.IsGenericMethod) {
StringBuilder name = new StringBuilder (method.Name);
name.Append ('<');
if (method.VirtualMachine.Version.AtLeast (2, 15)) {
bool first = true;
foreach (var argumentType in method.GetGenericArguments ()) {
if (!first)
name.Append (", ");
name.Append (session.Adaptor.GetDisplayTypeName (argumentType.FullName));
first = false;
}
}
name.Append ('>');
methodName = name.ToString ();
} else {
methodName = method.Name;
}
// Compiler generated anonymous/lambda methods
bool special_method = false;
if (methodName [0] == '<' && methodName.Contains (">m__")) {
int nidx = methodName.IndexOf (">m__") + 2;
methodName = "AnonymousMethod" + methodName.Substring (nidx, method.Name.Length - nidx);
special_method = true;
}
if (type != null) {
string typeDisplayName = session.Adaptor.GetDisplayTypeName (type.FullName);
if (SoftDebuggerAdaptor.IsGeneratedType (type)) {
// The user-friendly method name is embedded in the generated type name
var mn = SoftDebuggerAdaptor.GetNameFromGeneratedType (type);
// Strip off the generated type name
int dot = typeDisplayName.LastIndexOf ('.');
var tname = typeDisplayName.Substring (0, dot);
// Keep any type arguments
int targs = typeDisplayName.LastIndexOf ('<');
if (targs > dot + 1)
mn += typeDisplayName.Substring (targs, typeDisplayName.Length - targs);
typeDisplayName = tname;
if (special_method)
typeDisplayName += "." + mn;
else
methodName = mn;
}
methodName = typeDisplayName + "." + methodName;
typeFQN = type.Module.FullyQualifiedName;
typeFullName = type.FullName;
}
var location = new DC.SourceLocation (methodName, fileName, frame.LineNumber);
var external = session.IsExternalCode (frame);
return new SoftDebuggerStackFrame (frame, method.FullName, location, "Managed", external, true, typeFQN, typeFullName);
}
开发者ID:nocache,项目名称:monodevelop,代码行数:79,代码来源:SoftDebuggerBacktrace.cs
示例13: CreateFrame
internal static StackFrame CreateFrame (MicroFrameworkDebuggerSession session, CorDebugFrame frame)
{
string file = "";
int line = 0;
string method = "";
string lang = "";
if (frame.FrameType == CorFrameType.ILFrame) {
if (frame.Function != null) {
uint tk = TinyCLR_TypeSystem.SymbollessSupport.TinyCLRTokenFromMethodDefToken (frame.Function.Token);
uint md = TinyCLR_TypeSystem.ClassMemberIndexFromTinyCLRToken (tk, frame.Function.Assembly);
method = session.Engine.GetMethodName (md, true);
var reader = frame.Function.Assembly.DebugData;
if (reader != null) {
var sim = new MethodSymbols (new Mono.Cecil.MetadataToken (frame.Function.Token));
//Ugliest hack ever
if(reader is Mono.Cecil.Mdb.MdbReader) {
for(int i = 0; i < 100; i++)
sim.Variables.Add(new VariableDefinition(null));
}
reader.Read (sim);
InstructionSymbol prevSp = new InstructionSymbol (-1, null);
foreach (var sp in sim.Instructions) {
if (sp.Offset > frame.IP)
break;
prevSp = sp;
}
if (prevSp.Offset != -1) {
line = prevSp.SequencePoint.StartLine;
file = prevSp.SequencePoint.Document.Url;
}
}
}
lang = "Managed";
}
// else if(frame.FrameType == CorFrameType.NativeFrame)
// {
// frame.GetNativeIP(out address);
// method = "<Unknown>";
// lang = "Native";
// }
else if (frame.FrameType == CorFrameType.InternalFrame) {
switch (((CorDebugInternalFrame)frame).FrameInternalType) {
case CorDebugInternalFrameType.STUBFRAME_M2U:
method = "[Managed to Native Transition]";
break;
case CorDebugInternalFrameType.STUBFRAME_U2M:
method = "[Native to Managed Transition]";
break;
case CorDebugInternalFrameType.STUBFRAME_LIGHTWEIGHT_FUNCTION:
method = "[Lightweight Method Call]";
break;
case CorDebugInternalFrameType.STUBFRAME_APPDOMAIN_TRANSITION:
method = "[Application Domain Transition]";
break;
case CorDebugInternalFrameType.STUBFRAME_FUNC_EVAL:
method = "[Function Evaluation]";
break;
}
}
if (method == null)
method = "<Unknown>";
var loc = new SourceLocation (method, file, line);
return new StackFrame ((long)0, loc, lang);
}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:65,代码来源:CorDebugBacktrace.cs
示例14: Resolve
public override string Resolve (DebuggerSession session, SourceLocation location, string exp)
{
return Resolve (session, location, exp, false);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:NRefactoryEvaluator.cs
示例15: NRefactoryExpressionResolverVisitor
public NRefactoryExpressionResolverVisitor(DebuggerSession session, SourceLocation location, string expression)
{
this.expression = expression.Replace ("\n", "").Replace ("\r", "");
this.session = session;
this.location = location;
}
开发者ID:0xb1dd1e,项目名称:debugger-libs,代码行数:6,代码来源:NRefactoryExpressionResolverVisitor.cs
示例16: CreateStackFrame
DC.StackFrame CreateStackFrame (MDB.StackFrame frame, int frameIndex)
{
MDB.MethodMirror method = frame.Method;
MDB.TypeMirror type = method.DeclaringType;
string fileName = frame.FileName;
string typeFullName = null;
string typeFQN = null;
string methodName;
if (fileName != null)
fileName = SoftDebuggerSession.NormalizePath (fileName);
if (method.VirtualMachine.Version.AtLeast (2, 12) && method.IsGenericMethod) {
StringBuilder name = new StringBuilder (method.Name);
name.Append ('<');
if (method.VirtualMachine.Version.AtLeast (2, 15)) {
bool first = true;
foreach (var argumentType in method.GetGenericArguments ()) {
if (!first)
name.Append (", ");
name.Append (session.Adaptor.GetDisplayTypeName (argumentType.FullName));
first = false;
}
}
name.Append ('>');
methodName = name.ToString ();
} else {
methodName = method.Name;
}
// Compiler generated anonymous/lambda methods
bool special_method = false;
if (methodName [0] == '<' && methodName.Contains (">m__")) {
int nidx = methodName.IndexOf (">m__", StringComparison.Ordinal) + 2;
methodName = "AnonymousMethod" + methodName.Substring (nidx, method.Name.Length - nidx);
special_method = true;
}
if (type != null) {
string typeDisplayName = session.Adaptor.GetDisplayTypeName (type.FullName);
if (SoftDebuggerAdaptor.IsGeneratedType (type)) {
// The user-friendly method name is embedded in the generated type name
var mn = SoftDebuggerAdaptor.GetNameFromGeneratedType (type);
// Strip off the generated type name
int dot = typeDisplayName.LastIndexOf ('.');
var tname = typeDisplayName.Substring (0, dot);
// Keep any type arguments
int targs = typeDisplayName.LastIndexOf ('<');
if (targs > dot + 1)
mn += typeDisplayName.Substring (targs, typeDisplayName.Length - targs);
typeDisplayName = tname;
if (special_method)
typeDisplayName += "." + mn;
else
methodName = mn;
}
methodName = typeDisplayName + "." + methodName;
typeFQN = type.Module.FullyQualifiedName;
typeFullName = type.FullName;
}
bool hidden = false;
if (session.VirtualMachine.Version.AtLeast (2, 21)) {
var ctx = GetEvaluationContext (frameIndex, session.EvaluationOptions);
var hiddenAttr = session.Adaptor.GetType (ctx, "System.Diagnostics.DebuggerHiddenAttribute") as MDB.TypeMirror;
hidden = method.GetCustomAttributes (hiddenAttr, true).Any ();
}
var location = new DC.SourceLocation (methodName, fileName, frame.LineNumber, frame.ColumnNumber);
var external = session.IsExternalCode (frame);
string addressSpace = string.Empty;
string language;
if (frame.Method != null) {
if (frame.IsNativeTransition) {
language = "Transition";
} else {
addressSpace = method.FullName;
language = "Managed";
}
} else {
language = "Native";
}
return new SoftDebuggerStackFrame (frame, addressSpace, location, language, external, true, hidden, typeFQN, typeFullName);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:100,代码来源:SoftDebuggerBacktrace.cs
示例17: SoftDebuggerStackFrame
public SoftDebuggerStackFrame (Mono.Debugger.Soft.StackFrame frame, string addressSpace, SourceLocation location, string language, bool isExternalCode, bool hasDebugInfo, bool isDebuggerHidden, string fullModuleName, string fullTypeName)
: base (frame.ILOffset, addressSpace, location, language, isExternalCode, hasDebugInfo, isDebuggerHidden, fullModuleName, fullTypeName)
{
StackFrame = frame;
}
开发者ID:segaman,项目名称:monodevelop,代码行数:5,代码来源:SoftDebuggerBacktrace.cs
示例18: SetNextStatement
public static void SetNextStatement (string fileName, int line, int column)
{
if (!IsDebugging || IsRunning || CheckIsBusy ())
return;
session.SetNextStatement (fileName, line, column);
var location = new SourceLocation (CurrentFrame.SourceLocation.MethodName, fileName, line);
nextStatementLocations[session.ActiveThread.Id] = location;
NotifyLocationChanged ();
}
开发者ID:newky2k,项目名称:monodevelop,代码行数:11,代码来源:DebuggingService.cs
示例19: ResolveIdentifierAsType
internal protected string ResolveIdentifierAsType (string identifier, SourceLocation location)
{
if (TypeResolverHandler != null)
return TypeResolverHandler (identifier, location);
else
return null;
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:7,代码来源:DebuggerSession.cs
示例20: CreateFrame
internal static StackFrame CreateFrame (CorDebuggerSession session, CorFrame frame)
{
uint address = 0;
string file = "";
int line = 0;
string method = "";
string lang = "";
string module = "";
string type = "";
if (frame.FrameType == CorFrameType.ILFrame) {
if (frame.Function != null) {
module = frame.Function.Module.Name;
CorMetadataImport importer = new CorMetadataImport (frame.Function.Module);
MethodInfo mi = importer.GetMethodInfo (frame.Function.Token);
method = mi.DeclaringType.FullName + "." + mi.Name;
type = mi.DeclaringType.FullName;
ISymbolReader reader = session.GetReaderForModule (frame.Function.Module.Name);
if (reader != null) {
ISymbolMethod met = reader.GetMethod (new SymbolToken (frame.Function.Token));
if (met != null) {
uint offset;
CorDebugMappingResult mappingResult;
frame.GetIP (out offset, out mappingResult);
SequencePoint prevSp = null;
foreach (SequencePoint sp in met.GetSequencePoints ()) {
if (sp.Offset > offset)
break;
prevSp = sp;
}
if (prevSp != null) {
line = prevSp.Line;
file = prevSp.Document.URL;
}
}
}
}
lang = "Managed";
}
else if (frame.FrameType == CorFrameType.NativeFrame) {
frame.GetNativeIP (out address);
method = "<Unknown>";
lang = "Native";
}
else if (frame.FrameType == CorFrameType.InternalFrame) {
switch (frame.InternalFrameType) {
case CorDebugInternalFrameType.STUBFRAME_M2U: method = "[Managed to Native Transition]"; break;
case CorDebugInternalFrameType.STUBFRAME_U2M: method = "[Native to Managed Transition]"; break;
case CorDebugInternalFrameType.STUBFRAME_LIGHTWEIGHT_FUNCTION: method = "[Lightweight Method Call]"; break;
case CorDebugInternalFrameType.STUBFRAME_APPDOMAIN_TRANSITION: method = "[Application Domain Transition]"; break;
case CorDebugInternalFrameType.STUBFRAME_FUNC_EVAL: method = "[Function Evaluation]"; break;
}
}
if (method == null)
method = "<Unknown>";
var loc = new SourceLocation (method, file, line);
return new StackFrame ((long) address, loc, lang);
}
开发者ID:fedorw,项目名称:monodevelop,代码行数:58,代码来源:CorDebuggerBacktrace.cs
注:本文中的Mono.Debugging.Client.SourceLocation类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论