• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Client.StackFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mono.Debugging.Client.StackFrame的典型用法代码示例。如果您正苦于以下问题:C# StackFrame类的具体用法?C# StackFrame怎么用?C# StackFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StackFrame类属于Mono.Debugging.Client命名空间,在下文中一共展示了StackFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnUpdateList

		public override void OnUpdateList ()
		{
			base.OnUpdateList ();
			StackFrame frame = DebuggingService.CurrentFrame;
			
			if (frame == null || !FrameEquals (frame, lastFrame)) {
				tree.ClearExpressions ();
				lastExpressions = null;
			}
			lastFrame = frame;
			
			if (frame == null)
				return;
			
			//FIXME: tree should use the local refs rather than expressions. ATM we exclude items without names
			var expr = new HashSet<string> (frame.GetAllLocals ().Select (i => i.Name)
				.Where (n => !string.IsNullOrEmpty (n) && n != "?"));
			
			//add expressions not in tree already, remove expressions that are longer valid
			if (lastExpressions != null) {
				foreach (string rem in lastExpressions.Except (expr))
					tree.RemoveExpression (rem);
				foreach (string rem in expr.Except (lastExpressions))
					tree.AddExpression (rem);
			} else {
				tree.AddExpressions (expr);
			}
			
			lastExpressions = expr;
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:30,代码来源:LocalsPad.cs


示例2: FrameEquals

		static bool FrameEquals (StackFrame a, StackFrame z)
		{
			if (null == a || null == z)
				return a == z;

			if (a.SourceLocation == null || z.SourceLocation == null)
				return a.SourceLocation == z.SourceLocation;

			if (a.SourceLocation.FileName == null) {
				if (z.SourceLocation.FileName != null)
					return false;
			} else {
				if (!a.SourceLocation.FileName.Equals (z.SourceLocation.FileName, StringComparison.Ordinal))
					return false;
			}

			if (a.SourceLocation.MethodName == null) {
				if (z.SourceLocation.MethodName != null)
					return false;

				return true;
			} else {
				return a.SourceLocation.MethodName.Equals (z.SourceLocation.MethodName, StringComparison.Ordinal);
			}
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:25,代码来源:LocalsPad.cs


示例3: FrameEquals

		static bool FrameEquals (StackFrame a, StackFrame z)
		{
			if (null == a || null == z)
				return a == z;
			return a.SourceLocation.FileName.Equals (z.SourceLocation.FileName, StringComparison.Ordinal) &&
			       a.SourceLocation.MethodName.Equals (z.SourceLocation.MethodName, StringComparison.Ordinal);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:LocalsPad.cs


示例4: DebugValueWindow

//		PinWindow pinWindow;
//		TreeIter currentPinIter;
		
		public DebugValueWindow (Mono.TextEditor.TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch): base (Gtk.WindowType.Toplevel)
		{
			this.TypeHint = WindowTypeHint.PopupMenu;
			this.AllowShrink = false;
			this.AllowGrow = false;
			this.Decorated = false;

			TransientFor = (Gtk.Window) editor.Toplevel;
			
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;
			
			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;
			
			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			ContentBox.Add (sw);
			
			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.RootPinAlwaysVisible = true;
			tree.PinnedWatch = watch;
			DocumentLocation location = editor.Document.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line;
			tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName;
			
			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += delegate {
				Destroy ();
			};
			
//			tree.MotionNotifyEvent += HandleTreeMotionNotifyEvent;
			
			sw.ShowAll ();
			
//			pinWindow = new PinWindow (this);
//			pinWindow.SetPinned (false);
//			pinWindow.ButtonPressEvent += HandlePinWindowButtonPressEvent;
			
			tree.StartEditing += delegate {
				Modal = true;
			};
			
			tree.EndEditing += delegate {
				Modal = false;
			};

			ShowArrow = true;
			Theme.CornerRadius = 3;
		}
开发者ID:kekekeks,项目名称:monodevelop,代码行数:61,代码来源:DebugValueWindow.cs


示例5: GetStackFrames

		public override StackFrame[] GetStackFrames (int firstIndex, int lastIndex)
		{
			if (lastIndex >= FrameList.Count)
				lastIndex = FrameList.Count - 1;
			StackFrame[] array = new StackFrame[lastIndex - firstIndex + 1];
			for (int n = 0; n < array.Length; n++)
				array [n] = CreateFrame (session, FrameList [n + firstIndex]);
			return array;
		}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:9,代码来源:CorDebugBacktrace.cs


示例6: OnUpdateList

		public override void OnUpdateList ()
		{
			base.OnUpdateList ();
			StackFrame frame = DebuggingService.CurrentFrame;
			if (frame != null && !FrameEquals (frame, lastFrame)) {
				tree.ClearExpressions ();
				tree.AddExpressions (frame.GetAllLocals ().Select (i => i.Name));
				lastFrame = frame;
			}
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:10,代码来源:LocalsPad.cs


示例7: OnUpdateList

		public override void OnUpdateList ()
		{
			base.OnUpdateList ();
			StackFrame frame = DebuggingService.CurrentFrame;
			
			if (frame == null || !FrameEquals (frame, lastFrame)) {
				tree.ClearExpressions ();
				lastLookup = null;
			}
			lastFrame = frame;
			
			if (frame == null)
				return;

			//add expressions not in tree already, remove expressions that are longer valid
			var frameLocals = frame.GetAllLocals();
			var frameLocalLookup = new Dictionary<string, ObjectValue>(frameLocals.Length);
			foreach (var local in frameLocals) {
				var variableName = local.Name;
				//not sure if there is a use case for duplicate variable names, or blanks 
				if (string.IsNullOrWhiteSpace(variableName) ||
					variableName == "?" ||
					frameLocalLookup.ContainsKey(variableName)) {
					continue;
				}
				else
					frameLocalLookup.Add(variableName, local);

				if (lastLookup != null) {
					ObjectValue priorValue;
					if (lastLookup.TryGetValue(variableName, out priorValue))
						tree.ReplaceValue(priorValue, local);
					else
						tree.AddValue(local);
				}
			}

			if (lastLookup != null) {
				//get rid of the values that didnt survive from the last refresh
				foreach (var prior in lastLookup) {
					if (!frameLocalLookup.ContainsKey(prior.Key))
						tree.RemoveValue(prior.Value);
				}
			}
			else {
				tree.ClearValues();
				tree.AddValues(frameLocalLookup.Values);
			}

			lastLookup = frameLocalLookup;
		}
开发者ID:hippiehunter,项目名称:monodevelop,代码行数:51,代码来源:LocalsPad.cs


示例8: DebugValueWindow

		public DebugValueWindow (TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel)
		{
			this.TypeHint = WindowTypeHint.PopupMenu;
			this.AllowShrink = false;
			this.AllowGrow = false;
			this.Decorated = false;

			TransientFor = (Gtk.Window) ((Gtk.Widget)editor).Toplevel;
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;

			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;

			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			ContentBox.Add (sw);

			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.RootPinAlwaysVisible = true;
			tree.PinnedWatch = watch;
			var location = editor.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line;
			tree.PinnedWatchFile = editor.FileName;

			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += OnPinStatusChanged;

			sw.ShowAll ();

			tree.StartEditing += OnStartEditing;
			tree.EndEditing += OnEndEditing;

			ShowArrow = true;
			Theme.CornerRadius = 3;
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:44,代码来源:DebugValueWindow.cs


示例9: DebugValueWindow

		public DebugValueWindow (Mono.TextEditor.TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch)
		{
			TransientFor = (Gtk.Window) editor.Toplevel;
			
			// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
			AcceptFocus = false;
			
			sw = new ScrolledWindow ();
			sw.HscrollbarPolicy = PolicyType.Never;
			sw.VscrollbarPolicy = PolicyType.Never;
			
			tree = new ObjectValueTreeView ();
			sw.Add (tree);
			Add (sw);
			
			tree.Frame = frame;
			tree.CompactView = true;
			tree.AllowAdding = false;
			tree.AllowEditing = true;
			tree.HeadersVisible = false;
			tree.AllowPinning = true;
			tree.PinnedWatch = watch;
			DocumentLocation location = editor.Document.OffsetToLocation (offset);
			tree.PinnedWatchLine = location.Line + 1;
			tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName;
			
			tree.AddValue (value);
			tree.Selection.UnselectAll ();
			tree.SizeAllocated += OnTreeSizeChanged;
			tree.PinStatusChanged += delegate {
				Destroy ();
			};
			
			sw.ShowAll ();
			
			tree.StartEditing += delegate {
				Modal = true;
			};
			
			tree.EndEditing += delegate {
				Modal = false;
			};
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:43,代码来源:DebugValueWindow.cs


示例10: CheckFrameIsInFile

		StackFrame CheckFrameIsInFile (StackFrame frame)
		{
			if (!string.IsNullOrEmpty (ContentName) && frame != null && !string.IsNullOrEmpty (frame.SourceLocation.FileName)
				&& ((FilePath)frame.SourceLocation.FileName).FullPath == ((FilePath)ContentName).FullPath)
				return frame;
			return null;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:7,代码来源:SourceEditorView.cs


示例11: ConnectCallbacks

		internal static void ConnectCallbacks (StackFrame parentFrame, params ObjectValue[] values)
		{
			Dictionary<IObjectValueUpdater, List<UpdateCallback>> callbacks = null;
			List<ObjectValue> valueList = new List<ObjectValue> (values);
			for (int n=0; n<valueList.Count; n++) {
				ObjectValue val = valueList [n];
				val.parentFrame = parentFrame;
				UpdateCallback cb = val.GetUpdateCallback ();
				if (cb != null) {
					if (callbacks == null)
						callbacks = new Dictionary<IObjectValueUpdater, List<UpdateCallback>> ();
					List<UpdateCallback> list;
					if (!callbacks.TryGetValue (val.Updater, out list)) {
						list = new List<UpdateCallback> ();
						callbacks [val.Updater] = list;
					}
					list.Add (cb);
				}
				if (val.children != null)
					valueList.AddRange (val.children);
			}
			if (callbacks != null) {
				// Do the callback connection in a background thread
				System.Threading.ThreadPool.QueueUserWorkItem (delegate {
					foreach (KeyValuePair<IObjectValueUpdater, List<UpdateCallback>> cbs in callbacks) {
						cbs.Key.RegisterUpdateCallbacks (cbs.Value.ToArray ());
					}
				});
			}
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:30,代码来源:ObjectValue.cs


示例12: EvaluateMethodName

		string EvaluateMethodName (StackFrame frame)
		{
			var methodNameBuilder = new StringBuilder (frame.SourceLocation.MethodName);
			var options = DebuggingService.DebuggerSession.Options.EvaluationOptions.Clone ();
			if (ShowParameterValue) {
				options.AllowMethodEvaluation = true;
				options.AllowToStringCalls = true;
				options.AllowTargetInvoke = true;
			} else {
				options.AllowMethodEvaluation = false;
				options.AllowToStringCalls = false;
				options.AllowTargetInvoke = false;
			}

			var args = frame.GetParameters (options);

			//MethodName starting with "["... it's something like [ExternalCode]
			if (!frame.SourceLocation.MethodName.StartsWith ("[", StringComparison.Ordinal)) {
				if (ShowModuleName && !string.IsNullOrEmpty (frame.FullModuleName)) {
					methodNameBuilder.Insert (0, System.IO.Path.GetFileName (frame.FullModuleName) + "!");
				}
				if (ShowParameterType || ShowParameterName || ShowParameterValue) {
					methodNameBuilder.Append ("(");
					for (int n = 0; n < args.Length; n++) {
						if (n > 0)
							methodNameBuilder.Append (", ");
						if (ShowParameterType) {
							methodNameBuilder.Append (args [n].TypeName);
							if (ShowParameterName)
								methodNameBuilder.Append (" ");
						}
						if (ShowParameterName)
							methodNameBuilder.Append (args [n].Name);
						if (ShowParameterValue) {
							if (ShowParameterType || ShowParameterName)
								methodNameBuilder.Append (" = ");
							var val = args [n].Value ?? "";
							methodNameBuilder.Append (val.Replace ("\r\n", " ").Replace ("\n", " "));
						}
					}
					methodNameBuilder.Append (")");
				}
			}

			return methodNameBuilder.ToString ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:46,代码来源:StackTracePad.cs


示例13: DecompilerFormatter

 public DecompilerFormatter(StackFrame frame)
 {
     _frame = frame;
     _writer = Logger.WriteInfoString;
     IndentationString = "    ";
 }
开发者ID:GunioRobot,项目名称:sdb-cli,代码行数:6,代码来源:DecompilerFormatter.cs


示例14: ConnectCallback

		internal void ConnectCallback (StackFrame parentFrame)
		{
			ObjectValue.ConnectCallbacks (parentFrame, exception);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:ExceptionInfo.cs


示例15: EvaluateMethodName

		string EvaluateMethodName (StackFrame frame, EvaluationOptions options)
		{
			StringBuilder method = new StringBuilder (frame.SourceLocation.MethodName);
			ObjectValue[] args = frame.GetParameters (options);

			if (args.Length != 0 || !frame.SourceLocation.MethodName.StartsWith ("[", StringComparison.Ordinal)) {
				method.Append (" (");
				for (int n = 0; n < args.Length; n++) {
					if (n > 0)
						method.Append (", ");
					method.Append (args[n].Name).Append ("=").Append (args[n].Value);
				}
				method.Append (")");
			}

			return method.ToString ();
		}
开发者ID:kenkendk,项目名称:monodevelop,代码行数:17,代码来源:StackTracePad.cs


示例16: ShowLoadSourceFile

		void ShowLoadSourceFile (StackFrame sf)
		{
			if (messageOverlayWindow != null) {
				messageOverlayWindow.Destroy ();
				messageOverlayWindow = null;
			}
			messageOverlayWindow = new OverlayMessageWindow ();

			var hbox = new HBox ();
			hbox.Spacing = 8;
			var label = new Label (string.Format ("{0} not found. Find source file at alternative location.", Path.GetFileName (sf.SourceLocation.FileName)));
			hbox.TooltipText = sf.SourceLocation.FileName;
			var color = (HslColor)editor.ColorStyle.NotificationText.Foreground;
			label.ModifyFg (StateType.Normal, color);

			int w, h;
			label.Layout.GetPixelSize (out w, out h);

			hbox.PackStart (label, true, true, 0);
			var openButton = new Button (Gtk.Stock.Open);
			openButton.WidthRequest = 60;
			hbox.PackEnd (openButton, false, false, 0); 

			var container = new HBox ();
			const int containerPadding = 8;
			container.PackStart (hbox, true, true, containerPadding); 
			messageOverlayWindow.Child = container; 
			messageOverlayWindow.ShowOverlay (editor);

			messageOverlayWindow.SizeFunc = () => openButton.SizeRequest ().Width + w + hbox.Spacing * 5 + containerPadding * 2;
			openButton.Clicked += delegate {
				var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), SelectFileDialogAction.Open) {
					TransientFor = IdeApp.Workbench.RootWindow,
					ShowEncodingSelector = true,
					ShowViewerSelector = true
				};
				if (!dlg.Run ())
					return;
				var newFilePath = dlg.SelectedFile;
				try {
					if (File.Exists (newFilePath)) {
						if (SourceCodeLookup.CheckFileMd5 (newFilePath, sf.SourceLocation.FileHash)) {
							SourceCodeLookup.AddLoadedFile (newFilePath, sf.SourceLocation.FileName);
							sf.UpdateSourceFile (newFilePath);
							if (IdeApp.Workbench.OpenDocument (newFilePath, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger) != null) {
								this.WorkbenchWindow.CloseWindow (false);
							}
						} else {
							MessageService.ShowWarning ("File checksum doesn't match.");
						}
					} else {
						MessageService.ShowWarning ("File not found.");
					}
				} catch (Exception) {
					MessageService.ShowWarning ("Error opening file");
				}
			};
		}
开发者ID:behappyyoung,项目名称:monodevelop,代码行数:58,代码来源:DisassemblyView.cs


示例17: CheckFrameIsInFile

		SourceLocation CheckFrameIsInFile (StackFrame frame)
		{
			return frame != null ? CheckLocationIsInFile (frame.SourceLocation) : null;
		}
开发者ID:stephenoakman,项目名称:monodevelop,代码行数:4,代码来源:SourceEditorView.cs


示例18: GdbBacktrace

		public GdbBacktrace (GdbSession session, long threadId, int count, ResultData firstFrame)
		{
			fcount = count;
			this.threadId = threadId;
			if (firstFrame != null)
				this.firstFrame = CreateFrame (firstFrame);
			this.session = session;
		}
开发者ID:kthguru,项目名称:monodevelop,代码行数:8,代码来源:GdbBacktrace.cs


示例19: DDebugBacktrace

 public DDebugBacktrace(DDebugSession session, long threadId, DEW.DBGEngine engine)
 {
     this.session = session;
     this.Engine = engine;
     fcount = engine.CallStack.Length;
     this.threadId = threadId;
     if (firstFrame != null)
         this.firstFrame = CreateFrame(Engine.CallStack[0]);
 }
开发者ID:nazriel,项目名称:Mono-D,代码行数:9,代码来源:DDebugBacktrace.cs


示例20: SetUp

		public override void SetUp ()
		{
			base.SetUp ();
			ds = Start ("TestEvaluation");
			if (ds == null)
				Assert.Ignore ("Engine not found: {0}", EngineId);

			frame = ds.ActiveThread.Backtrace.GetFrame (0);
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:9,代码来源:EvaluationTests.cs



注:本文中的Mono.Debugging.Client.StackFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Client.TargetEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Client.SourceLocation类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap