Bug 915 - Debugger does not enter code that is not written in C#
Summary: Debugger does not enter code that is not written in C#
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 2.6 RC 1
Hardware: PC All
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-19 16:00 UTC by Dylan Borg
Modified: 2011-09-25 13:37 UTC (History)
4 users (show)

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


Attachments
The executable I try to debug (5.00 KB, application/x-msdos-program)
2011-09-19 16:00 UTC, Dylan Borg
Details
The debug symbols (392 bytes, application/vnd.ms-access)
2011-09-19 16:01 UTC, Dylan Borg
Details
The source code (2.40 KB, application/octet-stream)
2011-09-19 16:02 UTC, Dylan Borg
Details


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:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Dylan Borg 2011-09-19 16:00:04 UTC
Created attachment 432 [details]
The executable I try to debug

THe debugger is not working with an exe file that also has debugging sysmbols in mdb format. These files were made by a compiler I wrote which use standard reflection emit systems. The debugger refuses to stop on breakpoints written in my language.
Comment 1 Dylan Borg 2011-09-19 16:01:45 UTC
Created attachment 434 [details]
The debug symbols
Comment 2 Dylan Borg 2011-09-19 16:02:22 UTC
Created attachment 436 [details]
The source code
Comment 3 Miguel de Icaza [MSFT] 2011-09-21 15:30:05 UTC
You might want to first test this out with the command line soft debugger interface, and track down the problem there.
Comment 4 Mikayla Hutchinson [MSFT] 2011-09-21 18:17:38 UTC
Note that the mdb format requires rooted path names.
Comment 5 Dylan Borg 2011-09-22 04:25:41 UTC
I have tried sdb-cli and it fails to allow command ine input into the hosted process
Comment 6 Dylan Borg 2011-09-22 05:48:56 UTC
I have arranged my compiler to use full paths inside the mdb file. Monodevelop still fails to stop at breakpoints.
Comment 7 Mikayla Hutchinson [MSFT] 2011-09-22 11:32:39 UTC
Can you verify that the stack traces contain paths to the actual files?
Are you using Windows or Linux?
Comment 8 Dylan Borg 2011-09-22 11:38:34 UTC
I was on Windows. Later I will try it on Linux as well. I am sure I sent the full paths to ModuleBuilder.DefineDocument. I even made the compiler output the string to the console. It printed out the full path each time I tried.
Comment 9 Dylan Borg 2011-09-22 11:39:23 UTC
Marked the bug as affected 2.6 RC1 since I updated all my monodevelop installs.
Comment 10 Mikayla Hutchinson [MSFT] 2011-09-22 13:35:39 UTC
I'm not convinced yet that this is a MD bug, and not an issue in the compiler, the mdb module builder, the runtime, or the debugger agent inside the runtime. MD will only be able to insert breakpoints if the debugger agent in the runtime has correct information. Verifying that stacktraces have correct location information would help to narrow it down.
Comment 11 Dylan Borg 2011-09-22 13:59:20 UTC
The stack trace did not print out any source info with it. Here is a terminal excerpt(Stack trace is last thing):
dylan@ubuntu-hdd:/media/MOBEXTHDD/Code/dylannet$ mono compiler/dnc.exe test.dyl
dylan.NET Compiler v. 11.2.7.5 Alpha for Microsoft (R) .NET Framework (R) v. 3.5 SP1
                           and Xamarin Mono v. 2.6.7/v. 2.10.x
This compiler is FREE and OPEN SOURCE software under the GNU LGPLv3 license.
Copyright (C) 2011 Dylan Borg
Now Lexing: test.dyl...Done.
Now Parsing: test.dyl...Done.
Referencing Assembly: /usr/lib/mono/2.0/mscorlib.dll
Referencing Assembly: /usr/lib/dylandotnet/tokenizer.AST.dll
Importing Namespace: System
Importing Namespace: dylan.NET.Tokenizer.AST.Tokens
Importing Namespace: System.Diagnostics
Beginning Assembly: test
/media/MOBEXTHDD/Code/dylannet/test.dyl
Adding Class: test.Vector
Adding Field: I
Adding Field: J
Adding Field: K
Adding Method: op_Addition
Adding Method: op_Subtraction
Adding Method: op_Multiply
Adding Class: test.Module1
Adding Method: main
Writing Assembly to Disk...Done.
dylan@ubuntu-hdd:/media/MOBEXTHDD/Code/dylannet$ mono test.exe
1
ffffffff
8
8
1
5
6
Hello World of Linux
from dylan.NET Gen2
-2
-3
3.2345
f
102
One
shjejs
Miss
False
3
5
243
True
   at System.Environment.get_StackTrace()
   at test.Module1.main()
dylan@ubuntu-hdd:/media/MOBEXTHDD/Code/dylannet$

Here is the source code for it:
//dylan.NET test code...compile with v. 11.2.7.5 or higher...older version will fail compiling this...so be warned

#debug on

//#refasm "compiler\mscorlib.dll"
//#refasm "tokenizer.AST.dll"
#refasm "/usr/lib/mono/2.0/mscorlib.dll"
#refasm "/usr/lib/dylandotnet/tokenizer.AST.dll"

