Changeset 950 for trunk/tools/finsig_vxworks.c
- Timestamp:
- 02/11/12 09:36:09 (15 months ago)
- File:
-
- 1 edited
-
trunk/tools/finsig_vxworks.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/finsig_vxworks.c
r749 r950 89 89 } 90 90 91 FILE *out_fp; 92 91 93 void usage() 92 94 { 93 printf("finsig <primary> <base>\n"); 95 if (out_fp) fprintf(out_fp,"finsig <primary> <base> <outputfilename>\n"); 96 fprintf(stderr,"finsig <primary> <base> <outputfilename>\n"); 94 97 exit(1); 95 98 } … … 112 115 clock_t t1 = clock(); 113 116 114 if (argc != 3)117 if (argc != 4) 115 118 usage(); 119 120 out_fp = fopen(argv[3],"w"); 121 if (out_fp == NULL) usage(); 116 122 117 123 f = fopen(argv[1], "r+b"); … … 122 128 base = strtoul(argv[2], NULL, 0); 123 129 124 printf("// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n");125 printf("#include \"stubs_asm.h\"\n\n");130 fprintf(out_fp,"// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n"); 131 fprintf(out_fp,"#include \"stubs_asm.h\"\n\n"); 126 132 127 133 fseek(f,0,SEEK_END); … … 206 212 count ++; 207 213 if (count >= MAX_MATCHES){ 208 printf("// WARNING: too many matches for %s!\n", func_list[k].name);214 fprintf(out_fp,"// WARNING: too many matches for %s!\n", func_list[k].name); 209 215 break; 210 216 } … … 222 228 // find best match and report results 223 229 if (count == 0){ 224 printf("// ERROR: %s is not found!\n", curr_name);230 fprintf(out_fp,"// ERROR: %s is not found!\n", curr_name); 225 231 ret = 1; 226 232 } else { … … 230 236 231 237 if (matches->fail > 0) 232 printf("// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail));233 234 printf("NSTUB(%s, 0x%x)\n", curr_name, matches->ptr);238 fprintf(out_fp,"// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail)); 239 240 fprintf(out_fp,"NSTUB(%s, 0x%x)\n", curr_name, matches->ptr); 235 241 236 242 for (i=1;i<count && matches[i].fail==matches[0].fail;i++){ 237 printf("// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail);243 fprintf(out_fp,"// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail); 238 244 } 239 245 } … … 242 248 clock_t t2 = clock(); 243 249 244 fprintf(stderr,"Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC); 250 printf("Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC); 251 252 fclose(out_fp); 245 253 246 254 return ret;
Note: See TracChangeset
for help on using the changeset viewer.