aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/exec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 3089bb4..a2b2942 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -105,11 +105,11 @@ exec_close (void)
}
}
-/* This is the target_close implementation. Clears all target
+/* This is the target_xclose implementation. Clears all target
sections and closes all executable bfds from all program spaces. */
static void
-exec_close_1 (struct target_ops *self)
+exec_xclose_1 (struct target_ops *self)
{
struct program_space *ss;
struct cleanup *old_chain;
@@ -123,6 +123,7 @@ exec_close_1 (struct target_ops *self)
}
do_cleanups (old_chain);
+ xfree (self);
}
void
@@ -512,7 +513,7 @@ add_target_sections (void *owner,
/* If these are the first file sections we can provide memory
from, push the file_stratum target. */
if (!target_is_pushed (&exec_ops))
- push_target (&exec_ops);
+ push_target (TARGET_NEW (struct target_ops, &exec_ops));
}
}
@@ -706,7 +707,7 @@ section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
mem_range_s *r;
int i;
- table = target_get_section_table (&exec_ops);
+ table = current_target_sections;
available_memory = section_table_available_memory (available_memory,
offset, len,
table->sections,
@@ -962,7 +963,7 @@ set_section_command (char *args, int from_tty)
p->addr += offset;
p->endaddr += offset;
if (from_tty)
- exec_files_info (&exec_ops);
+ exec_files_info (NULL);
return;
}
}
@@ -1031,7 +1032,7 @@ init_exec_ops (void)
exec_ops.to_doc = "Use an executable file as a target.\n\
Specify the filename of the executable file.";
exec_ops.to_open = exec_open;
- exec_ops.to_close = exec_close_1;
+ exec_ops.to_xclose = exec_xclose_1;
exec_ops.to_xfer_partial = exec_xfer_partial;
exec_ops.to_get_section_table = exec_get_section_table;
exec_ops.to_files_info = exec_files_info;