Presenter:Mike Taulty
Debugger Features in Visual Studio 2005
The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video
Minute 0
Hello and welcome to this net session 1 in a series of short sessions where we stand aside and is looking at key and interesting technologies in and around net and particularly around visual studio 2005 lines might told me I work in the developer and platform group in Microsoft in the UK and is set and I want to take a look in visual studio 2005 at some of the new features that we got in the debugger to use its was so nasty horrible bugs that from time to time group into even the best of code so that such over and look at the just unit thousand five and have a look at what we got in the debugger but there is so here we are with visual studio 2005 and using the beta 1 refreshed version here which you can get from MSDN subscriber downloads and I ve got a few projects already set up a just illustrated the only features to the at the odds look at here it is leafy to have that data tips on visualise is that it can open up his code here than
Minute 1
We already have a break point on this this is to get me to break point as Justine Douglas start an instance of application out it s not really that vital to expand what this code is doing in his Christmas presents really it is important to see liberties with datasets and that is in stuff with a string of bottlenecks and Alan Douglas can t assure you it is the data tips technology with God in the past if I wanted to see the contents of the strain who collects our strength I will have to go at a watch or a quick watch a something like that but it is as a fiver can do is hover over that string and you see that the value appears immediately on the screen is day to day and also here I have a datasets at the hover of her data set and noticed that I can to explore the whole object model if you like this that set him on screen despite navigating through things is keeping on going and going and going and I do not exact and explicit watch rather than to
Minute 2
Is listen and add a watch it a quick watch is hover over variables its value straight away it was very nice until to do others are datasets however and it s still not immediately obvious what the contents of his XML string reviews and lorries are immediately obvious what the content of this data set is that if you notice on these things do that see on over to the far right a little magnifying glass here which allows us the certain datatypes to bring up what we call data visualises that if I just drop this list and is it we ve got three visualises that this particular strain to ring at the XML visualise which just brings at the concerts have variable in a window for me and clearly this is a lot easier than looking at what we had in the data tip or what you would get a watch when to have a visualises if of the XML and we have a visualises of this datasets are again invited hover over this anecdote and the yen magnifying glass to bring up the visualise of the dataset there
Minute 3
Only get down a window that he properly displays the contents of the tables within dataset there is only one table and their right to be considered it is a lot easier than trying to navigate through this object hierarchy to work out where your actual roads and caterers to technological day to visualise as we have done things like strings and datasets Ryanair even write your own for your own custom types of this is fully extensible and writer of this life is so switching to regret a different technology known to disclose his father and presented back in a solution here I have a project that will lead a still illustrated a logical trace points set this zone this programme here here time without going into any detail I have a suntan of lottery number class I can see that down here when digging my main ears and creating her a winning ticket and randomly generated when his winning ticket lottery and out went a tightlipped and in this tight loop is
Minute 4
She will be doing is every hundred milliseconds of to generate another round of lottery ticket and would like to see his particular we generate matches the winning ticket to the idea here is that the doing something very fast and spinning another now if I wanted to debug this code then typically from different with their son this thing here and have a great time here and I can press ever better fire than just get one of these running a started instance of that programme and you see that I had a break point and I can look at the tickets and I can look at the winning tickets and is not a match so I haven t won seven butterflies are again that s the same thing and I haven t won a better five and I have won a silencer for the problem is that this code operates in a very tight loop and a great point is that hit all the time and really debugging this way it is not very productive and Sir Notley what you don t do is look at some kind of tracing code outputs in any case he goes into the slew
Minute 5
The case that the value of the winning ticket the value of my ticket and then I could sit back and watch and see why it was that wasn t winning the lottery now visual studio 2005 firefighters stopped but if is that I can change the nature of this breakpoint so that rather than being a break point I can turn into a trace of points factor to this when he dialogue you can see that when this separate point is here I can specify live like a printed message out to the output window device must regular I want a printed message is it that the default message prints at a function known as red idea of a threat than others and various other prebuilt variables that you can use and also advert include here is my lottery ticket values such as cause ticket value and I will print out the value of at the very was called my ticket values my ticket to and she would have put the the number there are so my ticket to strain his to
Minute 6
A severe cave that is either the little symbol associated breakpoint changes to the diamond so if we just don t start an instance of this programme is incoherent to debug and start an instance programme starts running agency said red at the tracing comes out of the programme and so now rather than having to sit in her that tight loop with lots of break points try to work out what was going on and just kill this programme of the Becomes a bit CPU intensive and we can now actually just sit in the debug and have trace points in it for us and see what s going on out programme without having to write explicit tracing code service is beheld to add tracing functionality without writing tracing her gaze so let s switch over and look to add edit and continue a feature that I know the beaches backing CD only and then again I got speak to code over here so let s will have look at this
Minute 7
We have an audio break when their sons have set this going debuggers let s debug this style incidents and you can see that demonstrate they have a great point and I have this classical person which is so on my own taxes discuss step into this property here signs aged to learn size as a value of 10 to 80 concealing that this code as it s ever as is Nah equal value but perhaps for a but it is just recycled to say a major cause value times to add if I just step at this point you noticed that is a studio has applied changes to that coat and indeed if we discover over there and aged accurately 20 as opposed to the intent that is what it would have been a couple of seconds or if we had packed a fly so it are absolutely editing and continuing here
Minute 8
I ve look at the next step is to code it wasn t immediately apparent but notice that we are at it again he is a personable resigning it to an employee to have a glass over year person was just as they and they have a property but name is over rival and an employee you notice that employee we haven t actually set source reality overridden that property so what if I was doing something looking like a still and here what if I went to employee now and overrode the name property with fatty change effectively tabled at the structure of the layout of methods of memory which is quite hairy thing to try and do on the fly cephalic employee and did a bit of everything and continue here side at this code is okay I will override that name property and discover return has just returned Fred here and let s not do anything to the set their notice and it is the Greens squiggly here
Minute 9
And agreeing squiggly saintly execution can t continue here the cars and you ve changed some kind of context around the code suit you will either need to take this edit out or you would need to stop and rebuild this code in order to make it work to get through what is this the same to me is that if you can hear him saying look you ve done something of the code which is 3082 that he changed me in a relay out of the function table of one of the objects by doing this additional overwrite here I can t practice up for you in the debugger if you are debunked this code you re going to have two to restart the debugging session so the whole slew of changes that we can become it ago was the debugging and indeed properly I dunno 90 or so percent of the changes that you would one make you can just change another one is that the debugger can t handle it and it is nice that he had to say look you to do something about this before you can continue so
Minute 10
Pleaded from one of the key features visited it is as adviser from VB developers is that every editing continue comes back into the debugger at the back works are you expected to work if United s Iverson is leading things are too complicated that continue from so justifies out with a couple of other quicker features within the deeper than a frescoes damaged windows and not save anything their and our other projects over here to illustrate something we got caught just like a debugging fact that the production code here again is not really want to worry too much about what the stars I is just here to serve the purpose of of illustrating some techniques so and here I have another great version and make that back to and anticipated on this code so that we can get to this break points against its solution Explorer Amnesty book that thing and get it running at this code is that it is likely to add some items and a list of the
Minute 11
Means of us have perhaps I don t know at all methods have flown Cherry and let s have a banana and then all it is it is the sort is such that sort hotel break point there really did the purposes of getting to this breakpoint is to show even if we were to go and look at the whole stack here then than it is get the call started on the screen actually encourages that you discover the cause that the country at the normally visual studio 2005 because aware of strips of this program you can see that we ve got some some code essentially begins life in main and ends up in my comparison function of Hewitt is acted in the sorting of those items put into the spots of as my comparison function a concealer in between were going to a whole
Minute 12
Should Windows forms give it a whole bunch of control succulent button it to get the click that click on button and above this we ve got some extra stuff that we didn t write which is around 36 disco at forming which is around this array sauteed so coal stack if you look at here is a fairly hairy despite a lot of stuff with 2030 calls deep and worthless I ve just done the own wrong don t really understand either so I can do and if this was due to testify that the right mouse here I can say don t show me any external coach is surely my code if we do that you see that it collapses the calls are quite nicely he is the main routine that I wrote he is the blockbuster handler that I wrote is the comparison function I wrote everything else is there marked as external code and is set in a way that the debugger is doing this as it s basically on which is ago likely have symbols for the bug
Minute 13
Debug symbols for Slovakia and symbols are considered to be my code and if I don t be considered to be somebody else s code and wouldn t surely hear so this is a much nicer much more friendly calls that the woman had a couple of minutes ago and with all the extra stuff on their safety easily but either way and it is difficult just my code at the procedure showed your code out of what he wanted to am so finally if it has shut this down a stuff debugging he windows one I think that we ve got here is got another solution just illustrated new exception dialogue you get the students as this start at the end debugger as favourite is the physical is not thrown exceptional runners up to handle an exception that gets thrown and everyone there is any say that we get this new exception dialogue that we had we ve got visual studio 2000 520 code is done is done divide by zero he could see the
Minute 14
In dialogue tells me that and it s nice especially those in the new programme is because you give you to hit around how you can fix this exception so so sure in this particular case is very easy to work out it is accepted or recently to stop doing this division by zero but in other cases the minority clear about how to fix in etc to get tips and hear the link across to the documentation follow these hyperlinks and in order to see why is he getting the exception that you get that it s a new dialogue regarded debugger if you want to see the full detail of the exception still you can click up this view detail into the bottom I see that you get the full details of the exception is you can see the message you can see and hear there are exceptions and so on and so forth to have lost that information argued against a additional help around how you can handle exceptions or how he should be happening exactly why they didn t throw
Minute 15
So won t be seen in this short session where we seem dated it and visualise how we can use those to see what s inside variables are much more intuitive way than them looking through object hierarchies in the debugger and watch windows and so on look to trace my totally zoster to get tracing from code without having trusty right extra coat but that facing in the senior editing continue is back for VB and the hints that you get around scenarios where you can t have the edit and continue we took a quick look at just my coat deepening distillers shot most than coal sacks for us and we seen the new exception assistant helps a travel account what s gone wrong with code so if you want more information on this stuff there s an MSDN developer centre dedicated to visual studio 2005 there is also an MSDN magazine article than around the features aimed at the debugger of the 2005 the best way final resources is just to get your favourite search engine type in the
Minute 16
As the five antibody enhancement something like that and it s not follow up on this particular session and then feel free to drop him out my address is there on the screen other than that thank you very much listening and there
Click here to go to original video page
Thursday, July 24, 2008
Video: Debugger Features in Visual Studio 2005
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment