本文整理汇总了C#中Mono.Debugging.Client.TargetEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TargetEventArgs类的具体用法?C# TargetEventArgs怎么用?C# TargetEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetEventArgs类属于Mono.Debugging.Client命名空间,在下文中一共展示了TargetEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BreakpointHit
void BreakpointHit(string path, int line)
{
foreach (var bp in Breakpoints.GetBreakpoints())
{
if(bp.FileName == path && bp.Line == line)
{
var args = new TargetEventArgs (TargetEventType.TargetHitBreakpoint);
args.BreakEvent = bp;
OnTargetEvent (args);
break;
}
}
}
开发者ID:lukaszunity,项目名称:MonoDevelop.UnityDebug,代码行数:13,代码来源:UnitySoftDebuggerSession.cs
示例2: OnProcessExit
void OnProcessExit (object sender, CorProcessEventArgs e)
{
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited);
// If the main thread stopped, terminate the debugger session
if (e.Process.Id == process.Id) {
lock (terminateLock) {
process = null;
ThreadPool.QueueUserWorkItem (delegate
{
// The Terminate call will fail if called in the event handler
dbg.Terminate ();
dbg = null;
GC.Collect ();
});
}
}
OnTargetEvent (args);
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:20,代码来源:CorDebuggerSession.cs
示例3: OnTargetEvent
static void OnTargetEvent (object sender, TargetEventArgs args)
{
try {
switch (args.Type) {
case TargetEventType.TargetExited:
Cleanup ();
break;
case TargetEventType.TargetSignaled:
case TargetEventType.TargetStopped:
case TargetEventType.TargetHitBreakpoint:
case TargetEventType.TargetInterrupted:
case TargetEventType.UnhandledException:
case TargetEventType.ExceptionThrown:
SetCurrentBacktrace (args.Backtrace);
NotifyPaused ();
NotifyException (args);
break;
default:
break;
}
} catch (Exception ex) {
LoggingService.LogError ("Error handling debugger target event", ex);
}
}
开发者ID:alistick,项目名称:monodevelop,代码行数:24,代码来源:DebuggingService.cs
示例4: HandleBreakEventSet
void HandleBreakEventSet (Event[] es, bool dequeuing)
{
if (dequeuing && exited)
return;
OnHandleBreakEventSet (es);
bool resume = true;
ObjectMirror exception = null;
TargetEventType etype = TargetEventType.TargetStopped;
BreakEvent breakEvent = null;
if (es[0] is ExceptionEvent) {
var bad = es.FirstOrDefault (ee => !(ee is ExceptionEvent));
if (bad != null)
throw new Exception ("Catchpoint eventset had unexpected event type " + bad.GetType ());
var ev = (ExceptionEvent)es[0];
if (ev.Request == unhandledExceptionRequest)
etype = TargetEventType.UnhandledException;
else
etype = TargetEventType.ExceptionThrown;
exception = ev.Exception;
if (ev.Request != unhandledExceptionRequest || exception.Type.FullName != "System.Threading.ThreadAbortException")
resume = false;
}
else {
//always need to evaluate all breakpoints, some might be tracepoints or conditional bps with counters
foreach (Event e in es) {
BreakpointEvent be = e as BreakpointEvent;
if (be != null) {
if (!HandleBreakpoint (e.Thread, be.Request)) {
etype = TargetEventType.TargetHitBreakpoint;
BreakInfo binfo;
if (breakpoints.TryGetValue (be.Request, out binfo))
breakEvent = binfo.BreakEvent;
resume = false;
}
} else if (e is StepEvent) {
etype = TargetEventType.TargetStopped;
resume = false;
} else {
throw new Exception ("Break eventset had unexpected event type " + e.GetType ());
}
}
}
if (resume) {
//all breakpoints were conditional and evaluated as false
vm.Resume ();
DequeueEventsForFirstThread ();
} else {
if (currentStepRequest != null) {
currentStepRequest.Enabled = false;
currentStepRequest = null;
}
current_thread = recent_thread = es[0].Thread;
TargetEventArgs args = new TargetEventArgs (etype);
args.Process = OnGetProcesses () [0];
args.Thread = GetThread (args.Process, current_thread);
args.Backtrace = GetThreadBacktrace (current_thread);
args.BreakEvent = breakEvent;
if (exception != null)
activeExceptionsByThread [current_thread.ThreadId] = exception;
OnTargetEvent (args);
}
}
开发者ID:trustme,项目名称:monodevelop,代码行数:68,代码来源:SoftDebuggerSession.cs
示例5: OnStepComplete
void OnStepComplete (object sender, CorStepCompleteEventArgs e)
{
lock (debugLock) {
if (evaluating) {
e.Continue = true;
return;
}
}
OnStopped ();
e.Continue = false;
SetActiveThread (e.Thread);
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetStopped);
args.Process = GetProcess (process);
args.Thread = GetThread (e.Thread);
args.Backtrace = new Backtrace (new CorBacktrace (e.Thread, this));
OnTargetEvent (args);
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:17,代码来源:CorDebuggerSession.cs
示例6: ForceExit
void ForceExit ()
{
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited);
OnTargetEvent (args);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:5,代码来源:DebuggerSession.cs
示例7: HandleBreakEventSet
//.........这里部分代码省略.........
throw new Exception ("Catchpoint eventset had unexpected event type " + bad.GetType ());
var ev = (ExceptionEvent)es[0];
if (ev.Request == unhandledExceptionRequest)
etype = TargetEventType.UnhandledException;
else
etype = TargetEventType.ExceptionThrown;
exception = ev.Exception;
if (ev.Request != unhandledExceptionRequest || exception.Type.FullName != "System.Threading.ThreadAbortException")
resume = false;
}
else {
//always need to evaluate all breakpoints, some might be tracepoints or conditional bps with counters
foreach (Event e in es) {
if (e.EventType == EventType.Breakpoint) {
var be = e as BreakpointEvent;
BreakInfo binfo;
if (!HandleBreakpoint (e.Thread, be.Request)) {
etype = TargetEventType.TargetHitBreakpoint;
autoStepInto = false;
resume = false;
}
if (breakpoints.TryGetValue (be.Request, out binfo)) {
if (currentStepRequest != null &&
binfo.Location.ILOffset == currentAddress &&
e.Thread.Id == currentStepRequest.Thread.Id)
redoCurrentStep = true;
breakEvent = binfo.BreakEvent;
}
} else if (e.EventType == EventType.Step) {
var stepRequest = e.Request as StepEventRequest;
steppedInto = IsStepIntoRequest (stepRequest);
steppedOut = IsStepOutRequest (stepRequest);
etype = TargetEventType.TargetStopped;
resume = false;
} else if (e.EventType == EventType.UserBreak) {
etype = TargetEventType.TargetStopped;
autoStepInto = false;
resume = false;
} else {
throw new Exception ("Break eventset had unexpected event type " + e.GetType ());
}
}
}
if (redoCurrentStep) {
StepDepth depth = currentStepRequest.Depth;
StepSize size = currentStepRequest.Size;
current_thread = recent_thread = es[0].Thread;
currentStepRequest.Enabled = false;
currentStepRequest = null;
Step (depth, size);
} else if (resume) {
//all breakpoints were conditional and evaluated as false
vm.Resume ();
DequeueEventsForFirstThread ();
} else {
if (currentStepRequest != null) {
currentStepRequest.Enabled = false;
currentStepRequest = null;
}
current_thread = recent_thread = es[0].Thread;
if (exception != null)
activeExceptionsByThread [current_thread.ThreadId] = exception;
var backtrace = GetThreadBacktrace (current_thread);
bool stepOut = false;
if (backtrace.FrameCount > 0) {
var frame = backtrace.GetFrame (0) as SoftDebuggerStackFrame;
currentAddress = frame != null ? frame.Address : -1;
if (steppedInto && Options.StepOverPropertiesAndOperators)
stepOut = frame != null && IsPropertyOrOperatorMethod (frame.StackFrame.Method);
}
if (stepOut) {
// We will want to call StepInto once StepOut returns...
autoStepInto = true;
Step (StepDepth.Out, StepSize.Min);
} else if (steppedOut && autoStepInto) {
autoStepInto = false;
Step (StepDepth.Into, StepSize.Min);
} else {
var args = new TargetEventArgs (etype);
args.Process = OnGetProcesses () [0];
args.Thread = GetThread (args.Process, current_thread);
args.Backtrace = backtrace;
args.BreakEvent = breakEvent;
OnTargetEvent (args);
}
}
}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:101,代码来源:SoftDebuggerSession.cs
示例8: FireTargetEvent
void FireTargetEvent (TargetEventType type, ResultData curFrame)
{
UpdateHitCountData ();
TargetEventArgs args = new TargetEventArgs (type);
if (type != TargetEventType.TargetExited) {
GdbCommandResult res = RunCommand ("-stack-info-depth");
int fcount = int.Parse (res.GetValue ("depth"));
GdbBacktrace bt = new GdbBacktrace (this, activeThread, fcount, curFrame);
args.Backtrace = new Backtrace (bt);
args.Thread = GetThread (activeThread);
}
OnTargetEvent (args);
}
开发者ID:telebovich,项目名称:monodevelop,代码行数:16,代码来源:GdbSession.cs
示例9: ExceptionHandler
private static void ExceptionHandler(object sender, TargetEventArgs e, bool firstChance)
{
SetBacktrace(e.Backtrace);
_isPaused = true;
_isExcepted = !firstChance;
ExceptionPrinter.Print(Backtrace.CurrentStackFrame.GetException());
if (CommandLine.Suspended)
CommandLine.ResumeEvent.Set();
}
开发者ID:GunioRobot,项目名称:sdb-cli,代码行数:12,代码来源:SoftDebugger.cs
示例10: FireBreakPoint
void FireBreakPoint(ulong offset)
{
TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetHitBreakpoint);
ulong tempoff = (ulong)offset;
if (breakpoints.ContainsKey(tempoff))
{
breakpoints[(ulong)tempoff].EventInfo.UpdateHitCount((int)breakpoints[(ulong)tempoff].Breakpoint.HitCount);
args.BreakEvent = breakpoints[(ulong)tempoff].EventInfo.BreakEvent;
}
else
{
args = new TargetEventArgs(TargetEventType.TargetStopped);
BreakEventInfo breakInfo = new BreakEventInfo();
breakInfo.Handle = tempoff;
breakInfo.SetStatus (BreakEventStatus.Bound, null);
string fn;
uint ln;
if (Engine.Symbols.GetLineByOffset(offset, out fn, out ln))
{
//breakInfo.BreakEvent = new Breakpoint(fn, (int)ln);
args.BreakEvent = breakInfo.BreakEvent;
}
}
ProcessInfo process = OnGetProcesses()[0];
args.Process = new ProcessInfo(process.Id, process.Name);
args.Backtrace = new Backtrace(new DDebugBacktrace(this, activeThread, Engine));
ThreadPool.QueueUserWorkItem(delegate(object data)
{
try
{
OnTargetEvent((TargetEventArgs)data);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}, args);
}
开发者ID:nazriel,项目名称:Mono-D,代码行数:42,代码来源:DDebugSession.cs
示例11: OnExit
protected override void OnExit ()
{
lock (gdbLock) {
InternalStop ();
RunCommand ("kill");
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited);
OnTargetEvent (args);
/* proc.Kill ();
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited);
OnTargetEvent (args);
*/ }
}
开发者ID:telebovich,项目名称:monodevelop,代码行数:12,代码来源:GdbSession.cs
示例12: OnExit
protected override void OnExit()
{
OnStop();
TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetExited);
OnTargetEvent(args);
}
开发者ID:nazriel,项目名称:Mono-D,代码行数:7,代码来源:DDebugSession.cs
示例13: OnDetach
protected override void OnDetach()
{
TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetExited);
OnTargetEvent(args);
}
开发者ID:nazriel,项目名称:Mono-D,代码行数:5,代码来源:DDebugSession.cs
示例14: OnTargetEvent
public void OnTargetEvent (TargetEventArgs args)
{
frontend.NotifyTargetEvent (args);
if (args.Type == TargetEventType.TargetExited)
StopDebugger ();
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:6,代码来源:DebuggerController.cs
示例15: NotifyTargetEvent
public void NotifyTargetEvent (TargetEventArgs args)
{
session.OnTargetEvent (args);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:4,代码来源:DebuggerSession.cs
示例16: HandleEvent
//.........这里部分代码省略.........
if (e is AssemblyUnloadEvent) {
AssemblyUnloadEvent aue = (AssemblyUnloadEvent)e;
// Mark affected breakpoints as pending again
List<KeyValuePair<EventRequest,BreakInfo>> affectedBreakpoints = new List<KeyValuePair<EventRequest, BreakInfo>> (
breakpoints.Where (x=> (x.Value.Location.Method.DeclaringType.Assembly.Location.Equals (aue.Assembly.Location, StringComparison.OrdinalIgnoreCase)))
);
foreach (KeyValuePair<EventRequest,BreakInfo> breakpoint in affectedBreakpoints) {
OnDebuggerOutput (false, string.Format ("Re-pending breakpoint at {0}:{1}\n",
Path.GetFileName (breakpoint.Value.Location.SourceFile),
breakpoint.Value.Location.LineNumber));
breakpoints.Remove (breakpoint.Key);
pending_bes.Add (breakpoint.Value.BreakEvent);
}
// Remove affected types from the loaded types list
List<string> affectedTypes = new List<string> (
from pair in types
where pair.Value.Assembly.Location.Equals (aue.Assembly.Location, StringComparison.OrdinalIgnoreCase)
select pair.Key
);
foreach (string typename in affectedTypes) {
types.Remove (typename);
}
foreach (var pair in source_to_type) {
pair.Value.RemoveAll (delegate (TypeMirror mirror){
return mirror.Assembly.Location.Equals (aue.Assembly.Location, StringComparison.OrdinalIgnoreCase);
});
}
OnDebuggerOutput (false, string.Format ("Unloaded assembly: {0}\n", aue.Assembly.Location));
}
if (e is VMStartEvent) {
//HACK: 2.6.1 VM doesn't emit type load event, so work around it
var t = vm.RootDomain.Corlib.GetType ("System.Exception", false, false);
if (t != null)
ResolveBreakpoints (t);
OnVMStartEvent ((VMStartEvent) e);
}
if (e is TypeLoadEvent) {
var t = ((TypeLoadEvent)e).Type;
string typeName = t.FullName;
if (types.ContainsKey (typeName)) {
if (typeName != "System.Exception")
LoggingService.LogError ("Type '" + typeName + "' loaded more than once", null);
} else {
ResolveBreakpoints (t);
}
}
if (e is BreakpointEvent) {
BreakpointEvent be = (BreakpointEvent)e;
if (!HandleBreakpoint (e.Thread, be.Request)) {
etype = TargetEventType.TargetHitBreakpoint;
resume = false;
}
}
if (e is ExceptionEvent) {
etype = TargetEventType.ExceptionThrown;
var ev = (ExceptionEvent)e;
exception = ev.Exception;
if (ev.Request != unhandledExceptionRequest || exception.Type.FullName != "System.Threading.ThreadAbortException")
resume = false;
}
if (e is StepEvent) {
etype = TargetEventType.TargetStopped;
resume = false;
}
if (e is ThreadStartEvent) {
ThreadStartEvent ts = (ThreadStartEvent)e;
OnDebuggerOutput (false, string.Format ("Thread started: {0}\n", ts.Thread.Name));
}
if (resume)
vm.Resume ();
else {
if (currentStepRequest != null) {
currentStepRequest.Enabled = false;
currentStepRequest = null;
}
current_thread = recent_thread = e.Thread;
TargetEventArgs args = new TargetEventArgs (etype);
args.Process = OnGetProcesses () [0];
args.Thread = GetThread (args.Process, current_thread);
args.Backtrace = GetThreadBacktrace (current_thread);
if (exception != null)
activeExceptionsByThread [current_thread.Id] = exception;
OnTargetEvent (args);
}
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:101,代码来源:SoftDebuggerSession.cs
示例17: ForceStop
void ForceStop ()
{
TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetStopped);
OnTargetEvent (args);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:5,代码来源:DebuggerSession.cs
示例18: OnTargetEvent
internal protected void OnTargetEvent (TargetEventArgs args)
{
currentProcesses = null;
if (args.Process != null)
args.Process.Attach (this);
if (args.Thread != null) {
args.Thread.Attach (this);
activeThread = args.Thread;
}
if (args.Backtrace != null)
args.Backtrace.Attach (this);
EventHandler<TargetEventArgs> evnt = null;
switch (args.Type) {
case TargetEventType.ExceptionThrown:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetExceptionThrown;
break;
case TargetEventType.TargetExited:
lock (slock) {
IsRunning = false;
IsConnected = false;
HasExited = true;
}
EventHandler handler = TargetExited;
if (handler != null)
handler (this, args);
break;
case TargetEventType.TargetHitBreakpoint:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetHitBreakpoint;
break;
case TargetEventType.TargetInterrupted:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetInterrupted;
break;
case TargetEventType.TargetSignaled:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetSignaled;
break;
case TargetEventType.TargetStopped:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetStopped;
break;
case TargetEventType.UnhandledException:
lock (slock) {
IsRunning = false;
args.IsStopEvent = true;
}
evnt = TargetUnhandledException;
break;
case TargetEventType.TargetReady:
evnt = TargetReady;
break;
case TargetEventType.ThreadStarted:
evnt = TargetThreadStarted;
break;
case TargetEventType.ThreadStopped:
evnt = TargetThreadStopped;
break;
}
if (evnt != null)
evnt (this, args);
EventHandler<TargetEventArgs> targetEvent = TargetEvent;
if (targetEvent != null)
targetEvent (this, args);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:85,代码来源:DebuggerSession.cs
示例19: OnTargetEvent
internal protected void OnTargetEvent (TargetEventArgs args)
{
currentProcesses = null;
if (args.Process != null)
args.Process.Attach (this);
if (args.Thread != null) {
args.Thread.Attach (this);
activeThread = args.Thread;
}
if (args.Backtrace != null)
args.Backtrace.Attach (this);
switch (args.Type) {
case TargetEventType.ExceptionThrown:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetExceptionThrown != null)
TargetExceptionThrown (this, args);
break;
case TargetEventType.TargetExited:
lock (slock) {
isRunning = false;
started = false;
}
if (TargetExited != null)
TargetExited (this, args);
break;
case TargetEventType.TargetHitBreakpoint:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetHitBreakpoint != null)
TargetHitBreakpoint (this, args);
break;
case TargetEventType.TargetInterrupted:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetInterrupted != null)
TargetInterrupted (this, args);
break;
case TargetEventType.TargetSignaled:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetSignaled != null)
TargetSignaled (this, args);
break;
case TargetEventType.TargetStopped:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetStopped != null)
TargetStopped (this, args);
break;
case TargetEventType.UnhandledException:
lock (slock) {
isRunning = false;
args.IsStopEvent = true;
}
if (TargetUnhandledException != null)
TargetUnhandledException (this, args);
break;
case TargetEventType.TargetReady:
if (TargetReady != null)
TargetReady (this, args);
break;
case TargetEventType.ThreadStarted:
if (TargetThreadStarted != null)
TargetThreadStarted (this, args);
break;
case TargetEventType.ThreadStopped:
if (TargetThreadStopped != null)
TargetThreadStopped (this, args);
break;
}
if (TargetEvent != null)
TargetEvent (this, args);
}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:86,代码来源:DebuggerSession.cs
示例20: MDebuggerSession_TargetStopped
private void MDebuggerSession_TargetStopped(object sender, TargetEventArgs e)
{
mDoneEvent.Set();
}
开发者ID:minuowa,项目名称:Monos,代码行数:4,代码来源:Executer.cs
注:本文中的Mono.Debugging.Client.TargetEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论