This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Introduce class target_stack


*** TEST RESULTS FOR COMMIT a1740ee1573d6e0e21692f815b322e3d062bbbee ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: a1740ee1573d6e0e21692f815b322e3d062bbbee

Introduce class target_stack

Currently, the target stack is represented by a singly linked list,
with target_ops having a pointer to the target beneath.  This poses a
problem for multi-process / multi-target debugging.  In that case, we
will naturally want multiple instances of target stacks.  E.g., one
stack for inferior 1 which is debugging a core file, and another
target stack for inferior 2 which is debugging a remote process.  The
problem then is in finding a target's "beneath" target, if we consider
that for some target_ops types, we'll be sharing a single target_ops
instance between several inferiors.  For example, so far, I found no
need to have multiple instances of the spu_multiarch_target /
exec_target / dummy_target targets.

Thus this patch, which changes the target stack representation to an
array of pointers.  For now, there's still a single global instance of
this new target_stack class, though further down in the multi-target
work, each inferior will have its own instance.

gdb/ChangeLog:
2018-06-07  Pedro Alves  <palves@redhat.com>

	* target.h (target_ops) <beneath>: Now a method.  All references
	updated.
	(class target_stack): New.
	* target.c (g_target_stack): New.
	(g_current_top_target): Delete.
	(current_top_target): Get the top target out of g_target_stack.
	(target_stack::push, target_stack::unpush): New.
	(push_target, unpush_target): Reimplement.
	(target_is_pushed): Reimplement in terms of g_target_stack.
	(target_ops::beneath, target_stack::find_beneath): New.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]