1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 1994-2021 Free Software Foundation, Inc.
4
5Permission is granted to copy, distribute and/or modify this document
6under the terms of the GNU Free Documentation License, Version 1.3 or
7any later version published by the Free Software Foundation; with no
8Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
9Texts.  A copy of the license is included in the section entitled "GNU
10Free Documentation License". -->
11<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
12<head>
13<title>GDB&rsquo;s Obsolete Annotations: Limitations</title>
14
15<meta name="description" content="GDB&rsquo;s Obsolete Annotations: Limitations">
16<meta name="keywords" content="GDB&rsquo;s Obsolete Annotations: Limitations">
17<meta name="resource-type" content="document">
18<meta name="distribution" content="global">
19<meta name="Generator" content="makeinfo">
20<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21<link href="index.html#Top" rel="start" title="Top">
22<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
23<link href="index.html#Top" rel="up" title="Top">
24<link href="Migrating-to-GDB_002fMI.html#Migrating-to-GDB_002fMI" rel="next" title="Migrating to GDB/MI">
25<link href="Annotations-Overview.html#Annotations-Overview" rel="previous" title="Annotations Overview">
26<style type="text/css">
27<!--
28a.summary-letter {text-decoration: none}
29blockquote.smallquotation {font-size: smaller}
30div.display {margin-left: 3.2em}
31div.example {margin-left: 3.2em}
32div.indentedblock {margin-left: 3.2em}
33div.lisp {margin-left: 3.2em}
34div.smalldisplay {margin-left: 3.2em}
35div.smallexample {margin-left: 3.2em}
36div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
37div.smalllisp {margin-left: 3.2em}
38kbd {font-style:oblique}
39pre.display {font-family: inherit}
40pre.format {font-family: inherit}
41pre.menu-comment {font-family: serif}
42pre.menu-preformatted {font-family: serif}
43pre.smalldisplay {font-family: inherit; font-size: smaller}
44pre.smallexample {font-size: smaller}
45pre.smallformat {font-family: inherit; font-size: smaller}
46pre.smalllisp {font-size: smaller}
47span.nocodebreak {white-space:nowrap}
48span.nolinebreak {white-space:nowrap}
49span.roman {font-family:serif; font-weight:normal}
50span.sansserif {font-family:sans-serif; font-weight:normal}
51ul.no-bullet {list-style: none}
52-->
53</style>
54
55
56</head>
57
58<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
59<a name="Limitations"></a>
60<div class="header">
61<p>
62Next: <a href="Migrating-to-GDB_002fMI.html#Migrating-to-GDB_002fMI" accesskey="n" rel="next">Migrating to GDB/MI</a>, Previous: <a href="Annotations-Overview.html#Annotations-Overview" accesskey="p" rel="previous">Annotations Overview</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
63</div>
64<hr>
65<a name="Limitations-of-the-Annotation-Interface"></a>
66<h2 class="chapter">2 Limitations of the Annotation Interface</h2>
67
68<p>The level two annotations mechanism is known to have a number of
69technical and architectural limitations.  As a consequence, in 2001,
70with the release of <small>GDB</small> 5.1 and the addition of <small>GDB/MI</small>,
71the annotation interface was marked as deprecated.
72</p>
73<p>This chapter discusses the known problems.
74</p>
75<a name="Dependant-on-CLI-output"></a>
76<h3 class="section">2.1 Dependant on <small>CLI</small> output</h3>
77
78<p>The annotation interface works by interspersing markups with
79<small>GDB</small> normal command-line interpreter output.  Unfortunately, this
80makes the annotation client dependant on not just the annotations, but
81also the <small>CLI</small> output.  This is because the client is forced to
82assume that specific <small>GDB</small> commands provide specific information.
83Any change to <small>GDB</small>&rsquo;s <small>CLI</small> output modifies or removes that
84information and, consequently, likely breaks the client.
85</p>
86<p>Since the <small>GDB/MI</small> output is independent of the <small>CLI</small>, it does not
87have this problem.
88</p>
89<a name="Scalability"></a>
90<h3 class="section">2.2 Scalability</h3>
91
92<p>The annotation interface relies on value annotations (see <a href="Value-Annotations.html#Value-Annotations">Value Annotations</a>) and the display mechanism as a way of obtaining up-to-date
93value information.  These mechanisms are not scalable.
94</p>
95<p>In a graphical environment, where many values can be displayed
96simultaneously, a serious performance problem occurs when the client
97tries to first extract from <small>GDB</small>, and then re-display, all those
98values.  The client should instead only request and update the values
99that changed.
100</p>
101<p>The <small>GDB/MI</small> Variable Objects provide just that mechanism.
102</p>
103<a name="Correctness"></a>
104<h3 class="section">2.3 Correctness</h3>
105
106<p>The annotation interface assumes that a variable&rsquo;s value can only be
107changed when the target is running.  This assumption is not correct.  A
108single assignment to a single variable can result in the entire target,
109and all displayed values, needing an update.
110</p>
111<p>The <small>GDB/MI</small> Variable Objects include a mechanism for efficiently
112reporting such changes.
113</p>
114<a name="Reliability"></a>
115<h3 class="section">2.4 Reliability</h3>
116
117<p>The <small>GDB/MI</small> interface includes a dedicated test directory
118(<samp>gdb/gdb.mi</samp>), and any addition or fix to <small>GDB/MI</small> must include
119testsuite changes.
120</p>
121<a name="Maintainability"></a>
122<h3 class="section">2.5 Maintainability</h3>
123
124<p>The annotation mechanism was implemented by interspersing <small>CLI</small> print
125statements with various annotations.  As a consequence, any <small>CLI</small>
126output change can alter the annotation output.
127</p>
128<p>Since the <small>GDB/MI</small> output is independent of the <small>CLI</small>, and the
129<small>GDB/MI</small> is increasingly implemented independent of the <small>CLI</small>
130code, its long term maintenance is much easier.
131</p>
132<hr>
133<div class="header">
134<p>
135Next: <a href="Migrating-to-GDB_002fMI.html#Migrating-to-GDB_002fMI" accesskey="n" rel="next">Migrating to GDB/MI</a>, Previous: <a href="Annotations-Overview.html#Annotations-Overview" accesskey="p" rel="previous">Annotations Overview</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
136</div>
137
138
139
140</body>
141</html>
142