debugging

Visual Studio 2008 - Application closes when unhandled exception occurs.

I have a problem when an unhandeld exception occurs while debugging a WinForm VB.NET project. The problem is that my application terminates and I have to start the application again, instead of retrying the action as was the case in VS2003 The unhandeld exception is implemented in the new My.MyApplication class found in ApplicationEven...

Why does Word freeze when I'm debugging?

Whenever I'm at a break point in a certain C#.NET application in Visual Studio 2008 and I fire up Microsoft Word 2007, word will fail to open until I restart the C# application. I have a few theories about why, but does anyone know for sure? ...

What is the proper name for doing debugging by adding 'print' statements

There are many ways of doing debugging, using a debugger is one, but the simple one for the humble, lazy, programmer is to just add a bunch of print statements to your code. i.e. def foo(x): print 'Hey wow, we got to foo!', x ... print 'foo is returning:', bar return bar Is there a proper name for this style of...

How can I debug heap errors in a C# class library?

I'm getting a heap corruption error in a C# library module I'm calling through COM in a C++ app. The specific error is: HEAP: Free Heap block 4b61bb8 modified at 4b61be8 after it was freed ... This may be due to a corruption of the heap, and indicates a bug in [app].exe or any of the DLLs it has loaded. The top of the cal...

Open CDialog from Java using JNI

Hi everybody, I have an application that needs to open a CDialog written inside a DLL. The problem is that when DoModal() is called inside the DLL, the program crashes with: "Debug Assertion Failed!". Does anyone have any idea how can i get the CDialog opened? Thank you! ...

How to use Process Monitor to Resolve an UnauthorizedAccessException.

I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception: UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied." I've been advised to use Process Monitor to help resolve this, but it's quite a complex tool, and I really don't have time to spend explor...

How can I abort a long operation in WinDbg?

Often WinDbg will enter a state where it is *Busy* performing an operation. Often this is due to some mistake I made trying to *dt some_variable_itll_never_find* or setting a break point somewhere without symbols or the 1000's of other mistakes I make fumbling around this tool. Is there a way to cancel the current operation? ...

How can I set the current line of execution in the eclipse java debugger

I want to force the current execution line to a specific line in the same function. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it without changing code? ...

Is there a function in Python to print all the current properties and values of an object?

So what I'm looking for here is something like PHP's print_r function. This is so I can debug my scripts by seeing what's the state of the object in question. ...

Does PHP have a DEBUG symbol that can be used in code?

Languages like C and even C# (which technically doesn't have a preprocessor) allow you to write code like: #DEFINE DEBUG ... string returnedStr = this.SomeFoo(); #if DEBUG Debug.WriteLine("returned string =" + returnedStr); #endif This is something I like to use in my code as a form of scaffolding, and I'm wondering if PHP has so...

Is VS Debugger Wrong? IndexOutOfRangeException thrown by the code: f++

Why is an exception being thrown in the "f++" part of the code below ("IndexOutOfRangeException was unhandled by user code"): for (int f = 0; f < gnf; f++) { fieldNames[g] = grid.FieldName(f); } The bug is in the "fieldNames[g] = ..." part of the code, my algorithm should be: for (int f = 0; f < gnf; f++) { fieldNam...

Debugging: break at runtime when file is modified ? (windows)

Is it possible to break at runtime when a particular file has been modified? ie. monitor the file and break into a debugger once a change has been made to it. This is for a windows app...is this possible in visual studio or windbg? edit: i should have mentioned that this is for a Win32 app.. ...

How to tell if .net app was compiled in DEBUG or RELEASE mode?

I have an application installed on my computer and I need to find out if it was compiled in DEBUG mode or not? I've tried to use Reflector, but it does not show anything specific. Here is what I see: // Assembly APPLICATION_NAME, Version 8.0.0.15072 Location: C:\APPLICATION_FOLDER\APPLICATION_NAME.exe Name: APPLICATION_NAME, Version=8....

Internet Explorer Debug Mode - Is there a quick way to enable/disable it?

I do web site debugging with IE (as well as other browsers) but my problem is with IE, as it is the browser i usually use for regular browsing. In order to debug you need to turn on debug mode in the advanced options. Ok, fine. Its turned on. But the issue I have that is quite annoying is that it seems 30% of websites have JS errors, an...

Hardest javascript debugging problem ever

We have an ASP.NET application and when running on client site they often get null reference Javascript errors. As with all these errors the information IE6 displays is less than helpful. But the problem is as soon as I install IE script debugger and try and debug a bit more the error becomes non-reproducible.When script debugger is not ...

eclipse beakpoint: stop before leaving a Java method

Is there a way to tell the debugger to stop just before returning, on whichever statement exits from the method, be it return, exception, or fall out the bottom? I am inspired by the fact that the Java editor shows me all the places that my method can exit - it highlights them when you click on the return type of the method declaration, ...

SQL Server command LIKE [0-9] won't match any digit between 0 and 9

This is the constraint I have on the Customers table. ALTER TABLE Customers ADD CONSTRAINT CN_CustomerPhone CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]') Why does this fail? INSERT INTO Customers (CustomerName, Address, City, State, Zip, Phone) VALUES ('Some Name','An Address', 'City goes here', ...

Debugging with exceptions: How to work around 'Break when thrown'

I'm getting tired of clearing the Debugging->Exceptions option Break when thrown to get past an exception I handle properly, then setting the Break when thrown option to find the source of a subsequent exception not handled properly. I would like a way to exclude certain try blocks from Break when thrown, with something like preprocesso...

Visual Studio debugger tips & tricks for .NET

I've been working for years with VS's debugger, but every now and then I come across a feature I have never noticed before, and think "Damn! How could I have missed that? It's so useful!" [Disclaimer: These tips work in VS 2005 on a C# project, no guarantees for older incarnations of VS or other languages] Keep track of object instanc...

Is it possible to communicate with the Visual Studio debugger programmatically while debugging?

I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger. This relates to another question of mine on contr...