Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VS2010 Debugging
Hello everyone .
I am working right now on a script language which is interpreted to C# and then compiled via CSharpCodeProvidor .. (I have my own IDE for the script language)
 
Well , firstly i want to understand how really VS can actually stop the application at runtime and then change (compiled) code and then even save it and simply resume !
 
Really , i want to create my own debugger in my IDE and also if i will success to replace compiled objects somehow like VS is doing i will be able to design some Real-Time programming and debugging mechanism for my own script language .
 
The first reason i want to know how it works is because real-time programming (Change code and resume the application without restarting every time)
 
and the second reason is for some good debugger (which is not really necessary after having the real-time mechanism)
Posted 27-Dec-12 3:20am
Comments
aspnet_regiis -i at 27-Dec-12 8:24am
   
Good question.. I will wait till somebody answers
srabonir at 28-Dec-12 0:52am
   
Great discussions all together.My question for David is where actually you want to implement it?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v5
Comments
aspnet_regiis -i at 27-Dec-12 9:29am
   
Thank you for the info.. Something new I have never read about.. +5
Suvabrata Roy at 27-Dec-12 23:57pm
   
you welcome :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Well to do that you must have an excellent knowledge in CLR and it's internall behavior and mechanism. Without it all your attempts will fail.
 
Also you must have clear imagination of how CLR work with conjunction of JIT compiler.
 
In brevity, you need to find a way to hhok up into the CLR so you comp can obser the behaviour of your app (this can be done by using a profiler).
A common language runtime (CLR) profiler is a dynamic link library (DLL) taht consist of functions that receive messages from and, send the messages to the CLR by using API.
This DLL is loaded by the clr at runtime.
 
The profiling API enforces your compiler with management functionality (to change the in-memory MSIL code stream from a routine before it will be JIT compiled).
in this manner profiler api can dynamically add instrumentation code to particular routines that need deeper investigatrion.
So basically profiler DLL provide you with few callbacks ICorProfilerInfo and ICorProfilerCallback, the last one get all information like :function entry, function exit , first one is implemented to query data from modules , retreive it metadata etc.
 
So all i have covered it's a tiny part of full mechanism.
And if i was attentive, you mention C# tag in that question.
My opinion, that knowledge of C# won't be enough, at least you must know C++
So if any questions , please ask.
  Permalink  
Comments
aspnet_regiis -i at 27-Dec-12 9:29am
   
Thank you for the info.. Something new I have never read about.. +5
Oleksandr Kulchytskyi at 27-Dec-12 9:32am
   
Thanks for your mark,you are welcome =)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

YES !
 
I have found here a very useful sample ! (Thanks to Suvabrata Roy for posting the entry blog)
 
In same blog i found here a download for a good sample of ICorDebug using .
With everything needed to establish same debugger as in VS !
 
http://www.microsoft.com/en-us/download/details.aspx?id=19621[^]
  Permalink  
Comments
Suvabrata Roy at 28-Dec-12 0:06am
   
You welcome :) Enjoy coding...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 555
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100