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-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 the
8Invariant Sections being "Free Software" and "Free Software Needs
9Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
10and with the Back-Cover Texts as in (a) below.
11
12(a) The FSF's Back-Cover Text is: "You are free to copy and modify
13this GNU Manual.  Buying copies from GNU Press supports the FSF in
14developing GNU and promoting software freedom." -->
15<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
16<head>
17<title>Debugging with GDB: Symbol Tables In Guile</title>
18
19<meta name="description" content="Debugging with GDB: Symbol Tables In Guile">
20<meta name="keywords" content="Debugging with GDB: Symbol Tables In Guile">
21<meta name="resource-type" content="document">
22<meta name="distribution" content="global">
23<meta name="Generator" content="makeinfo">
24<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25<link href="index.html#Top" rel="start" title="Top">
26<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
27<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
28<link href="Guile-API.html#Guile-API" rel="up" title="Guile API">
29<link href="Breakpoints-In-Guile.html#Breakpoints-In-Guile" rel="next" title="Breakpoints In Guile">
30<link href="Symbols-In-Guile.html#Symbols-In-Guile" rel="previous" title="Symbols In Guile">
31<style type="text/css">
32<!--
33a.summary-letter {text-decoration: none}
34blockquote.smallquotation {font-size: smaller}
35div.display {margin-left: 3.2em}
36div.example {margin-left: 3.2em}
37div.indentedblock {margin-left: 3.2em}
38div.lisp {margin-left: 3.2em}
39div.smalldisplay {margin-left: 3.2em}
40div.smallexample {margin-left: 3.2em}
41div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
42div.smalllisp {margin-left: 3.2em}
43kbd {font-style:oblique}
44pre.display {font-family: inherit}
45pre.format {font-family: inherit}
46pre.menu-comment {font-family: serif}
47pre.menu-preformatted {font-family: serif}
48pre.smalldisplay {font-family: inherit; font-size: smaller}
49pre.smallexample {font-size: smaller}
50pre.smallformat {font-family: inherit; font-size: smaller}
51pre.smalllisp {font-size: smaller}
52span.nocodebreak {white-space:nowrap}
53span.nolinebreak {white-space:nowrap}
54span.roman {font-family:serif; font-weight:normal}
55span.sansserif {font-family:sans-serif; font-weight:normal}
56ul.no-bullet {list-style: none}
57-->
58</style>
59
60
61</head>
62
63<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
64<a name="Symbol-Tables-In-Guile"></a>
65<div class="header">
66<p>
67Next: <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>
68</div>
69<hr>
70<a name="Symbol-table-representation-in-Guile_002e"></a>
71<h4 class="subsubsection">23.3.3.18 Symbol table representation in Guile.</h4>
72
73<a name="index-symbol-tables-in-guile"></a>
74<a name="index-_003cgdb_003asymtab_003e"></a>
75<a name="index-_003cgdb_003asal_003e"></a>
76
77<p>Access to symbol table data maintained by <small>GDB</small> on the inferior
78is exposed to Guile via two objects: <code>&lt;gdb:sal&gt;</code> (symtab-and-line) and
79<code>&lt;gdb:symtab&gt;</code>.  Symbol table and line data for a frame is returned
80from the <code>frame-find-sal</code> <code>&lt;gdb:frame&gt;</code> procedure.
81See <a href="Frames-In-Guile.html#Frames-In-Guile">Frames In Guile</a>.
82</p>
83<p>For more information on <small>GDB</small>&rsquo;s symbol table management, see
84<a href="Symbols.html#Symbols">Examining the Symbol Table</a>.
85</p>
86<p>The following symtab-related procedures are provided by the
87<code>(gdb)</code> module:
88</p>
89<dl>
90<dt><a name="index-symtab_003f"></a>Scheme Procedure: <strong>symtab?</strong> <em>object</em></dt>
91<dd><p>Return <code>#t</code> if <var>object</var> is an object of type <code>&lt;gdb:symtab&gt;</code>.
92Otherwise return <code>#f</code>.
93</p></dd></dl>
94
95<dl>
96<dt><a name="index-symtab_002dvalid_003f"></a>Scheme Procedure: <strong>symtab-valid?</strong> <em>symtab</em></dt>
97<dd><p>Return <code>#t</code> if the <code>&lt;gdb:symtab&gt;</code> object is valid,
98<code>#f</code> if not.  A <code>&lt;gdb:symtab&gt;</code> object becomes invalid when
99the symbol table it refers to no longer exists in <small>GDB</small>.
100All other <code>&lt;gdb:symtab&gt;</code> procedures will throw an exception
101if it is invalid at the time the procedure is called.
102</p></dd></dl>
103
104<dl>
105<dt><a name="index-symtab_002dfilename"></a>Scheme Procedure: <strong>symtab-filename</strong> <em>symtab</em></dt>
106<dd><p>Return the symbol table&rsquo;s source filename.
107</p></dd></dl>
108
109<dl>
110<dt><a name="index-symtab_002dfullname"></a>Scheme Procedure: <strong>symtab-fullname</strong> <em>symtab</em></dt>
111<dd><p>Return the symbol table&rsquo;s source absolute file name.
112</p></dd></dl>
113
114<dl>
115<dt><a name="index-symtab_002dobjfile"></a>Scheme Procedure: <strong>symtab-objfile</strong> <em>symtab</em></dt>
116<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>.
117</p></dd></dl>
118
119<dl>
120<dt><a name="index-symtab_002dglobal_002dblock"></a>Scheme Procedure: <strong>symtab-global-block</strong> <em>symtab</em></dt>
121<dd><p>Return the global block of the underlying symbol table.
122See <a href="Blocks-In-Guile.html#Blocks-In-Guile">Blocks In Guile</a>.
123</p></dd></dl>
124
125<dl>
126<dt><a name="index-symtab_002dstatic_002dblock"></a>Scheme Procedure: <strong>symtab-static-block</strong> <em>symtab</em></dt>
127<dd><p>Return the static block of the underlying symbol table.
128See <a href="Blocks-In-Guile.html#Blocks-In-Guile">Blocks In Guile</a>.
129</p></dd></dl>
130
131<p>The following symtab-and-line-related procedures are provided by the
132<code>(gdb)</code> module:
133</p>
134<dl>
135<dt><a name="index-sal_003f"></a>Scheme Procedure: <strong>sal?</strong> <em>object</em></dt>
136<dd><p>Return <code>#t</code> if <var>object</var> is an object of type <code>&lt;gdb:sal&gt;</code>.
137Otherwise return <code>#f</code>.
138</p></dd></dl>
139
140<dl>
141<dt><a name="index-sal_002dvalid_003f"></a>Scheme Procedure: <strong>sal-valid?</strong> <em>sal</em></dt>
142<dd><p>Return <code>#t</code> if <var>sal</var> is valid, <code>#f</code> if not.
143A <code>&lt;gdb:sal&gt;</code> object becomes invalid when the Symbol table object
144it refers to no longer exists in <small>GDB</small>.  All other
145<code>&lt;gdb:sal&gt;</code> procedures will throw an exception if it is
146invalid at the time the procedure is called.
147</p></dd></dl>
148
149<dl>
150<dt><a name="index-sal_002dsymtab"></a>Scheme Procedure: <strong>sal-symtab</strong> <em>sal</em></dt>
151<dd><p>Return the symbol table object (<code>&lt;gdb:symtab&gt;</code>) for <var>sal</var>.
152</p></dd></dl>
153
154<dl>
155<dt><a name="index-sal_002dline"></a>Scheme Procedure: <strong>sal-line</strong> <em>sal</em></dt>
156<dd><p>Return the line number for <var>sal</var>.
157</p></dd></dl>
158
159<dl>
160<dt><a name="index-sal_002dpc"></a>Scheme Procedure: <strong>sal-pc</strong> <em>sal</em></dt>
161<dd><p>Return the start of the address range occupied by code for <var>sal</var>.
162</p></dd></dl>
163
164<dl>
165<dt><a name="index-sal_002dlast"></a>Scheme Procedure: <strong>sal-last</strong> <em>sal</em></dt>
166<dd><p>Return the end of the address range occupied by code for <var>sal</var>.
167</p></dd></dl>
168
169<dl>
170<dt><a name="index-find_002dpc_002dline"></a>Scheme Procedure: <strong>find-pc-line</strong> <em>pc</em></dt>
171<dd><p>Return the <code>&lt;gdb:sal&gt;</code> object corresponding to the <var>pc</var> value.
172If an invalid value of <var>pc</var> is passed as an argument, then the
173<code>symtab</code> and <code>line</code> attributes of the returned <code>&lt;gdb:sal&gt;</code>
174object will be <code>#f</code> and 0 respectively.
175</p></dd></dl>
176
177<hr>
178<div class="header">
179<p>
180Next: <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>
181</div>
182
183
184
185</body>
186</html>
187