aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2000-03-21 20:40:43 +0000
committerJim Blandy <jimb@codesourcery.com>2000-03-21 20:40:43 +0000
commit058f20d52afdf4a88494da6770c447d7ced87f47 (patch)
tree34f79340c32077cd82a8a25576b7e672cd4a30d9 /gdb/gdbarch.c
parentf2ae78293c387861afda4553a44ece0427b047ff (diff)
downloadgdb-058f20d52afdf4a88494da6770c447d7ced87f47.zip
gdb-058f20d52afdf4a88494da6770c447d7ced87f47.tar.gz
gdb-058f20d52afdf4a88494da6770c447d7ced87f47.tar.bz2
* gdbarch.sh: Emit a definition and declaration for gdbarch_free,
a companion to gdbarch_alloc, which allows a gdbarch init function to free partially-built gdbarch structures. * gdbarch.c, gdbarch.h: Regenerated.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index f33536d..b23ec91 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -357,6 +357,19 @@ gdbarch_alloc (const struct gdbarch_info *info,
}
+/* Free a gdbarch struct. This should never happen in normal
+ operation --- once you've created a gdbarch, you keep it around.
+ However, if an architecture's init function encounters an error
+ building the structure, it may need to clean up a partially
+ constructed gdbarch. */
+void
+gdbarch_free (struct gdbarch *arch)
+{
+ /* At the moment, this is trivial. */
+ free (arch);
+}
+
+
/* Ensure that all values in a GDBARCH are reasonable. */
static void