Re: bug in tracepoint protocol implementation

Josef Ezra
2000-10-03T10:29:00Z

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

(Thanks Michael, I'll try to hit standards this time)

The attached fixes an unpleasant bug in trace mechanism. Creating a
tracepoint declaration string for remote host, and when more then one
memrange item was declared in a tracepoint, the debugger would have leave
gaps in the string's buffer, causing unexpected results.

Josef Ezra

----- Original Message -----
From: "Michael Snyder" <msnyder@redhat.com>
To: "Josef Ezra" <jezra@emc.com>
Cc: <gdb-patches@sources.redhat.com>; <shagam@emc.com>; <sgordon@emc.com>
Sent: Monday, October 02, 2000 2:19 PM
Subject: Re: bug in tracepoint protocol implementation

> Josef Ezra wrote:
> >
> > hi
> >
> > file: tracepoint.c
> > function: stringify_collection_list
> >
> > old:
> > count += strlen (end);
> > end += count ;
> >
> > new:
> > count += strlen (end);
> > end = temp_buf + count ;
> >
> > reasoning:
> > When saving more then one memrange parameter, the old code
> > leaves 'gaps' in the temp_buf string.
>
> Josef,
>
> Your change is correct (thank you). However, would you
> please re-submit it after consulting the file "CONTRIBUTING"
> in your gdb source directory? Or see:
> http://sources.redhat.com/gdb/#contribute
>
> Briefly, to streamline the process of accepting GDB
> contributions, we request the following format:
>
> * brief description of the problem being addressed
> * ChangeLog entry
> * Diff of the changes, such as will be acceptable
> as input to "patch" (eg. "cvs diff -c3p tracepoint.c")
>
> Hate to put you thru the exercise of resubmitting such a
> simple patch, but it will be good experience if you intend
> to make further GDB contributions (as I hope you will).
>
> Thanks,
> Michael Snyder
>

[-- Attachment #2: tracepoint.c.diff --]
[-- Type: text/plain, Size: 655 bytes --]

*tracepoint.c : bug fixed: string was created in bogus
offsets.

*** tracepoint.c.~1.1~ Tue Oct 3 12:55:06 2000
--- tracepoint.c.~1.1~~ Tue Oct 3 12:56:34 2000
*************** stringify_collection_list (list, string)
*** 1448,1454 ****
(long) (list->list[i].end - list->list[i].start));

count += strlen (end);
! end += count;
}

for (i = 0; i < list->next_aexpr_elt; i++)
--- 1448,1454 ----
(long) (list->list[i].end - list->list[i].start));

count += strlen (end);
! end = temp_buf + count;
}

for (i = 0; i < list->next_aexpr_elt; i++)