aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/progspace.c')
-rw-r--r--gdb/progspace.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 366de54..5aa7a3d 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -153,6 +153,28 @@ program_space::~program_space ()
program_space_free_data (this);
}
+/* See progspace.h. */
+
+void
+program_space::add_objfile (struct objfile *objfile, struct objfile *before)
+{
+ for (struct objfile **objp = &objfiles_head;
+ *objp != NULL;
+ objp = &((*objp)->next))
+ {
+ if (*objp == before)
+ {
+ objfile->next = *objp;
+ *objp = objfile;
+ return;
+ }
+ }
+
+ internal_error (__FILE__, __LINE__,
+ _("put_objfile_before: before objfile not in list"));
+
+}
+
/* Copies program space SRC to DEST. Copies the main executable file,
and the main symbol file. Returns DEST. */