convert corelow to to_xclose
This converts corelow to be a to_xclose target. It moves all the corelow-related globals into a new subclass of target_ops and arranges for core_open to push an instance of this. This is preparatory work for multi-target. After this patch, corelow doesn't rely on global state and multiple instances can readily be instantiated. 2014-07-29 Tom Tromey <tromey@redhat.com> * corelow.c (struct core_target_ops_with_data): New struct. (core_vec, core_gdbarch, core_data): Remove. Now fields of core_target_ops_with_data. (sniff_core_bfd): Add core_gdbarch parameter. (get_core_target_ops): New function. (core_xclose): Rename from core_close. Update for core_target_ops_with_data. Free the target. (core_close_cleanup): Rename parameter. Update. (core_open): Use TARGET_NEW. Update. (get_core_register_section, get_core_registers, core_files_info) (core_xfer_partial, core_read_description, core_pid_to_str): Use get_core_target_ops. Update. (init_core_ops): Set to_xclose, not to_close. * target.c (allocate_target): New function. * target.h (allocate_target): Declare. (TARGET_NEW): New macro.
Loading
Please register or sign in to comment