aboutsummaryrefslogtreecommitdiff
path: root/gprof/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gprof/symtab.c')
-rw-r--r--gprof/symtab.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/gprof/symtab.c b/gprof/symtab.c
index 95f02b1..e8b0b34 100644
--- a/gprof/symtab.c
+++ b/gprof/symtab.c
@@ -18,7 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-
+
#include "gprof.h"
#include "search_list.h"
#include "source.h"
@@ -28,8 +28,40 @@
static int cmp_addr (const void *, const void *);
-Sym_Table symtab;
+/* The symbol table. */
+static Sym_Table symtab;
+
+/* Return the pointer to the symbol table. */
+
+Sym_Table *
+get_symtab_direct (void)
+{
+ return &symtab;
+}
+
+/* Return the pointer to the symbol table and initialize it if it isn't
+ initialized yet. */
+
+Sym_Table *
+get_symtab (void)
+{
+ static Sym_Table *symtab_p;
+ if (!symtab_p)
+ {
+ symtab_init ();
+
+ symtab_p = &symtab;
+ }
+ return symtab_p;
+}
+
+/* Set the symbol table to *LTAB. */
+void
+set_symtab (Sym_Table *ltab)
+{
+ symtab = *ltab;
+}
/* Initialize a symbol (so it's empty). */