aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-06-07 01:33:38 +0000
committerSteve Chamberlain <steve@cygnus>1991-06-07 01:33:38 +0000
commit96d7950b55eea7365c6324bbe03e29cd7645c08e (patch)
tree952b0adc9089f64fb3559884f1f1b6b64e819a8c /binutils/objdump.c
parent357a1f38a539d43612122eb1c1842fd84859b165 (diff)
downloadgdb-96d7950b55eea7365c6324bbe03e29cd7645c08e.zip
gdb-96d7950b55eea7365c6324bbe03e29cd7645c08e.tar.gz
gdb-96d7950b55eea7365c6324bbe03e29cd7645c08e.tar.bz2
When disassembling, now prints ... instead of pages of whatever the
instruction for 0x0000 is.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c58
1 files changed, 34 insertions, 24 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index f3af0a7..9f98756 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -261,7 +261,7 @@ bfd *abfd;
unsigned long m;
asection *section;
/* Replace symbol section relative values with abs values */
-
+ boolean done_dot = false;
for (i = 0; i < symcount; i++) {
if (syms[i]->section != (asection *)NULL) {
@@ -338,36 +338,46 @@ bfd *abfd;
i = 0;
while (i <section->size) {
- 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);
-
- if (filename && functionname && line && line != prevline) {
- printf("%s:%u\n", filename, line);
- prevline = line;
+ if (data[i] ==0 && data[i+1] == 0 && data[i+2] == 0 &&
+ data[i+3] == 0) {
+ if (done_dot == false) {
+ printf("...\n");
+ done_dot=true;
}
+ i+=4;
}
- print_address(section->vma + i, stdout);
- printf(" ");
+ else {
+ 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);
+
+ if (filename && functionname && line && line != prevline) {
+ printf("%s:%u\n", filename, line);
+ prevline = line;
+ }
+ }
+ print_address(section->vma + i, stdout);
+ printf(" ");
- i += print(section->vma + i,
- data + i,
- stdout);
- putchar ('\n') ;
+ i += print(section->vma + i,
+ data + i,
+ stdout);
+ putchar ('\n') ;
+ }
}
-
free(data);
}
}