From: Kevin Buettner <kevinb@redhat.com>
To: rda@sources.redhat.com
Subject: [PATCH] Fix some minor problems in lib/gdbserv-state.c
Date: Thu, 16 Jan 2003 17:33:00 -0000 [thread overview]
Message-ID: <1030116173139.ZM28429@localhost.localdomain> (raw)
I've just committed the following patch:
* lib/gdbserv-state.c (do_status_packet, gdbserv_data_packet): Fix
memset() calls - the arguments were in the wrong order.
(gdbserv_data_packet): Check return value from get_reg() call.
Index: lib/gdbserv-state.c
===================================================================
RCS file: /cvs/src/src/rda/lib/gdbserv-state.c,v
retrieving revision 1.1
diff -u -p -r1.1 gdbserv-state.c
--- lib/gdbserv-state.c 28 Aug 2002 01:22:28 -0000 1.1
+++ lib/gdbserv-state.c 16 Jan 2003 17:23:30 -0000
@@ -237,7 +237,7 @@ do_status_packet (struct gdbserv *gdbser
if (sizeof_reg > 0)
gdbserv->target->get_reg (gdbserv, reg_nr, ®);
else
- memset (®, sizeof (reg), 0);
+ memset (®, 0, sizeof (reg));
gdbserv->target->output_reg (gdbserv, ®, len);
gdbserv_output_char (gdbserv, ';');
}
@@ -747,9 +747,14 @@ gdbserv_data_packet (struct gdbserv *gdb
long sizeof_reg = gdbserv->target->sizeof_reg (gdbserv, reg_nr);
long len = (sizeof_reg < 0 ? -sizeof_reg : sizeof_reg);
if (sizeof_reg > 0)
- gdbserv->target->get_reg (gdbserv, reg_nr, ®);
+ {
+ int status;
+ status = gdbserv->target->get_reg (gdbserv, reg_nr, ®);
+ if (status < 0)
+ memset (®, 0, sizeof (reg));
+ }
else
- memset (®, sizeof (reg), 0);
+ memset (®, 0, sizeof (reg));
gdbserv->target->output_reg (gdbserv, ®, len);
}
}
reply other threads:[~2003-01-16 17:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1030116173139.ZM28429@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=rda@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).