Posts

Breakpoints Not Working / .NET C++/CLI

I was having some trouble getting Visual Studio 2010 to stop at breakpoints in some unmanaged C++ code that’s in a C++/CLI project that I am working on, and as we all know Software Developments rapidly stops being fun if your debugger is broken!

I am using C++/CLI as a thin wrapper around this vanilla C++ functionality so that I could export it to .NET. All was working fine except that the breakpoints in the C++ code did not work. After some searching I found this post:

http://rhnatiuk.wordpress.com/2010/11/13/managednative-debugging-in-cc

The post suggested that I should set the ‘Enable unmanaged code Debugging’ setting of the start-up project (not the C++/CLI project), so I enabled it and the brakepoints started working fine – so big thanks Roman for the tip!

Eclipse & Google App Engine – Variable references empty selection: ${project_loc}

If, when you try to debug or run a PyDev Google app engine project in eclipse after following these instructions, you may experience this error message:

 
Variable references empty selection: ${project_loc}
 

If you get this error you should be able to make it go away by first clicking on you project in the PyDev package explorer window before trying to debug or run your project. Eclipse & PyDev can be just a little quirky…

 

Problem Debugging ASP with VS2005 and IE8

I was making some mods to an old ASP .NET web app today when I discovered that I could no longer properly debug it – when I started the debugger, VS2005 would launch IE8 and load the app but would then just detach and exit debug mode!  I have been running IE8 for a few months now and figured that the problem might have something to do with IE8 and sure enough it did!!

 

I found this excellent post which details a simple fix for the problem – I can now happily debug again!  It seems that the fix prevents IE8 from spreading itself across multiple processes this was confusing the poor VS2005 debugger..

Drupal – Debug Output not Displaying?

Have you ever noticed that sometimes no debug output whatsoever appears when you call a debug output function like dprint_r() from the PHP code that you’re working on?  For example, if you call one of the debug dump functions from the default argument handler for a block view (see earlier post) you won’t see a blessed thing! It seems that there are plenty of situations in the drupal processing lifecycle where output debug information will not get through for display on a page…

 

So what’s to be done? life without debug information can get very difficult and frustrating, but not to worry as in these difficult cases we can always log our debug info to a file using file_put_contents() (as suggested here), for example if you wanted to dump information about a variable called $my_variable you could call:

[code lang="php"]
file_put_contents("./drupal.debug",
                 print_r($my_variable, TRUE),
                 FILE_APPEND);
[/code]

Then simply read the contents of the file drupal.debug, not pretty and not perfect but a whole lot better than nothing!