From: Michael Snyder <msnyder@cygnus.com>
To: "John S. Kallal" <kallal@CyberMax.local>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fix some error added with HEX2BIN
Date: Tue, 15 May 2001 19:05:00 -0000 [thread overview]
Message-ID: <3B01E075.CC7485FD@cygnus.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0105152108170.729-100000@CyberMax.local>
John,
Could you submit these changes separately, please?
We like to review changes that affect the behavior
separately from changes that are in the nature of clean-ups.
I think your bug-fix is correct, but it would be awkward to
approve that part and not the clean-up parts.
Thanks,
Michael
"John S. Kallal" wrote:
>
> The following patch corrects some errors that I think
> where added by the followin patch:
>
> http://sources.redhat.com/ml/gdb-patches/2001-05/msg00017.html .
>
> Without the patches, I was unable to work with the Linux
> version of GDBSERVER.
>
> 2001-05-15 John S Kallal <jskallal@home.com>
>
> * remote.c (remote_write_bytes) : Fixed string
> pointer & string end byte bug added when function
> of hex2bin added.
>
> * remote.c (remote_wait): Remove unused i variable.
> Merge variables p1 and p_temp into a single variable pt.
> Change long strings to use standard C string
> concatenation. Added new variable fieldsize to fix
> string pointer adjustment bug added when function call
> of hex2bin added.
>
> *** ../gdb+dejagnu-20010515-org/gdb/remote.c Tue May 15 10:26:57 2001
> --- gdb/remote.c Tue May 15 12:13:59 2001
> ***************
> *** 2825,2831 ****
> continue;
> case 'T': /* Status with PC, SP, FP, ... */
> {
> - int i;
> long regno;
> char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
>
> --- 2825,2830 ----
> ***************
> *** 2839,2882 ****
>
> while (*p)
> {
> ! unsigned char *p1;
> ! char *p_temp;
>
> /* Read the register number */
> ! regno = strtol ((const char *) p, &p_temp, 16);
> ! p1 = (unsigned char *) p_temp;
>
> ! if (p1 == p) /* No register number present here */
> {
> ! p1 = (unsigned char *) strchr ((const char *) p, ':');
> ! if (p1 == NULL)
> ! warning ("Malformed packet(a) (missing colon): %s\n\
> ! Packet: '%s'\n",
> ! p, buf);
> ! if (strncmp ((const char *) p, "thread", p1 - p) == 0)
> {
> ! p_temp = unpack_varlen_hex (++p1, &thread_num);
> record_currthread (thread_num);
> - p = (unsigned char *) p_temp;
> }
> }
> else
> {
> ! p = p1;
>
> if (*p++ != ':')
> ! warning ("Malformed packet(b) (missing colon): %s\n\
> ! Packet: '%s'\n",
> ! p, buf);
>
> if (regno >= NUM_REGS)
> ! warning ("Remote sent bad register number %ld: %s\n\
> ! Packet: '%s'\n",
> ! regno, p, buf);
>
> ! if (hex2bin (p, regs, REGISTER_RAW_SIZE (regno))
> ! < REGISTER_RAW_SIZE (regno))
> warning ("Remote reply is too short: %s", buf);
> supply_register (regno, regs);
> }
>
> --- 2838,2880 ----
>
> while (*p)
> {
> ! char *pt;
>
> /* Read the register number */
> ! regno = strtol ((const char *) p, &pt, 16);
>
> ! if (pt == (char *)p) /* No register number present here */
> {
> ! pt = strchr ((const char *) p, ':');
> ! if (pt == NULL)
> ! warning ("Malformed packet(a) (missing colon): %s\n"
> ! "Packet: '%s'\n", p, buf);
> !
> ! if (strncmp ((const char *) p, "thread", pt - (char *)p) == 0)
> {
> ! p = (unsigned char *)(unpack_varlen_hex (++pt, &thread_num) );
> record_currthread (thread_num);
> }
> }
> else
> {
> ! int fieldsize;
> !
> ! p = pt;
>
> if (*p++ != ':')
> ! warning ("Malformed packet(b) (missing colon): %s\n"
> ! "Packet: '%s'\n", p, buf);
>
> if (regno >= NUM_REGS)
> ! warning ("Remote sent bad register number %ld: %s\n"
> ! "Packet: '%s'\n", regno, p, buf);
>
> ! fieldsize = hex2bin (p, regs, REGISTER_RAW_SIZE (regno));
> ! p += 2*fieldsize;
> ! if ( fieldsize < REGISTER_RAW_SIZE (regno))
> warning ("Remote reply is too short: %s", buf);
> +
> supply_register (regno, regs);
> }
>
> ***************
> *** 2928,2935 ****
>
> if (symfile_objfile == NULL)
> {
> ! warning ("Relocation packet received with no symbol file. \
> ! Packet Dropped");
> goto got_status;
> }
>
> --- 2926,2933 ----
>
> if (symfile_objfile == NULL)
> {
> ! warning ("Relocation packet received with no symbol file. "
> ! "Packet Dropped");
> goto got_status;
> }
>
> ***************
> *** 3628,3633 ****
> --- 3626,3633 ----
> increasing byte addresses. Each byte is encoded as a two hex
> value. */
> nr_bytes = bin2hex (myaddr, p, todo);
> + p += 2*nr_bytes;
> + *p = '\0';
> break;
> case PACKET_SUPPORT_UNKNOWN:
> internal_error (__FILE__, __LINE__,
prev parent reply other threads:[~2001-05-15 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-15 18:17 John S. Kallal
2001-05-15 19:05 ` Michael Snyder [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=3B01E075.CC7485FD@cygnus.com \
--to=msnyder@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kallal@CyberMax.local \
/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