This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Fix print_char() bug on translate to C
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Zhaolei <zhaolei at cn dot fujitsu dot com>
- Cc: "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Fri, 06 Feb 2009 13:18:51 -0500
- Subject: Re: [PATCH] Fix print_char() bug on translate to C
- References: <498BFE05.1050803@cn.fujitsu.com>
Zhaolei <zhaolei@cn.fujitsu.com> writes:
> > [...]
> stap -e 'probe begin {print_char("a")}'
Is it necessary to make print_char polymorphic? print("a") does the
same thing as that case.
(I had no idea we even had a "print_char" -- why on earth, considering
that we have printf("%c", number)... Perhaps it should just get
deprecated.)
> + default:
> + // print '-' if type unknown(should not run to here)
> + o->line() << "'-');";
> + break;
> else
> - o->line() << '"' << format_string << "\");";
> + // print '-' if no args(should not run to here because args are checked previously)
> + o->line() << "'-');";
Such cases should just abort(), as they indicate translator internal
errors.
- FChE