This is the mail archive of the gdb@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]

Re: Why do globals record.c:tmp_to_resume_ops, etc. exist?


Thanks Doug.

record_open_1 and record_open use them.

Just record target need "record_beneath_to_resume_ops" and ...
But record_core don't need them.

So these check in record_open_1.

Thanks,
Hui

On Sat, Oct 24, 2009 at 00:48, Doug Evans <dje@google.com> wrote:
> Hi.
> I don't understand why these globals exist.
>
> static struct target_ops *tmp_to_resume_ops;
> static void (*tmp_to_resume) (struct target_ops *, ptid_t, int,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?enum target_signal);
> static struct target_ops *tmp_to_wait_ops;
> static ptid_t (*tmp_to_wait) (struct target_ops *, ptid_t,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?struct target_waitstatus *,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int);
> static struct target_ops *tmp_to_store_registers_ops;
> static void (*tmp_to_store_registers) (struct target_ops *,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct regcache *,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int regno);
> static struct target_ops *tmp_to_xfer_partial_ops;
> static LONGEST (*tmp_to_xfer_partial) (struct target_ops *ops,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? enum target_object object,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const char *annex,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gdb_byte *readbuf,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const gdb_byte *writebuf,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ULONGEST offset,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LONGEST len);
> static int (*tmp_to_insert_breakpoint) (struct gdbarch *,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?struct bp_target_info *);
> static int (*tmp_to_remove_breakpoint) (struct gdbarch *,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?struct bp_target_info *);
>
>
> The error checking in record_open_1 could just as easily
> be done in the caller and then AFAICT these globals
> could be moved to record_open. ?That's a lot of globals to nuke.
> Am I missing something?
>
> ?if (!tmp_to_resume)
> ? ?error (_("Could not find 'to_resume' method on the target stack."));
> ?if (!tmp_to_wait)
> ? ?error (_("Could not find 'to_wait' method on the target stack."));
> ?if (!tmp_to_store_registers)
> ? ?error (_("Could not find 'to_store_registers' method on the target stack."));
> ?if (!tmp_to_insert_breakpoint)
> ? ?error (_("Could not find 'to_insert_breakpoint' method on the target stack."));
> ?if (!tmp_to_remove_breakpoint)
> ? ?error (_("Could not find 'to_remove_breakpoint' method on the target stack."));
>


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