Below is a list of project ideas for GDB - potential improvements, new features, et cetera. If you have a large project to add to this list, you may want to put just a brief description and a link to a new Wiki page. In general, there are lots of bugs in the bugzilla database. Everyone is welcome to look at them, reproduce them, comment on them, fix them, et cetera!

Good First Bugs

Looking at getting your feet wet in GDB development?

You can find some good first bugs tagged good-first-bug in the keyword field in the bugs database. See good-first-bug.

Project ideas

Category

Description

Difficulty

Testsuite

There are testsuite failures running 'make check' on many systems. Each one of these failures should be investigated, and either fixed or the testsuite adjusted.

?

There are many XFAIL (expected failure) and KFAIL (known failure) markers in the testsuite. Some of the XFAIL markers are for environmental problems, for instance known bugs in some compiler versions. But others of them are for bugs in GDB that no one has looked at in a long time. There should be fewer!

?

There are many test message outputs in the test suite that are not unique. We'd like each test to produce an unique line in gdb.sum, so we can better use tools for automatic regression identification. See PR13443 for more info.

?

CLI

The run command should support pipes, i.e., set up inferior input to come from another program. This has been asked a number of times on the GDB IRC channel.

?

Documentation

The file gdb/gdbserver/README contains a quick manual for both gdbserver and gdbreplay. It would be nice to move this documentation either of the GDB manuals:
* gdbserver is a tool that gets installed by default, and thus whatever documentation provided by the README file that is not already in the GDB users manual (gdb.texinfo) should be moved there.
* gdbreplay is currently a tool that does not get installed by default. This is because it is meant more as a "developer" tool, rather than a "user" tool. For now, its documentation should be moved to gdbint.texinfo.

?

All the help strings for commands should have "Usage" lines that explain the command concisely.

?

It might be nice to find a way to unify the help strings and the manual. Perhaps the help strings could be extracted from the manual, or vice versa.

?

Internals

The GDB internals are filled with multiple ways of doing the same tasks, all subtly different. Pick a module of GDB, look at the interfaces it exports, and think about which ones should really exist.

?

Many internal functions have been deprecated but not removed. Some of the deprecated functions do not have obvious replacements; either replacements should be created or the deprecation markers removed. Others do have obvious replacements, and only await someone to update the old uses. Just search for "deprecated" or "DEPRECATED" in the sources, and you'll find lots of instances of this problem. This is a good introductory project for someone who wants to learn about the GDB internals.

?

Cleanup static and externs. Some functions/variables are defined global but used only in a single file - make them static. Some of them are found as unused then. Some extern declarations no longer have any corresponding definition - remove them. I had some checking script for it in the past. One needs to be careful about conditional compilations.

?

GDB has several functions to read strings from the inferior. They should be consolidated in one function, or at most two. These are the existing string-reading functions: target_read_string, valprint.c:read_string, read_memory_string. This list is not exhaustive, perhaps there are more functions.

?

Remove global variables. A number of GDB modules use global variables, but not for any good reason. These should be removed and turned into parameters to the functions in the module. (Not all globals are worth removing -- anything associated with the user's state in the CLI is probably a true global.)

?

There is a lot of duplication of linux target support in gdb and gdbserver. IWBN to consolidate this. See the Common project.

?

Remove macros from gdbarch.sh. There are still a lot of gdbarch-specific functions implemented as macros in gdbarch.sh. These should be replaced by their appropriate "gdbarch_"-functions. This transition is currently ongoing.

?

Right now valops.c and value.c can refer to current_language. This should be a parameter instead.

?

Expression evaluation is currently implemented via recursive function calls. This means it cannot be paused in the middle and restarted -- important for async inferior function calls.

?

wrap_here does not take an output stream argument. It should.

?

Maintenance

Integrate the ARI into make check. The ARI stands for Awk Regression index and is a script that does static analysis on GDB's sources. See ARI for more info.

?

Write a fuzz tester for the libiberty's demangler. There's actually a simple one in libiberty/testsuite/demangler-fuzzer.c , though one using something like AFL (american fuzzy lop) would be better.

?

Memory

A full "struct symbol" is created for enumerators. If we could avoid that, it might save a lot of space. Enumerators are a large chunk of the symbol table in some programs, because they appear in header files (e.g. from glibc, from BFD).

?

Split struct objfile into two parts so that it can be reused across inferiors. The basic out line of this idea is here. See the ObjfileSplitting project page.

?

objfile and objalloc (used by BFD) can waste a bit of space when an object doesn't fit into one of the allocated pages. Add valgrind macros to this code to track allocations and then try to measure the wastage. See the valgrind docs for information.

?

On amd64-linux obstack alignment is 16 however gdb only ever needs 8 (or maybe rarely needs 16). This wastes a lot of space.

?

It is possible to shrink all symbol types by shrinking the "domain" and "aclass" fields and pushing them (perhaps losing a little type-safety) into general_symbol_info. However it isn't clear whether the win is worth the cost.

?

Watchpoints

GDB issues an error if you try to set a hardware watchpoint on an unreadable address (for instance, an address which has not been malloc'd yet). It disables watchpoints when addresses become unreadable. Hardware permitting, it would be great to be able to set watchpoints in advance. With address space randomization turned off, as it still is on many systems, this would let you restart a program and find the first write to a heap data structure. (A patch has been posted for this, PR 10645.)

?

The way the code calls watchpoints "in scope" or "out of scope" is misleading: it's not about scope, it's about what the ISO C standard calls "lifetime". For example, a static variable local to some block is only "in scope" for PC values that fall within that block, but the variable's lifetime is the execution of the entire program (or until the shared library that contains the function is dlclosed). A watchpoint should be deleted when the lifetime of any of the objects it refers to ends, regardless of whether they are in scope or not. We should change the comments and the names of any related functions, variables, fields, etc. to use "lifetime" instead of "scope".

?

MI (Machine Interface)

The current MI implementation does not follow its own quoting rules, as described in the manual. Many commands delegate to CLI commands and let the CLI support code parse options themselves. We should not change the quoting rules for MI version 2, as currently implemented, but when we switch over to MI version 3 it would be good to get these correct. That means having two code paths for each mishandled command, one which imitates the existing bad quoting behavior and one which gets it right. There's a description of the current state in the GDB mailing list archives.

?

Embedded Debugging

Patches have been posted for basic flash memory support, but there is still plenty of room for Flash_Debugging_Improvements.

?

Symbols

Add an easy way to add user-defined symbols. It's useful for the user to be able to define symbols when the binary is stripped down. That could take the form of a command that takes the symbol name, address, and optionally the type of the symbol. A workaround is to write assembly with matching symbols/addresses, assemble it, then use add-symbol-file to load it in gdb. See https://github.com/night199uk/gdb-symbol-maker for an example.

?

None: ProjectIdeas (last edited 2021-03-10 14:25:22 by TomTromey)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.