2003-10-15 Andrew Cagney <cagney@redhat.com>

* target.c (target_stack): Change to a static target_ops.
	(update_current_target): Walk the "struct target_ops" stack.
	(pop_target, do_xfer_memory, target_info): Ditto.
	(find_target_beneath): Ditto.
	(push_target): Rewrite to use the "struct target_ops" stack.
	(unpush_target): Ditto.
	* target.h (struct target_stack_item): Delete definition.
	(target_stack): Delete declaration.
	(struct target_ops): Add field "beneath".
This commit is contained in:
Andrew Cagney
2003-10-17 13:59:27 +00:00
parent ac1764c748
commit 258b763a8c
3 changed files with 51 additions and 78 deletions

View File

@@ -188,6 +188,7 @@ struct thread_info; /* fwd decl for parameter list below: */
struct target_ops
{
struct target_ops *beneath; /* To the target under this one. */
char *to_shortname; /* Name this target type */
char *to_longname; /* Name for printing */
char *to_doc; /* Documentation. Does not include trailing
@@ -326,18 +327,6 @@ struct target_ops
extern struct target_ops current_target;
/* An item on the target stack. */
struct target_stack_item
{
struct target_stack_item *next;
struct target_ops *target_ops;
};
/* The target stack. */
extern struct target_stack_item *target_stack;
/* Define easy words for doing these operations on our current target. */
#define target_shortname (current_target.to_shortname)