Bug 3421 - Wrong stack trace is displayed
Summary: Wrong stack trace is displayed
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: Trunk
Hardware: PC Linux
: Normal enhancement
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on: 3482
  Show dependency tree
Reported: 2012-02-13 09:53 UTC by Marek Safar
Modified: 2012-02-15 16:27 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

generic method display name patch (1.73 KB, patch)
2012-02-15 15:13 UTC, Jeffrey Stedfast

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marek Safar 2012-02-13 09:53:53 UTC
using System;

class C<T> where T : C<T>
	public static void Foo<U> (U arg) where U : C<U>, new ()
		var i = new U ();  // Set a breakpoint here and observe stack trace
			var ii = new U ();
			Func<U> f = () => i;
				Action a = () => C<U>.Run (ii);
				a ();
			f ();
	static void Run (T a)

class D : C<D>

class E : C<E>

class A
	public static int Main ()
		D.Foo (new E ());
		return 0;

Stack trace

C`1[[D, g2, Version=1.0.4426.26546, Culture=neutral, PublicKeyToken=null]].Foo (arg={E})
A.Main ()

#1: Foo method is displayed as non-generic
#2: It'd be nice to follow C# convention when debugging C# program
Comment 1 Marek Safar 2012-02-14 11:41:34 UTC
I am not sure this is an enhancement, there is no simple way to see what MVAR arguments were passed
Comment 2 Jeffrey Stedfast 2012-02-15 11:59:32 UTC
implemented a partial fix in git master.

C`1[[D, g2, Version=1.0.4426.26546, Culture=neutral, PublicKeyToken=null]].Foo

now displays as:

C<D>.Foo (arg={E})

Mono 2.10's sdb isn't able to tell if a method is generic or not, so I'll need to install Mono 2.11 to finish the fix.
Comment 3 Jeffrey Stedfast 2012-02-15 15:06:00 UTC
the rest depends on bug #3482
Comment 4 Jeffrey Stedfast 2012-02-15 15:13:44 UTC
Created attachment 1363 [details]
generic method display name patch

Once Zoltan implements support to query the info I need, this patch is probably what will be needed on the MD side.
Comment 5 Jeffrey Stedfast 2012-02-15 16:27:43 UTC
Fixed in git master