Re: source code transform

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

 



On Wed, 7 Jan 2009, Johannes Berg wrote:

> On Wed, 2009-01-07 at 19:48 +0100, mosfet wrote:
>
> > I would like to know if sparse would be able to parse GCC source file to
> > add a comment in each function it encounters ?
> > For instance let's say I want to trace every function in c-parser.c :
> >
> >
> > static struct c_typespec
> > c_parser_enum_specifier (c_parser *parser)
> > {
> > ...
> >
> > }
> >
> > in a first step I would like to modify source code like this :
> >
> > static struct c_typespec
> > c_parser_enum_specifier (c_parser *parser)
> > {
> >  fprintf(stderr, "c-parser.c: c_parser_enum_specifier()\n");
> > ...
> >
> > }
> >
> > is it possible with sparse ?
>
> Not sure, but spatch might be able to:
>
> http://www.emn.fr/x-info/coccinelle/
>
you also could achieve this with -finstrument_functions by prviding
a cyg_func_enter function that would print the address - you then woud
have to reverse map addresses to functions via output of nm I guess.

hofrat
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux