simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Simulavr-devel] [patch #3453] gdbserver.c gdb_extract_hex_num(...) bug


From: Klaus Rudolph
Subject: [Simulavr-devel] [patch #3453] gdbserver.c gdb_extract_hex_num(...) bug fix (for more recent gdb versions)
Date: Mon, 18 Oct 2004 11:15:32 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040114

This mail is an automated notification from the patch tracker
 of the project: Simulavr: an AVR simulator.

/**************************************************************************/
[patch #3453] Latest Modifications:

Changes by: 
                Klaus Rudolph <address@hidden>
'Date: 
                Mon 18.10.2004 at 15:07 (Europe/Berlin)

------------------ Additional Follow-up Comments ----------------------------
Can you give me an idea what problem the patch should fix?

Your new line:
 num = (num << 4) | hex2nib (*p);
could never work I think. This will always change 
the "0000000X0" position but nothing else!?.
If the tranmitted var is longer you have to change
the init of max_shifts but that is not done....

maybe I am totally confused today, but please let us know
what your problem is.

Why you have not send a patch file as patch?







/**************************************************************************/
[patch #3453] Full Item Snapshot:

URL: <http://savannah.nongnu.org/patch/?func=detailitem&item_id=3453>
Project: Simulavr: an AVR simulator
Submitted by: Paul Schlie
On: Mon 18.10.2004 at 12:48

Category:  bug fix
Priority:  9 - Immediate
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Email:  
Status:  Open


Summary:  gdbserver.c gdb_extract_hex_num(...) bug fix (for more recent gdb 
versions)

Original Submission:  static int
gdb_extract_hex_num (char **pkt, char stop)
{
    int i = 0;
    int num = 0;
    char *p = *pkt;
    int max_shifts = sizeof (int) * 2 - 1; /* max number of nibbles to shift
                                              through */

    while ((*p != stop) && (*p != ''))
    {
        if (i > max_shifts)
            avr_error ("number too large");

/* This is broken for values encoded with greater than two hex digits, which
    is typical in gdb sessions when leading 0's are encoded for integer values
        num = (num << (i * 4)) | hex2nib (*p);  (replaced by following line) */
        num = (num << 4) | hex2nib (*p);
        i++;
        p++;
    }

    *pkt = p;
    return num;
}


Follow-up Comments
------------------


-------------------------------------------------------
Date: Mon 18.10.2004 at 15:07       By: Klaus Rudolph <zfrdh>
Can you give me an idea what problem the patch should fix?

Your new line:
 num = (num << 4) | hex2nib (*p);
could never work I think. This will always change 
the "0000000X0" position but nothing else!?.
If the tranmitted var is longer you have to change
the init of max_shifts but that is not done....

maybe I am totally confused today, but please let us know
what your problem is.

Why you have not send a patch file as patch?













For detailed info, follow this link:
<http://savannah.nongnu.org/patch/?func=detailitem&item_id=3453>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]