latrace-0.5.11
by Jiri Olsa
hi,
I realized it's quite long time from last release, so here it is ;)
And as it was quite a long time I surely forgot some stuff I usually
do when releasing new version.. hopefully not much
thanks all for contributions for this release
I plan to get finish the error simulation for next release,
together with bug fixies.. and probably to start new line like 0.6 ;)
have fun,
jirka
12 years, 9 months
args - adding support to display string pointer and length
by Jiri Olsa
Reply-To:
In-Reply-To: <BANLkTim=1AUfafP5OEeMQF5GNZPiGCpWeg(a)mail.gmail.com>
On Thu, May 26, 2011 at 10:34:44AM +0100, David Gilbert wrote:
> On 25 May 2011 20:22, Jiri Olsa <jolsa(a)redhat.com> wrote:
> > On Wed, May 25, 2011 at 04:02:07PM +0100, David Gilbert wrote:
SNIP
> Here is the string pointer/length patch:
>
> diff --git a/src/args.c b/src/args.c
> index b766326..d418e00 100644
> --- a/src/args.c
> +++ b/src/args.c
> @@ -834,12 +834,17 @@ do {
> \
> char *s = val;
> int slen = strlen(s);
> int left = alen;
> + int pointerlen;
> +
> + pointerlen = snprintf(argbuf, left, "(%p, %d) ", s, strlen(s));
> + left -= pointerlen;
> +
>
> if ((slen + 2) > left) {
> - snprintf(argbuf, left, "\"%s", s);
> + snprintf(argbuf+pointerlen, left, "\"%s", s);
> strncpy(argbuf + left - sizeof("...\"") + 1, "...\"", sizeof("...\""));
> } else {
> - strcpy(argbuf, "\"");
> + strcpy(argbuf+pointerlen, "\"");
> strcat(argbuf, s);
> strcat(argbuf, "\"");
> }
added.. plus support for configuring option,
please check and comment
git://fedorapeople.org/~jolsa/latrace.git
branch char_pointer_len
jirka
12 years, 9 months