Debugging in VS.NET

Status
Not open for further replies.

martin007

Ars Tribunus Militum
2,783
I've been working with VS.NET for almost a year now (maybe longer?) but I've never tried any of the debugging features. Simply put, I don't know shit about it.

Does anyone have any good resources for learning what the hell debugging is and how it can make my life infinitely easier? :D Or can anyone describe what it's advantages are, and what problems it solves?

I work only with ASP.NET (with code behind in .dll's), but I've read that debugging a Windows app is basically the same. Am I right?

Also, what's the difference between debugging and tracing?

Thanks in advance for your time. It's greatly appreciated as always. :)
 

DrPizza

Well-known member
93,870
What kind of debugging?

I mean... you can set a breakpoint somewhere interesting, hit F5, and when it gets to that place it'll go into the debugger.

Or you can press F5 and wait for it to crash.

Or you can load a user-mode dump (from Doctor Watson or userdump) and find out why it crashed.

The particular features available depend on what you're debugging, and how.
 

earl

Well-known member
3,066
Oh: tracing is generally writing log statements to a file documenting where in the code the current point of execution is. You can find, for example, addon programs that will automatically log every function call, parameters, and return value.

Debugging is either the entire process of finding bugs or interactively working through the code to find the problem(s).

-earl-
 

DrPizza

Well-known member
93,870
Originally posted by earl:
Also, if you're using Beta2, there is a weird bug where if you hit a breakpoint and just let it sit there long enough (say >10 minutes), the whole dev environment crashes. Fucking annoying :mad:
Hrm. I left beta 2 sitting at a breakpoint overnight without any adverse effects.

There *are* bugs with setting breakpoints, and alas, they're in the release version.

Some of them seem very stupid (but also very easy to avoid); it seems that the compiler doesn't like it when you set a breakpoint on a line of code that gets optimized out.
 

petrov

Ars Tribunus Militum
2,714
Originally posted by martin007:
Also, what's the difference between debugging and tracing?

debugging is the general problem of removing bugs from your code. There are various tools in VS to help you do this, namely breakpoints, stepping through your code (some people call this tracing), viewing the state of memory, etc. Getting a listing of the function calls that your program makes, in order (sometimes only the system calls) is also called "tracing" (this is different from stepping though your code). There are various utilities to do this on Unix (don't know of any on Windows) such as 'ptrace' or 'truss'. When you are looking at the sequence of function calls that got you to a specific point (whether a crash, or breakpoint), that is called a "backtrace" or "stack trace".

--sam
 
Status
Not open for further replies.