GDB_002fMI-Development-and-Front-Ends.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: GDB/MI Development and Front Ends</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Development and Front Ends">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Development and Front Ends">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-Output-Records.html#GDB_002fMI-Output-Records" rel="next" title="GDB/MI Output Records">
  27. <link href="GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI" rel="previous" title="GDB/MI Compatibility with CLI">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="GDB_002fMI-Development-and-Front-Ends"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="GDB_002fMI-Output-Records.html#GDB_002fMI-Output-Records" accesskey="n" rel="next">GDB/MI Output Records</a>, Previous: <a href="GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI" accesskey="p" rel="previous">GDB/MI Compatibility with CLI</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="GDB_002fMI-Development-and-Front-Ends-1"></a>
  65. <h3 class="section">27.4 <small>GDB/MI</small> Development and Front Ends</h3>
  66. <a name="index-GDB_002fMI-development"></a>
  67. <p>The application which takes the MI output and presents the state of the
  68. program being debugged to the user is called a <em>front end</em>.
  69. </p>
  70. <p>Since <small>GDB/MI</small> is used by a variety of front ends to <small>GDB</small>, changes
  71. to the MI interface may break existing usage. This section describes how the
  72. protocol changes and how to request previous version of the protocol when it
  73. does.
  74. </p>
  75. <p>Some changes in MI need not break a carefully designed front end, and
  76. for these the MI version will remain unchanged. The following is a
  77. list of changes that may occur within one level, so front ends should
  78. parse MI output in a way that can handle them:
  79. </p>
  80. <ul>
  81. <li> New MI commands may be added.
  82. </li><li> New fields may be added to the output of any MI command.
  83. </li><li> The range of values for fields with specified values, e.g.,
  84. <code>in_scope</code> (see <a href="GDB_002fMI-Variable-Objects.html#g_t_002dvar_002dupdate">-var-update</a>) may be extended.
  85. </li></ul>
  86. <p>If the changes are likely to break front ends, the MI version level
  87. will be increased by one. The new versions of the MI protocol are not compatible
  88. with the old versions. Old versions of MI remain available, allowing front ends
  89. to keep using them until they are modified to use the latest MI version.
  90. </p>
  91. <p>Since <code>--interpreter=mi</code> always points to the latest MI version, it is
  92. recommended that front ends request a specific version of MI when launching
  93. <small>GDB</small> (e.g. <code>--interpreter=mi2</code>) to make sure they get an
  94. interpreter with the MI version they expect.
  95. </p>
  96. <p>The following table gives a summary of the released versions of the MI
  97. interface: the version number, the version of GDB in which it first appeared
  98. and the breaking changes compared to the previous version.
  99. </p>
  100. <table>
  101. <thead><tr><th width="5%">MI version</th><th width="5%">GDB version</th><th width="90%">Breaking changes</th></tr></thead>
  102. <tr><td width="5%"><div align="center">1
  103. </div></td><td width="5%"><div align="center">5.1
  104. </div></td><td width="90%">None</td></tr>
  105. <tr><td width="5%"><div align="center">2
  106. </div></td><td width="5%"><div align="center">6.0
  107. </div></td><td width="90%"><ul>
  108. <li> The <code>-environment-pwd</code>, <code>-environment-directory</code> and
  109. <code>-environment-path</code> commands now returns values using the MI output
  110. syntax, rather than CLI output syntax.
  111. </li><li> <code>-var-list-children</code>&rsquo;s <code>children</code> result field is now a list, rather
  112. than a tuple.
  113. </li><li> <code>-var-update</code>&rsquo;s <code>changelist</code> result field is now a list, rather than
  114. a tuple.
  115. </li></ul></td></tr>
  116. <tr><td width="5%"><div align="center">3
  117. </div></td><td width="5%"><div align="center">9.1
  118. </div></td><td width="90%"><ul>
  119. <li> The output of information about multi-location breakpoints has changed in the
  120. responses to the <code>-break-insert</code> and <code>-break-info</code> commands, as well
  121. as in the <code>=breakpoint-created</code> and <code>=breakpoint-modified</code> events.
  122. The multiple locations are now placed in a <code>locations</code> field, whose value
  123. is a list.
  124. </li></ul></td></tr>
  125. </table>
  126. <p>If your front end cannot yet migrate to a more recent version of the
  127. MI protocol, you can nevertheless selectively enable specific features
  128. available in those recent MI versions, using the following commands:
  129. </p>
  130. <dl compact="compact">
  131. <dt><code>-fix-multi-location-breakpoint-output</code></dt>
  132. <dd><p>Use the output for multi-location breakpoints which was introduced by
  133. MI 3, even when using MI versions 2 or 1. This command has no
  134. effect when using MI version 3 or later.
  135. </p>
  136. </dd>
  137. </dl>
  138. <p>The best way to avoid unexpected changes in MI that might break your front
  139. end is to make your project known to <small>GDB</small> developers and
  140. follow development on <a href="mailto:gdb@sourceware.org">gdb@sourceware.org</a> and
  141. <a href="mailto:gdb-patches@sourceware.org">gdb-patches@sourceware.org</a>.
  142. <a name="index-mailing-lists"></a>
  143. </p>
  144. <hr>
  145. <div class="header">
  146. <p>
  147. Next: <a href="GDB_002fMI-Output-Records.html#GDB_002fMI-Output-Records" accesskey="n" rel="next">GDB/MI Output Records</a>, Previous: <a href="GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI" accesskey="p" rel="previous">GDB/MI Compatibility with CLI</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  148. </div>
  149. </body>
  150. </html>