import System
import dylan.NET.Tokenizer.AST.Tokens
import System.Diagnostics

assembly test exe
ver 1.3.0.0

class public auto ansi Vector extends ValueType

field public integer I
field public integer J
field public integer K

method public static specialname Vector op_Addition(var v1 as Vector, var v2 as Vector)
end method

method public static specialname Vector op_Subtraction(var v1 as Vector, var v2 as Vector)
end method

method public static specialname Vector op_Multiply(var v1 as Vector, var v2 as Vector)
end method

end class

class public auto ansi Module1

	method public static void main()
		var ipa as intptr = new intptr(2) + new intptr(4)
		var deca as decimal = $decimal$2.34 + $decimal$1.45
		var decm as decimal = $decimal$2.34 * $decimal$1.45
		var decs as decimal = $decimal$2.34 - $decimal$1.45
		var decd as decimal = $decimal$2.34 / $decimal$1.45
		var decr as decimal = $decimal$2.34 % $decimal$1.45	
		var deceq as boolean = $decimal$9.2 == $decimal$2.1
		var decneq as boolean = $decimal$2.34 != $decimal$1.45
		var decgt as boolean = $decimal$9.2 > $decimal$2.1
		var decnlt as boolean = $decimal$2.34 < $decimal$1.45
		var decge as boolean = $decimal$9.2 >= $decimal$2.1
		var decnle as boolean = $decimal$2.34 <= $decimal$1.45
		Console::WriteLine(7 % 3)
		var t1 as Token = new Token()
		var t2 as Token = new Token($string$12 + "tok")
		var t3 as Type = gettype Convert
		var t4 as Type = gettype Module1
		var nstr as string = new string('f', 8)
		Console::WriteLine(nstr)
		Console::WriteLine(nstr::get_Length())
		Console::WriteLine($double$nstr::get_Length())
		var a as double = $double$Console::ReadLine()
		var b as double = $double$Console::ReadLine()
		var c as double = $double$Console::ReadLine()
		Console::WriteLine("Hello World of Linux")
		Console::WriteLine("from dylan.NET Gen2")
		Console::WriteLine(((-1d * b) + Math::Sqrt((b*b) - (4d*a*c))) / (2d*a))
		Console::WriteLine(((-1d * b) - Math::Sqrt((b*b) - (4d*a*c))) / (2d*a))
		Console::WriteLine($decimal$"3.2345")
		Console::WriteLine('f')
		Console::WriteLine($integer$'f')
		
		if a = 2d then
			Console::WriteLine("Two")
		elseif a = 1d then
			Console::WriteLine("One")
		elseif a = 3d then
			Console::WriteLine("Three")
		else
			Console::WriteLine("Other")
		end if
		
		if Console::ReadLine() = ("se" + "cr" + "et") then
			Console::WriteLine("Match")
		else
			Console::WriteLine("Miss")
		end if
		
		if $boolean$Console::ReadLine() then
			Console::WriteLine(true)
		end if
		
		Console::WriteLine(Math::Pow($double$Console::ReadLine(),$double$Console::ReadLine()))
		Console::WriteLine("3.42f" like "^(\d)+\.(\d)+(.)*$")
		Console::WriteLine(Environment::get_StackTrace())
		
	end method

end class
Comment 12 Mikayla Hutchinson [MSFT] 2011-09-22 15:20:59 UTC
To get source information in stack traces, run Mono in debug mode, i.e.
mono --debug test.exe
Comment 13 Dylan Borg 2011-09-22 15:37:42 UTC
I tried it and it does show the information in the stack trace:
dylan@ubuntu-hdd:/media/MOBEXTHDD/Code/dylannet$ mono --debug test.exe
1
ffffffff
8
8
1
5
6
Hello World of Linux
from dylan.NET Gen2
-2
-3
3.2345
f
102
One
secret 
Match
False
2
4
16
True
   at System.Environment.get_StackTrace() in /home/dylan/Desktop/packages/mono-oneiric/mono-2.10.5/mcs/class/corlib/System/Environment.cs:line 252
   at test.Module1.main() in /media/MOBEXTHDD/Code/dylannet/test.dyl:line 91
dylan@ubuntu-hdd:/media/MOBEXTHDD/Code/dylannet$
Comment 14 Mikayla Hutchinson [MSFT] 2011-09-22 17:47:36 UTC
How are you running the app in MD? Do you have a language addin, or are you loading the executable? Is there any output when you run the debugger?
Comment 15 Dylan Borg 2011-09-23 02:29:23 UTC
I do not have an addin. I was loading the executable thru a custom execute command in a generic project. The debugger did not do anything. The program just runs without debugging.
Comment 16 Mikayla Hutchinson [MSFT] 2011-09-23 06:56:36 UTC
The "Debug" command is enabled but doesn't start the debugger?

It should be pretty obvious when the debugger starts, the IDE will switch to debugger layout and the application output will show debugger assembly loading log messages.

Can you try opening your exe using MD? MD will create a assembly debugging project based on the sources from the mdb file.
Comment 17 Dylan Borg 2011-09-25 13:37:46 UTC
I tried making a generic project in MD this time placing it in the same directory as the executable and debug symbols. I made sure Mono was selected as default runtime. Like that it ran fine and as intended.