When disassembling, now prints ... instead of pages of whatever the
instruction for 0x0000 is.
This commit is contained in:
parent
357a1f38a5
commit
96d7950b55
1 changed files with 34 additions and 24 deletions
|
@ -261,7 +261,7 @@ bfd *abfd;
|
||||||
unsigned long m;
|
unsigned long m;
|
||||||
asection *section;
|
asection *section;
|
||||||
/* Replace symbol section relative values with abs values */
|
/* Replace symbol section relative values with abs values */
|
||||||
|
boolean done_dot = false;
|
||||||
|
|
||||||
for (i = 0; i < symcount; i++) {
|
for (i = 0; i < symcount; i++) {
|
||||||
if (syms[i]->section != (asection *)NULL) {
|
if (syms[i]->section != (asection *)NULL) {
|
||||||
|
@ -338,36 +338,46 @@ bfd *abfd;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i <section->size) {
|
while (i <section->size) {
|
||||||
if (with_line_numbers) {
|
if (data[i] ==0 && data[i+1] == 0 && data[i+2] == 0 &&
|
||||||
static prevline;
|
data[i+3] == 0) {
|
||||||
CONST char *filename;
|
if (done_dot == false) {
|
||||||
CONST char *functionname;
|
printf("...\n");
|
||||||
unsigned int line;
|
done_dot=true;
|
||||||
bfd_find_nearest_line(abfd,
|
|
||||||
section,
|
|
||||||
syms,
|
|
||||||
section->vma + i,
|
|
||||||
&filename,
|
|
||||||
&functionname,
|
|
||||||
&line);
|
|
||||||
|
|
||||||
if (filename && functionname && line && line != prevline) {
|
|
||||||
printf("%s:%u\n", filename, line);
|
|
||||||
prevline = line;
|
|
||||||
}
|
}
|
||||||
|
i+=4;
|
||||||
}
|
}
|
||||||
print_address(section->vma + i, stdout);
|
else {
|
||||||
printf(" ");
|
done_dot = false;
|
||||||
|
if (with_line_numbers) {
|
||||||
|
static prevline;
|
||||||
|
CONST char *filename;
|
||||||
|
CONST char *functionname;
|
||||||
|
unsigned int line;
|
||||||
|
bfd_find_nearest_line(abfd,
|
||||||
|
section,
|
||||||
|
syms,
|
||||||
|
section->vma + i,
|
||||||
|
&filename,
|
||||||
|
&functionname,
|
||||||
|
&line);
|
||||||
|
|
||||||
i += print(section->vma + i,
|
if (filename && functionname && line && line != prevline) {
|
||||||
data + i,
|
printf("%s:%u\n", filename, line);
|
||||||
stdout);
|
prevline = line;
|
||||||
putchar ('\n') ;
|
}
|
||||||
|
}
|
||||||
|
print_address(section->vma + i, stdout);
|
||||||
|
printf(" ");
|
||||||
|
|
||||||
|
i += print(section->vma + i,
|
||||||
|
data + i,
|
||||||
|
stdout);
|
||||||
|
putchar ('\n') ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue