Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
despite the bug. Play it safe and give a specific, complete example. That is the easiest
thing for you to do, and the most helpful.
Keep in mind that the purpose of a bug report is to enable us to x the bug. It may be
that the bug has been reported previously, but neither you nor we can know that unless
your bug report is complete and self-contained.
Sometimes people give a few sketchy facts and ask, \Does this ring a bell?" Those bug
reports are useless, and we urge everyone to refuse to respond to them except to chide
the sender to report bugs properly.
To enable us to x the bug, you should include all these things:
The version of GDB. GDB announces it if you start with no arguments; you can also
print it at any time using show version.
Without this, we will not know whether there is any point in looking for the bug in
the current version of GDB.
The type of machine you are using, and the operating system name and version
number.
What compiler (and its version) was used to compile the program you are
debugging| e.g. \HP92453-01 A.10.32.03 HP C Compiler". Use the what
command with the pathname of the compile command (`what /opt/ansic/bin/cc',
for example) to obtain this information.
The command arguments you gave the compiler to compile your example and
observe the bug. For example, did you use `-O'? To guarantee you will not omit
something important, list them all. A copy of the Makefile (or the output from make)
is sufficient.
If we were to try to guess the arguments, we would probably guess wrong and then
we might not encounter the bug.
A complete input script, and all necessary source files, that will reproduce the bug
A description of what behavior you observe that you believe is incorrect. For
example, \It gets a fatal signal."
Of course, if the bug is that GDB gets a fatal signal, then we will certainly notice it.
But if the bug is incorrect output, we might not notice unless it is glaringly wrong.
You might as well not give us a chance to make a mistake.
Even if the problem you experience is a fatal signal, you should still say so explicitly.
Suppose something strange is going on, such as, your copy of GDB is out of synch,
or you have encountered a bug in the C library on your system. (This has happened!)
Your copy might crash and ours would not. If you told us to expect a crash, then
when ours fails to crash, we would know that the bug was not happening for us. If
you had not told us to expect a crash, then we would not be able to draw any
conclusion from our observations.
360 Reporting Bugs in GDB