Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Doug Evans <dje@google.com>
Cc: msnyder@vmware.com, gdb@sourceware.org
Subject: Re: Why do globals record.c:tmp_to_resume_ops, etc. exist?
Date: Sat, 24 Oct 2009 05:38:00 -0000	[thread overview]
Message-ID: <daef60380910232030v65ec7d9cq7e275d5f376ef207@mail.gmail.com> (raw)
In-Reply-To: <20091023164838.573AE84384@ruffy.mtv.corp.google.com>

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."));
>


      reply	other threads:[~2009-10-24  3:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24  3:30 Doug Evans
2009-10-24  5:38 ` Hui Zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daef60380910232030v65ec7d9cq7e275d5f376ef207@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=msnyder@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox