Revised: [patch] general updates and improvements to QNX NTO support
Mon Dec 6 16:53:00 GMT 2004
Based on Mark's comments, I've refactored this patch to provide a
cleaner interface to nto_tdep.c. I created an nto_set_target function
so that the targets can initialize their own nto_target_ops and set the
target properly rather than initializing current_nto_target.
I thought about completely hiding the implementation by turning all the
macros into functions which just call the current target functions but
I'm not sure if it's worth it. Specifically I'm thinking about cases
where other modules need access to members of current_nto_target. For
instance, the remote and procfs modules need to set various flags and
hooks so if I were to hide current_nto_target, I'd need setter/getter
functions. Certainly that is the cleaner 'OO' approach. If it needs
changing later, I might also store a list of targets in nto-tdep.c. It
doesn't seem like a high priority right now though since we probably
won't be multi-arching our gdb any time soon.
2004-12-06 Kris Warkentin <firstname.lastname@example.org>
* nto-tdep.h: Include osabi.h. Prototypes for generic Neutrino
osabi sniffer, signal handling initializer, 'in_dynsym_resolve_code'
function and nto_set_target function.
(struct nto_target_ops): Put comments inline with struct. Add osabi
sniffer hook. Redefine macros to permit testing/assignment. Remove
nto_ prefix from members.
* nto-tdep.c (nto_find_and_open_solib): Allocate all buffers
dynamically to support arbitrary root paths. Check for basename of
lib in search path and then check for absolute.
(nto_in_dynsym_resolve_code): New function.
(nto_core_sniffer): New function.
(regset_core_fns): Register core sniffer.
(nto_initialize_signals): New function.
(_initialize_nto_tdep): Move signal initialization code to above to
avoid initialization race conditions.
(nto_set_target): New function.
* nto-procfs.c: Minor formatting/indenting changes.
(procfs_is_nto_target): New function.
(procfs_open): Set nto_is_nto_target.
(_initialize_procfs): Ditto. Remove notice_signals() call to avoid
initialization race conditions.
(procfs_create_inferior): Resume inferior after creation.
* i386-nto-tdep.c: Declare i386_nto_target.
(init_i386nto_ops): Initialize i386_nto_target instead of
(i386nto_init_abi): Initialize signals. Call nto_set_target. Set
(_initialize_i386nto_tdep): Call init_i386nto_ops. Register osabi
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 19394 bytes
Desc: not available
More information about the Gdb-patches