patchSimulavr: an AVR simulator - Patches: patch #3453, gdbserver.c...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3453: gdbserver.c gdb_extract_hex_num(...) bug fix (for more recent gdb versions)

Submitter:  Paul Schlie <schlie>
Submitted:  Mon 18 Oct 2004 12:48:36 PM UTC
   
 
Category:  bug fix Priority:  9 - Immediate
Status:  Done Privacy:  Public
Assigned to:  zfrdh Open/Closed:  Closed
Component Version:  None

Tue 19 Oct 2004 06:48:42 PM UTC, comment #4: 

patch is checked in for simulavrxx and simulavr.

Thanks for sending the bug!

bye
   Klaus

Klaus Rudolph <zfrdh>
Group administrator
Tue 19 Oct 2004 06:07:17 AM UTC, comment #3: 

Sorry,

sometimes it needs more then a cup of coffee!

You are right. Can ou give me scenario where this problem
occures for a retest. I wonder that I have never
seen the problem before???

I try to check the change in the next days for simulavrxx.
I do not maintain simulavr but if needed I can do this also
for simulavr.


Thanks
   Klaus







Klaus Rudolph <zfrdh>
Group administrator
Mon 18 Oct 2004 11:33:39 PM UTC, comment #2: 

Maybe it's me that is totally confused, but the bug seem obvious. When converting a number with most significant digit first, one has to multiply whith base and add for each iteration:

num *= base;
num += next_digit;

Nils

Anonymous
Mon 18 Oct 2004 03:07:37 PM UTC, comment #1: 

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?

Klaus Rudolph <zfrdh>
Group administrator
Mon 18 Oct 2004 12:48:36 PM UTC, 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 != '\0'))
    {
        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;
}

Paul Schlie <schlie>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-10-19 zfrdh StatusNone Done
    Open/ClosedOpen Closed
2004-10-19 zfrdh Assigned toNone zfrdh

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code