forked from Imagelibrary/binutils-gdb
* gen-c-prog.awk: New awk script, lightly changed from
previously deleted make-c-prog.awk. Converts a text file to a c function that prints that text. * flat_bl.m, fsf_callg_bl.m, bsd_callg_bl.m: New files. Inputs to gen-c-prog.awk, containing text describing gprof output. * blurbs.c: Removed. Use *_bl.c instead. * Makefile.in: Use gen-cprog.awk to generate *_bl.c files from *_bl.m files. Also, improve *clean rules. * printgprof.c (printgprof): Usw new function names from *_bl.c.
This commit is contained in:
26
gprof/gen-c-prog.awk
Normal file
26
gprof/gen-c-prog.awk
Normal file
@@ -0,0 +1,26 @@
|
||||
NR == 1 {
|
||||
FS="\"";
|
||||
print "/* ==> Do not modify this file!! It is created automatically"
|
||||
printf " from %s using the make-c-prog.awk script. <== */\n\n", FILE
|
||||
print "#include <stdio.h>"
|
||||
}
|
||||
|
||||
{
|
||||
if (curfun != FUNCTION)
|
||||
{
|
||||
if (curfun)
|
||||
print "}"
|
||||
curfun = FUNCTION
|
||||
print ""
|
||||
print "void";
|
||||
printf "%s (file)\n", FUNCTION
|
||||
print " FILE *file;";
|
||||
print "{";
|
||||
}
|
||||
printf " fputs (\"";
|
||||
for (i = 1; i < NF; i++)
|
||||
printf "%s\\\"", $i;
|
||||
printf "%s\\n\", file);\n", $NF;
|
||||
}
|
||||
|
||||
END { print "}" }
|
||||
Reference in New Issue
Block a user