aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1991-12-27 03:55:12 +0000
committerFred Fish <fnf@specifix.com>1991-12-27 03:55:12 +0000
commitb440b1e9e4376498e106e92967563898a1f2ce4b (patch)
tree6f9836ba35eb517a45bca15700005723d36a0681 /gdb/symmisc.c
parent62ddb92b9f690e84676dec711d572e08e828446d (diff)
downloadfsf-binutils-gdb-b440b1e9e4376498e106e92967563898a1f2ce4b.zip
fsf-binutils-gdb-b440b1e9e4376498e106e92967563898a1f2ce4b.tar.gz
fsf-binutils-gdb-b440b1e9e4376498e106e92967563898a1f2ce4b.tar.bz2
Various changes to clean up ADD_PSYMBOL_TO_LIST and ADD_PSYMBOL_ADDR_TO_LIST
usages.
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 507ec18..3c1df3e 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -567,6 +567,64 @@ extend_psymbol_list(listp)
listp->size = new_size;
}
+#ifdef DEBUG
+
+/* The work performed by this function is normally done by the macro
+ ADD_PSYMBOL_TO_LIST defined in symfile.h. When debugging gdb, this
+ function makes things easier. */
+
+void
+add_psymbol_to_list (name, namelength, namespace, class, listp, psymval)
+ char *name;
+ int namelength;
+ enum namespace namespace;
+ enum address_class class;
+ struct psymbol_allocation_list *listp;
+ unsigned long psymval;
+{
+ register struct partial_symbol *psym;
+
+ if (listp -> next >= listp -> list + listp -> size)
+ extend_psymbol_list (listp);
+ psym = listp -> next++;
+ SYMBOL_NAME (psym) = (char *) obstack_alloc (psymbol_obstack,
+ namelength + 1);
+ memcpy (SYMBOL_NAME (psym), name, namelength);
+ SYMBOL_NAME (psym)[namelength] = '\0';
+ SYMBOL_NAMESPACE (psym) = namespace;
+ SYMBOL_CLASS (psym) = class;
+ SYMBOL_VALUE (psym) = psymval;
+}
+
+/* The work performed by this function is normally done by the macro
+ ADD_PSYMBOL_ADDR_TO_LIST defined in symfile.h. When debugging gdb, this
+ function makes things easier. */
+
+void
+add_psymbol_addr_to_list (name, namelength, namespace, class, listp, psymval)
+ char *name;
+ int namelength;
+ enum namespace namespace;
+ enum address_class class;
+ struct psymbol_allocation_list *listp;
+ CORE_ADDR psymval;
+{
+ register struct partial_symbol *psym;
+
+ if (listp -> next >= listp -> list + listp -> size)
+ extend_psymbol_list (listp);
+ psym = listp -> next++;
+ SYMBOL_NAME (psym) = (char *) obstack_alloc (psymbol_obstack,
+ namelength + 1);
+ memcpy (SYMBOL_NAME (psym), name, namelength);
+ SYMBOL_NAME (psym)[namelength] = '\0';
+ SYMBOL_NAMESPACE (psym) = namespace;
+ SYMBOL_CLASS (psym) = class;
+ SYMBOL_VALUE_ADDRESS (psym) = psymval;
+}
+
+#endif /* DEBUG */
+
void
_initialize_symmisc ()
{