The level two annotations mechanism is known to have a number of technical and architectural limitations. As a consequence, in 2001, with the release of gdb 5.1 and the addition of gdb/mi, the annotation interface was marked as deprecated.
This chapter discusses the known problems.
The annotation interface works by interspersing markups with gdb normal command-line interpreter output. Unfortunately, this makes the annotation client dependant on not just the annotations, but also the cli output. This is because the client is forced to assume that specific gdb commands provide specific information. Any change to gdb's cli output modifies or removes that information and, consequently, likely breaks the client.
Since the gdb/mi output is independent of the cli, it does not have this problem.
The annotation interface relies on value annotations (see Value Annotations) and the display mechanism as a way of obtaining up-to-date value information. These mechanisms are not scalable.
In a graphical environment, where many values can be displayed simultaneously, a serious performance problem occurs when the client tries to first extract from gdb, and then re-display, all those values. The client should instead only request and update the values that changed.
The gdb/mi Variable Objects provide just that mechanism.
The annotation interface assumes that a variable's value can only be changed when the target is running. This assumption is not correct. A single assignment to a single variable can result in the entire target, and all displayed values, needing an update.
The gdb/mi Variable Objects include a mechanism for efficiently reporting such changes.
The gdb/mi interface includes a dedicated test directory (gdb/gdb.mi), and any addition or fix to gdb/mi must include testsuite changes.
The annotation mechanism was implemented by interspersing cli print statements with various annotations. As a consequence, any cli output change can alter the annotation output.
Since the gdb/mi output is independent of the cli, and the gdb/mi is increasingly implemented independent of the cli code, its long term maintenance is much easier.