FreeCalypso > hg > freecalypso-reveng
comparison leo-obj/tool/richsym.c @ 151:6fe08feee018
tiobjd disasm -g: line break after function locals
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
|---|---|
| date | Thu, 01 May 2014 00:23:18 +0000 |
| parents | df01a4f4c272 |
| children | 15743b40e03a |
comparison
equal
deleted
inserted
replaced
| 150:df01a4f4c272 | 151:6fe08feee018 |
|---|---|
| 424 return(-1); | 424 return(-1); |
| 425 } | 425 } |
| 426 return(0); | 426 return(0); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void | |
| 430 richsym_function_locals(headsym) | 429 richsym_function_locals(headsym) |
| 431 struct internal_syment *headsym; | 430 struct internal_syment *headsym; |
| 432 { | 431 { |
| 433 unsigned n; | 432 unsigned n, count = 0; |
| 434 struct internal_syment *sym; | 433 struct internal_syment *sym; |
| 435 char classbuf[8]; | 434 char classbuf[8]; |
| 436 | 435 |
| 437 for (n = headsym->number + 1; n < nsymtab; n++) { | 436 for (n = headsym->number + 1; n < nsymtab; n++) { |
| 438 sym = symtab[n]; | 437 sym = symtab[n]; |
| 439 if (!sym) | 438 if (!sym) |
| 440 continue; | 439 continue; |
| 441 switch (sym->class) { | 440 switch (sym->class) { |
| 442 case C_REG: | 441 case C_REG: |
| 443 case C_REGPARM: | 442 case C_REGPARM: |
| 443 count++; | |
| 444 if (localsym_sanity_check(sym) < 0) | 444 if (localsym_sanity_check(sym) < 0) |
| 445 continue; | 445 continue; |
| 446 if (sym->value > 0xF) { | 446 if (sym->value > 0xF) { |
| 447 printf( | 447 printf( |
| 448 "; symbol #%u of class %s: value is not a valid register number\n", | 448 "; symbol #%u of class %s: value is not a valid register number\n", |
| 455 sym->value); | 455 sym->value); |
| 456 richsym_print_in_c("", sym, 0); | 456 richsym_print_in_c("", sym, 0); |
| 457 continue; | 457 continue; |
| 458 case C_ARG: | 458 case C_ARG: |
| 459 case C_AUTO: | 459 case C_AUTO: |
| 460 count++; | |
| 460 if (localsym_sanity_check(sym) < 0) | 461 if (localsym_sanity_check(sym) < 0) |
| 461 continue; | 462 continue; |
| 462 printf("; %s at 0x%x: ", | 463 printf("; %s at 0x%x: ", |
| 463 storage_class_to_string(sym->class, 0), | 464 storage_class_to_string(sym->class, 0), |
| 464 sym->value); | 465 sym->value); |
| 465 richsym_print_in_c("", sym, 0); | 466 richsym_print_in_c("", sym, 0); |
| 466 continue; | 467 continue; |
| 467 case C_FCN: | 468 case C_FCN: |
| 468 return; | 469 return(count); |
| 469 default: | 470 default: |
| 471 count++; | |
| 470 printf( | 472 printf( |
| 471 "; presumed local symbol #%u: unexpected class %s\n", | 473 "; presumed local symbol #%u: unexpected class %s\n", |
| 472 sym->number, | 474 sym->number, |
| 473 storage_class_to_string(sym->class, classbuf)); | 475 storage_class_to_string(sym->class, classbuf)); |
| 474 return; | 476 return(count); |
| 475 } | 477 } |
| 476 } | 478 } |
| 477 } | 479 return(count); |
| 480 } |
