From: dje@google.com (Doug Evans)
To: msnyder@vmware.com, teawater@gmail.com
Cc: gdb@sourceware.org
Subject: Why do globals record.c:tmp_to_resume_ops, etc. exist?
Date: Sat, 24 Oct 2009 03:30:00 -0000 [thread overview]
Message-ID: <20091023164838.573AE84384@ruffy.mtv.corp.google.com> (raw)
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."));
next reply other threads:[~2009-10-23 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-24 3:30 Doug Evans [this message]
2009-10-24 5:38 ` Hui Zhu
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=20091023164838.573AE84384@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.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