[PATCH] gdb/disassembly: Update to handle non-statement addresses

Simon Marchi simark@simark.ca
Wed Jul 22 20:30:59 GMT 2020


On 2020-07-22 1:56 p.m., Andrew Burgess wrote:
> 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 'disassembly /m' output, lines that previously

disassembly -> disassemble

> were only in the line table as non-statement lines will now appear in
> the disassembly output.  This feels like an improvement though.

disassemble's /m switch is considered deprecated, because it's useless
(it shows the assembly in source line order).  The /s switch is the
"newer" one.  So I'd recommend testing with the /s switch, if not with
both switches.

I haven't looked at the patch itself and won't have time before next week.
But I see that Pedro looked at it already, so I can assume it's fine :).

Simon


More information about the Gdb-patches mailing list