Bug 36339 - Stepping is not working for .ppdb if /optimize+ is used
Summary: Stepping is not working for .ppdb if /optimize+ is used
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-11-29 07:55 UTC by David Karlaš
Modified: 2015-11-30 19:04 UTC (History)
2 users (show)

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

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 GitHub or Developer Community 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 FIXED

Description David Karlaš 2015-11-29 07:55:29 UTC
If I compile with /optimize+ I can place breakpoints on all lines/instructions and breakpoints are hit fine(sequence points work fine).
But after breakpoint is hit, if I do Step it just "continues execution"(I'm pretty sure it continues stepping, but breakpoint of next line is never hit, because it's placed on wrong offset I think).

What is even bigger problem which I can't figure out... If I try to debug .dll compiled via DNX->Roslyn which has Optimize code disabled... It has same behaviour... check P.dll/P.pdb if you have some dumpPpdb tool... Probably fix for /optimize+ will fix this too...

Steps to reproduce:
1. git clone https://github.com/DavidKarlas/sdb.git
2. cd sdb
3. git checkout 381dc53117ec8d1b630990e4fb9dbca3d76ca0f5
4. git submodule update --init --recursive
5. make
6. OPTIONAL(I commited compiled Program.exe/pdb):
mono ~/GIT/roslyn/Binaries/Debug/csc.exe Program.cs  /noconfig /debug:portable /optimize+
7. In second Console window run:
mono --debugger-agent=transport=dt_socket,address=127.0.0.1:12345,server=y Program.exe
8. bin/sdb -f Commands.txt

Mono git sha: 1c90513ad99e2ebcc2d88acd54975ceae1b50636(current head of master)
Roslyn git sha: 851f060f3f18cc1585a0ef1a3caa5e23bb8f69eb

Expected SDB output:
Connecting to '127.0.0.1:12345'...
Inferior process '0' ('127.0.0.1:12345') started
Inferior process '0' ('127.0.0.1:12345') suspended
#0 [0x00000001] TestApp.MainClass.Main at /Users/davidkarlas/GIT/sdb/Program.cs:10
			Debugger.Break();
Inferior process '0' ('127.0.0.1:12345') resumed
Inferior process '0' ('127.0.0.1:12345') suspended
#0 [0x00000012] TestApp.MainClass.Main at /Users/davidkarlas/GIT/sdb/Program.cs:12


Actual SDB output:
Connecting to '127.0.0.1:12345'...
Inferior process '0' ('127.0.0.1:12345') started
Inferior process '0' ('127.0.0.1:12345') suspended
#0 [0x00000000] TestApp.MainClass.Main at /Users/davidkarlas/GIT/sdb/Program.cs:10
			Debugger.Break();
Inferior process '0' ('127.0.0.1:12345') resumed
Inferior process '0' ('127.0.0.1:12345') exited
Comment 1 Zoltan Varga 2015-11-30 19:04:42 UTC
Fixed in mono master fc7cd69b258cdbc80bb41a94942f670294372edd.