ArticleslgStudy

science

Debugging information

Debugging information is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Debugging information rather than just read about it. In short: Debugging information is information that describes a correspondence of elements in the source code, such as the names of variables and routines, to entities in the object code, which is found in an object file, such as a shared library or an executable. This kind of information allows a symbolic debugger to provide a debugging experience that corresponds more closely to the source code.

Key takeaways

  • Debugging information belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Debugging information to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Debugging information from memory before moving on to harder problems.

Reference excerpt

Debugging information is information that describes a correspondence of elements in the source code, such as the names of variables and routines, to entities in the object code, which is found in an object file, such as a shared library or an executable. This kind of information allows a symbolic debugger to provide a debugging experience that corresponds more closely to the source code. The debugging information may be compiled together with the module's binary file, or distributed in a separate file, or simply discarded during the compilation and/or linking. Because historically such information was associated with the symbol table (which originally was for the translation from exported identifier names to locations in the object file), they also commonly known as debug symbols'. However, most debug information today exists outside of the symbol table, making this largely a misnomer. This information can be helpful while trying to investigate and fix a crashing application or any other fault. They are also used to provide a view of the program's structure when reverse engineering.

Debugging information Debug symbols can be divided into several levels:

Information usually provided by the symbol table, a translation from names to addresses. For dynamic libraries, the symbol table most include the locations functions and global variables that it expects other programs to use, as otherwise these "exports" would simply be unavailable. Information necessary for other features such as type introspection (incl. run-time type information) and reflection. Optional additional information, which may include: Information of type (3) may be stored in the symbol table of an object file (including executable file or shared library), or may be in a separate file. The other types are required for the functioning of non-debugging features and typically need to stay with the object file. Debugging information can take up quite a bit of space, especially the filenames and line numbers. Thus, binaries with debugging information can become quite large, often several times the stripped (has its symbols and other debugging information removed) file size. To avoid this extra size, most operating system distributions ship binaries that are stripped, i.e. from which all of the debugging symbols (type (3)) have been removed. This is accomplished, for example, with the strip command in Unix. If the debugging information is in separate files, those files are usually not shipped with the distribution and fetched only when needed. The strip command only deletes information of types (1) and (3) – the former not always completely as it may also be told to preserve symbols necessary for relocation processing (--strip-unneeded), often found in a dynamic library. Changing the compiler settings may be required for more complete removal: for example, symbol visibility directly affects the size of the symbol table (1), and whether RTTI is enabled on C++ determines whether (2) is produced.

Embedded symbols

Unix-like systems stabs was an early format for debugging symbols on Unix-like systems. It worked by encoding extra information into the symbol table as specially-formatted strings and is broadly applicable to many object file formats. The newer DWARF format, for which formal specifications exist, has largely supplanted it. The specification allows any compatible compiler or assembler to create debug symbols in a standardized format, and for any debugger, such as the GNU Debugger (GDB), to gain access and display these symbols. DWARF is usable on any object format with a concept of named sections.

IBM OS/360 and successors

The compilers for the IBM mainframe line descended from the System/360 have a TEST option that causes the compiler to include debugging information in the object file. Similarly, the Binder and linkage editors have a TEST option that causes the debug information to be retained in the load module. Various debug tools, e.g., OS/360 TESTRAN, TSO TEST, have the ability to use the embedded symbol definitions. The IBM High Level Assembler (HLASM) supports Generalized Object File Format (GOFF), which includes embedded ADATA.

Windows Windows PE/COFF can use an embedded CodeView format, though in production programs this information is usually extracted to a separate PDB file (see below). PE/COFF can also use a legacy COFF debug info format. On GNU toolchains, DWARF is used in PE/COFF. This information can, too, be extracted to a PDB file using cv2pdb.

Obsolete formats Relocatable Object Module Format (OMF) for Intel x86, the .OBJ files on DOS: debug information encoded as "comments" (obsolete) IEEE-695: outdated format used on the Z80. Uses "comment" fields. COFF: Once one of the successors to OMF, has a combination of symbol tables (for identifiers) and annotations in the text segment (for more advanced info).

External debug files

OS/390 et al The IBM High Level Assembler (HLASM) and other compilers running on, e.g., z/OS, have an ADATA option that produces an Associated data (ADATA) file containing more information than that produced by the old TEST option. In particular, the ADATA file includes lines of source code and their metadata.

Microsoft debug symbols Microsoft compilers generate a program database (PDB) file containing debug symbols. Some companies ship the PDB on their CD/DVD to enable troubleshooting and other companies (like Microsoft, and the Mozilla Corporation) allow downloading debug symbols from the Internet. The WinDbg debugger and the Visual Studio IDE can be configured to automatically download debug symbols for Windows dynamic-link libraries (DLLs) on demand. The PDB debug symbols that Microsoft distributes include only public functions, global variables and their data types. The Mozilla Corporation has similar infrastructure but distributes full debug information. There are two branches of the PDB file format for PE/COFF (exe, dll). The closed format is used for files that contain usual machine code. The "open" format is used for files that contain .NET code.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Debugging information

Start with the simplest possible case. Write down what Debugging information claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Debugging information before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Debugging information ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Debugging information

In research
Debugging information appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Debugging information in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Debugging information is common in secondary-school and first-year university syllabi. It links to neighbouring topics Debugging, so understanding it makes those chapters shorter.
In everyday life
Look for Debugging information outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Debugging information” →

How to study Debugging information in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Debugging information means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Debugging information out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Debugging information in simple terms?

Debugging information is information that describes a correspondence of elements in the source code, such as the names of variables and routines, to entities in the object code, which is found in an object file, such as a shared library or an executable. This kind of information allows a symbolic d…

Why does Debugging information matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Debugging information?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Debugging information.

Tags

  • Debugging

Keep exploring