debugging

Memory leak detectors for C?

What memory leak detectors have people had a good experience with? Here is a summary of the answers so far: Valgrind - Instrumentation framework for building dynamic analysis tools. Electric Fence - A tool that works with GDB Splint - Annotation-Assisted Lightweight Static Checking Glow Code - This is a complete real-time performanc...

Getting IIS Worker Process Crash dumps

I'm doing something bad in my ASP.NET app. It could be the any number of CTP libraries I'm using or I'm just not disposing something properly. But when I redeploy my ASP.NET to my Vista IIS7 install or my server's IIS6 install I crash an IIS worker process. I've narrowed the problem down to my HTTP crawler, which is a multithreaded beas...

Tool for debugging makefiles

I have a large legacy codebase with very complicated makefiles, with lots of variables. Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect. What I'd like to find is a tool that basically does step-through-debugging of the "make" process, where I would give it...

How do I in java add a stacktrace to my debugging printout

What's the easiest way to print a stacktrace from a debugging printout? Often during testing you would like to know the callstack leading up to the situation provoking a debug message. ...

Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)?

I have a class in system-C with some data members as such: long double x[8]; I'm initializing it in the construction like this: for (i = 0; i < 8; ++i) { x[i] = 0; } But the first time I use it in my code I have garbage there. Because of the way the system is built I can't connect a debugger easily. Are there any methods to...

Sending messages to objects while debugging Objective-C in gdb, without symbols.

I'm trying to send messages to Objective-C objects in gdb. (gdb) p $esi $2 = (void *) 0x1268160 (gdb) po $esi <NSArray: 0x1359c0> (gdb) po [$esi count] Target does not respond to this message selector. I can't send any message to it. Am i missing something? Do I really need the symbols, or something else? Thanks in advance! ...

Arithmetic underflow or overflow exception during debugging

This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the .NET runtime and calls into .NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly random locations and points of our code: Arithmetic overflow or underflow. The stack trace of on...

How to attach debugger to step into native (C++) code from a managed (C#) wrapper?

Hi all, I have a wrapper around a C++ function call which I call from C# code. How do I attach a debugger in Visual Studio to step into the native C++ code? This is the wrapper that I have which calls GetData() defined in a C++ file: [DllImport("Unmanaged.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint ...

Can I set a breakpoint on 'memory access' in GDB?

I am running an application through gdb and I want to set a breakpoint for any time a specific variable is accessed / changed. Is there a good method for doing this? I would also be interested in other ways to monitor a variable in C/C++ to see if/when it changes. ...

IDebugProgramProvider2.GetProviderProcessData on Vista

As part of a JavaScript Profiler for IE 6/7 I needed to load a custom debugger that I created into IE. I got this working fine on XP, but couldn't get it working on Vista (full story here: http://damianblog.com/2008/09/09/tracejs-v2-rip/). The call to GetProviderProcessData is failing on Vista. Anyone have any suggestions? Thanks, ...

How to determine the value of a controller variable during execution in Ruby on Rails?

What is the best way for me to determine a controller variable's value during execution? For example, is there a way I can insert a break in the code, and cause the value of the variable to be output to the screen (or the log)? ...

Classis ASP debugging global.asa in VS2005

I was trying to set a breakpoint in global.asa in an old classis ASP project with IIS 6 in Visual Studio 2005. Somehow the context menu for actually setting the breakpoint somewhere in global.asa is disabled (greyed). How can I set a breakpoint then? Breakpoints in .asp pages are no problem though and do work fine. ...

IIS crashes when serving an ASP.NET application under heavy load. How to troubleshoot it?

I am working on an ASP.NET web application, it seems to be working properly when I try to debug it in Visual Studio. However when I emulate heavy load, IIS crashes without any trace -- log entry in the system journal is very generic, "The World Wide Web Publishing service terminated unexpectedly. It has done this 4 time(s)." How is it po...

Debugging VBO Vertex buffers crashes

I'm using the VBO extension for storing Vertex, normal and color buffers (glBindBufferARB) For some reason when changing buffers or doing some operation the application crashes with an access violation. When attaching The debugger I see that the crash is in some thread that is not my main thread which performs the opengl call with the ex...

How do I fix a "broken" debugger in EclipseME (MTJ)?

How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon) ...

Is it possible to get a core dump of a running process and it's symbol table?

Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process. If this is possible, what commands would you use? (I'm trying to do this on a Linux box) ...

Zend PHP debugger: How can I start debugging a page using a get argument?

I am trying out the debugger built into Zend studio. It seems great! One thing though, when I start a page using the debugger does anyone know how I can set a request get argument within the page? For example, I don't want to debug runtests.php I want to debug runtests.php?test=10 I assume its a simple configuration and I just can't...

What simple method can I use to debug an embedded processor without serial port or video?

We have a small embedded system without any video or serial ports (i.e. we can't output text via printf). We would like to track the progress of our code through the initialization sequence. Is there some simple things we can do to help with this. It is not running any OS, and the hardware platform is somewhat customizable. ...

How do I use PDB files

I have heard using PDB files can help diagnose where a crash occurred. My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!) ...

How do I add Debug Breakpoints to lines displayed in a "Find Results" window in Visual Studio

In Visual Studio 2005/2008 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut that would allow adding debug breakpoints to all of them? ...