mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 05:52:21 +08:00
provide a new interface (using read_memory_func) to call the disassemblers
which copes with errors in a plausible way
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
Wed Mar 31 10:25:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* objdump.c (disassemble_data): Use new read_memory_func stuff.
|
||||
|
||||
Thu Mar 25 10:38:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
|
||||
|
||||
* objdump.c (fprintf): Declaration of variadic function had better
|
||||
|
@ -440,8 +440,12 @@ disassemble_data (abfd)
|
||||
|
||||
bfd_get_section_contents (abfd, section, data, 0, bfd_get_section_size_before_reloc (section));
|
||||
|
||||
disasm_info.buffer = data;
|
||||
disasm_info.buffer_vma = section->vma;
|
||||
disasm_info.buffer_length =
|
||||
bfd_get_section_size_before_reloc (section);
|
||||
i = 0;
|
||||
while (i < bfd_get_section_size_before_reloc (section))
|
||||
while (i < disasm_info.buffer_length)
|
||||
{
|
||||
if (data[i] == 0 && data[i + 1] == 0 && data[i + 2] == 0 &&
|
||||
data[i + 3] == 0)
|
||||
@ -489,9 +493,13 @@ disassemble_data (abfd)
|
||||
printf (" ");
|
||||
|
||||
if (disassemble) /* New style */
|
||||
i += (*disassemble)(section->vma + i,
|
||||
data + i,
|
||||
&disasm_info);
|
||||
{
|
||||
int bytes = (*disassemble)(section->vma + i,
|
||||
&disasm_info);
|
||||
if (bytes < 0)
|
||||
break;
|
||||
i += bytes;
|
||||
}
|
||||
else /* Old style */
|
||||
i += print (section->vma + i,
|
||||
data + i,
|
||||
|
Reference in New Issue
Block a user