debugging

Lots of the tests in the test suite are failing! Any advice on debugging it?

I already solved this but thought I'd ask anyway... I have a large application with a reasonably comprehensive test suite and unit test system. I was working on it and made a change that shouldn't have broken anything and suddenly dozens of test are failing. What should I do? I'm looking for a list of things that help isolate bugs. Tip...

JavaScript data formatting/pretty printer

I'm trying to find a way to 'pretty print' a JavaScript data structure in a human-readable form for debugging. I have a rather big and complicated data structure being stored in JS and I need to write some code to manipulate it. In order to work out what I'm doing and where I'm going wrong, what I really need is to be able to see the d...

ACCESS_VIOLATION_BAD_IP

Hey guys, I am trying to figure out a crash in my application. WinDbg tells me the following: (using dashes in place of underscores) LAST-CONTROL-TRANSFER: from 005f5c7e to 6e697474 DEFAULT-BUCKET-ID: BAD_IP BUGCHECK-STR: ACCESS-VIOLATION It is obvious to me that 6e697474 is NOT a valid address. I have three questions: 1) Does t...

"Hidden Secrets" of the Visual Studio .NET debugger?

As much as I generally don't like the discussion/subjective posts on SO, I have really come to appreciate the "Hidden Secrets" set of posts that people have put together. They provide a great overview of some commonly missed tools that you might now otherwise discover. For this question I would like to explore the Visual Studio .NET de...

How can a C program produce a core dump of itself without terminating?

I want a C program to produce a core dump under certain circumstances. This is a program that runs in a production environment and isn't easily stopped and restarted to adjust other kinds of debugging code. Also, since it's in a production environment, I don't want to call abort(). The issues under investigation aren't easily replicated ...

What does "Cannot evaluate expression because the code of the current method is optimized." mean?

I wrote some code with a lot of recursion, that takes quite a bit of time to complete. Whenever I "pause" the run to look at what's going on I get: Cannot evaluate expression because the code of the current method is optimized. I think I understand what that means. However, what puzzles me is that after I hit step, the cod...

Heisenbug: WinApi program crashes on some computers

Please help! I'm really at my wits' end. My program is a little personal notes manager (google for "cintanotes"). On some computers (and of course I own none of them) it crashes with an unhandled exception just after start. Nothing special about these computers could be said, except that they tend to have AMD CPUs. Environment: Windows...

Passing timestamp parameters in SQLAnalyzer to debug stored procedures

Hi I'm trying to debug a stored procedure through SQL Analyzer and one of the parameters is a timestamp datatype. If I wanted to pass 0x00000001410039E2 through as a parameter how would i do this? When I pass 0x00000001410039E2 I get a string truncation error and when I pass just 1410039E2 I get 0x1410039E20000000? Edit: @Frans Yes this...

WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version?

I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getting tripped up on ...

How do you get assembler output from C/C++ source in gcc?

How does one do this? If I want to analyze how something is getting compiled, how would I get the emitted assembly code? ...

Starting to learn Windbg

After being troubled by an issue that I simply did not have the knowledge to debug, I've just decided that I have to learn how to use Windbg. My only problem: I have no clue where to start :-( I'm not really a WinApi-Guy, having use languages that abstract the Windows Api away from me usually. So I just wonder: What is the best souce (B...

Colored grep?

Sometimes coloring a logfile or other gives a good overview when looking for stuff and behaviors I just saw that grep have a coloring feature grep -C 99999 --color <regexp> <filename> What other methods are there? ...

What are Java command line options to set to allow JVM to be remotely debugged ?

I know there's some JAVA_OPTS to set to remotely debug a Java program. What are them and what does they mean ? ...

Setting the thread /proc/PID/cmdline ?

On Linux/NPTL, threads are created as some kind of process. I can see some of my process have a weird cmdline: cat /proc/5590/cmdline hald-addon-storage: polling /dev/scd0 (every 2 sec) Do you have an idea how I could do that for each thread of my process? That would be very helpful for debugging. /me now investigating in HAL sourc...

How do you use gdb to debug your code?

As a developer, how do you use gdb to track down bugs within your code? What techniques tricks do you use to make your life easier? ...

How do you reproduce those really weird bugs?

You know the ones that happens often enough where they need to be fixed, but no one can really reproduce? How do you nail those? ...

IE Script debugging pop up

In order to debug an asp.net web app I have to have IE Script debugging enabled. Unfortunately, in the past week or so google's analytics javascript has developed a problem. So that when I browse to a site that has google analytics I receive the little pop up "A runtime error has occurred. Do you wish to debug?" Yes, even stackoverfl...

Which php variable debugging function do you use? var_dump, print_r, var_export, other?

I personally use var_dump, but lots of people like print_r. What does everyone use? Pros and Cons? Does someone have a special home brew function of their own? ...

Would you consider float values to behave differently across a release and debug builds to be a bug?

My application is generating different floating point values when I compile it in release mode and in debug mode. The only reason that I found out is I save a binary trace log and the one from the release build is ever so slightly off from the debug build, it looks like the bottom two bits of the 32 bit float values are different about 1...

How do I dump an entire Python process for later debugging inspection?

I have a Python application in a strange state. I don't want to do live debugging of the process. Can I dump it to a file and examine its state later? I know I've restored corefiles of C programs in gdb later, but I don't know how to examine a Python application in a useful way from gdb. (This is a variation on my question about debu...