Symbol-Tables-In-Guile.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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: Symbol Tables In Guile</title>
  16. <meta name="description" content="Debugging with GDB: Symbol Tables In Guile">
  17. <meta name="keywords" content="Debugging with GDB: Symbol Tables In Guile">
  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="Guile-API.html#Guile-API" rel="up" title="Guile API">
  26. <link href="Breakpoints-In-Guile.html#Breakpoints-In-Guile" rel="next" title="Breakpoints In Guile">
  27. <link href="Symbols-In-Guile.html#Symbols-In-Guile" rel="previous" title="Symbols In Guile">
  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="Symbol-Tables-In-Guile"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Breakpoints-In-Guile.html#Breakpoints-In-Guile" accesskey="n" rel="next">Breakpoints In Guile</a>, Previous: <a href="Symbols-In-Guile.html#Symbols-In-Guile" accesskey="p" rel="previous">Symbols In Guile</a>, Up: <a href="Guile-API.html#Guile-API" accesskey="u" rel="up">Guile API</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="Symbol-table-representation-in-Guile_002e"></a>
  65. <h4 class="subsubsection">23.3.3.18 Symbol table representation in Guile.</h4>
  66. <a name="index-symbol-tables-in-guile"></a>
  67. <a name="index-_003cgdb_003asymtab_003e"></a>
  68. <a name="index-_003cgdb_003asal_003e"></a>
  69. <p>Access to symbol table data maintained by <small>GDB</small> on the inferior
  70. is exposed to Guile via two objects: <code>&lt;gdb:sal&gt;</code> (symtab-and-line) and
  71. <code>&lt;gdb:symtab&gt;</code>. Symbol table and line data for a frame is returned
  72. from the <code>frame-find-sal</code> <code>&lt;gdb:frame&gt;</code> procedure.
  73. See <a href="Frames-In-Guile.html#Frames-In-Guile">Frames In Guile</a>.
  74. </p>
  75. <p>For more information on <small>GDB</small>&rsquo;s symbol table management, see
  76. <a href="Symbols.html#Symbols">Examining the Symbol Table</a>.
  77. </p>
  78. <p>The following symtab-related procedures are provided by the
  79. <code>(gdb)</code> module:
  80. </p>
  81. <dl>
  82. <dt><a name="index-symtab_003f"></a>Scheme Procedure: <strong>symtab?</strong> <em>object</em></dt>
  83. <dd><p>Return <code>#t</code> if <var>object</var> is an object of type <code>&lt;gdb:symtab&gt;</code>.
  84. Otherwise return <code>#f</code>.
  85. </p></dd></dl>
  86. <dl>
  87. <dt><a name="index-symtab_002dvalid_003f"></a>Scheme Procedure: <strong>symtab-valid?</strong> <em>symtab</em></dt>
  88. <dd><p>Return <code>#t</code> if the <code>&lt;gdb:symtab&gt;</code> object is valid,
  89. <code>#f</code> if not. A <code>&lt;gdb:symtab&gt;</code> object becomes invalid when
  90. the symbol table it refers to no longer exists in <small>GDB</small>.
  91. All other <code>&lt;gdb:symtab&gt;</code> procedures will throw an exception
  92. if it is invalid at the time the procedure is called.
  93. </p></dd></dl>
  94. <dl>
  95. <dt><a name="index-symtab_002dfilename"></a>Scheme Procedure: <strong>symtab-filename</strong> <em>symtab</em></dt>
  96. <dd><p>Return the symbol table&rsquo;s source filename.
  97. </p></dd></dl>
  98. <dl>
  99. <dt><a name="index-symtab_002dfullname"></a>Scheme Procedure: <strong>symtab-fullname</strong> <em>symtab</em></dt>
  100. <dd><p>Return the symbol table&rsquo;s source absolute file name.
  101. </p></dd></dl>
  102. <dl>
  103. <dt><a name="index-symtab_002dobjfile"></a>Scheme Procedure: <strong>symtab-objfile</strong> <em>symtab</em></dt>
  104. <dd><p>Return the symbol table&rsquo;s backing object file. See <a href="Objfiles-In-Guile.html#Objfiles-In-Guile">Objfiles In Guile</a>.
  105. </p></dd></dl>
  106. <dl>
  107. <dt><a name="index-symtab_002dglobal_002dblock"></a>Scheme Procedure: <strong>symtab-global-block</strong> <em>symtab</em></dt>
  108. <dd><p>Return the global block of the underlying symbol table.
  109. See <a href="Blocks-In-Guile.html#Blocks-In-Guile">Blocks In Guile</a>.
  110. </p></dd></dl>
  111. <dl>
  112. <dt><a name="index-symtab_002dstatic_002dblock"></a>Scheme Procedure: <strong>symtab-static-block</strong> <em>symtab</em></dt>
  113. <dd><p>Return the static block of the underlying symbol table.
  114. See <a href="Blocks-In-Guile.html#Blocks-In-Guile">Blocks In Guile</a>.
  115. </p></dd></dl>
  116. <p>The following symtab-and-line-related procedures are provided by the
  117. <code>(gdb)</code> module:
  118. </p>
  119. <dl>
  120. <dt><a name="index-sal_003f"></a>Scheme Procedure: <strong>sal?</strong> <em>object</em></dt>
  121. <dd><p>Return <code>#t</code> if <var>object</var> is an object of type <code>&lt;gdb:sal&gt;</code>.
  122. Otherwise return <code>#f</code>.
  123. </p></dd></dl>
  124. <dl>
  125. <dt><a name="index-sal_002dvalid_003f"></a>Scheme Procedure: <strong>sal-valid?</strong> <em>sal</em></dt>
  126. <dd><p>Return <code>#t</code> if <var>sal</var> is valid, <code>#f</code> if not.
  127. A <code>&lt;gdb:sal&gt;</code> object becomes invalid when the Symbol table object
  128. it refers to no longer exists in <small>GDB</small>. All other
  129. <code>&lt;gdb:sal&gt;</code> procedures will throw an exception if it is
  130. invalid at the time the procedure is called.
  131. </p></dd></dl>
  132. <dl>
  133. <dt><a name="index-sal_002dsymtab"></a>Scheme Procedure: <strong>sal-symtab</strong> <em>sal</em></dt>
  134. <dd><p>Return the symbol table object (<code>&lt;gdb:symtab&gt;</code>) for <var>sal</var>.
  135. </p></dd></dl>
  136. <dl>
  137. <dt><a name="index-sal_002dline"></a>Scheme Procedure: <strong>sal-line</strong> <em>sal</em></dt>
  138. <dd><p>Return the line number for <var>sal</var>.
  139. </p></dd></dl>
  140. <dl>
  141. <dt><a name="index-sal_002dpc"></a>Scheme Procedure: <strong>sal-pc</strong> <em>sal</em></dt>
  142. <dd><p>Return the start of the address range occupied by code for <var>sal</var>.
  143. </p></dd></dl>
  144. <dl>
  145. <dt><a name="index-sal_002dlast"></a>Scheme Procedure: <strong>sal-last</strong> <em>sal</em></dt>
  146. <dd><p>Return the end of the address range occupied by code for <var>sal</var>.
  147. </p></dd></dl>
  148. <dl>
  149. <dt><a name="index-find_002dpc_002dline"></a>Scheme Procedure: <strong>find-pc-line</strong> <em>pc</em></dt>
  150. <dd><p>Return the <code>&lt;gdb:sal&gt;</code> object corresponding to the <var>pc</var> value.
  151. If an invalid value of <var>pc</var> is passed as an argument, then the
  152. <code>symtab</code> and <code>line</code> attributes of the returned <code>&lt;gdb:sal&gt;</code>
  153. object will be <code>#f</code> and 0 respectively.
  154. </p></dd></dl>
  155. <hr>
  156. <div class="header">
  157. <p>
  158. Next: <a href="Breakpoints-In-Guile.html#Breakpoints-In-Guile" accesskey="n" rel="next">Breakpoints In Guile</a>, Previous: <a href="Symbols-In-Guile.html#Symbols-In-Guile" accesskey="p" rel="previous">Symbols In Guile</a>, Up: <a href="Guile-API.html#Guile-API" accesskey="u" rel="up">Guile API</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>
  159. </div>
  160. </body>
  161. </html>