diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/objdump.c | 30 |
2 files changed, 24 insertions, 12 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 333ad86..d9f0899 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-09-30 Alan Modra <amodra@gmail.com> + + PR 21978 + * objdump.c: Formatting. + (show_line): Reset prev_line when function name changes. + 2017-09-27 Nick Clifton <nickc@redhat.com> PR 22219 diff --git a/binutils/objdump.c b/binutils/objdump.c index 3c5defa..3b2c7a3 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1484,8 +1484,8 @@ show_line (bfd *abfd, asection *section, bfd_vma addr_offset) return; if (! bfd_find_nearest_line_discriminator (abfd, section, syms, addr_offset, - &filename, &functionname, - &linenumber, &discriminator)) + &filename, &functionname, + &linenumber, &discriminator)) return; if (filename != NULL && *filename == '\0') @@ -1537,16 +1537,22 @@ show_line (bfd *abfd, asection *section, bfd_vma addr_offset) if (functionname != NULL && (prev_functionname == NULL || strcmp (functionname, prev_functionname) != 0)) - printf ("%s():\n", functionname); - if (linenumber > 0 && (linenumber != prev_line || - (discriminator != prev_discriminator))) - { - if (discriminator > 0) - printf ("%s:%u (discriminator %u)\n", filename == NULL ? "???" : filename, - linenumber, discriminator); - else - printf ("%s:%u\n", filename == NULL ? "???" : filename, linenumber); - } + { + printf ("%s():\n", functionname); + prev_line = -1; + } + if (linenumber > 0 + && (linenumber != prev_line + || discriminator != prev_discriminator)) + { + if (discriminator > 0) + printf ("%s:%u (discriminator %u)\n", + filename == NULL ? "???" : filename, + linenumber, discriminator); + else + printf ("%s:%u\n", filename == NULL ? "???" : filename, + linenumber); + } if (unwind_inlines) { const char *filename2; |