gdb/disassembly: Update to handle non-statement addresses
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 21 Jul 2020 10:21:50 +0000 (11:21 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 23 Jul 2020 10:16:50 +0000 (11:16 +0100)
commit78344df7b5d7d7fcf6aa7945b8c4b56bcc9388ce
tree08db40497223153f12e24b7cc0a64a63bebb378c
parent25dfed247b09f2e5c9672a8737c8208ff90928bf
gdb/disassembly: Update to handle non-statement addresses

After the introduction of support for non-statement addresses in the
line table, the output for 'disassemble /m' can be broken in some
cases.

With the /m format disassembly GDB associates a set of addresses with
each line, these addresses are then sorted and printed for each line.

When the non-statement support was added GDB was incorrectly told to
ignore non-statement instructions, and not add these to the result
table.  This means that these instructions are completely missing from
the output.

This commit removes the code that caused non-statement lines to be
ignored.

A result of this change is that GDB will now potentially include new
line numbers in the 'disassemble /m' output, lines that previously
were only in the line table as non-statement lines will now appear in
the disassembly output.  This feels like an improvement though.

gdb/ChangeLog:

* disasm.c (do_mixed_source_and_assembly_deprecated): Don't
exclude non-statement entries.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-disasm-over-non-stmt.exp: New file.
gdb/ChangeLog
gdb/disasm.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp [new file with mode: 0644]