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

Pedro Alves pedro@palves.net
Wed Jul 22 19:19:03 GMT 2020


On 7/22/20 6:56 PM, Andrew Burgess wrote:
> +# Create an example function that contains address marked as both
> +# statements and non-statements then disassemble the function.

"address" -> "addresses" ?

BTW, this reads to me as the same address being marked as
statement and non-statement, which sounds impossible.

I would suggest:

 # Create an example function that contains both addresses marked
 # as statements and addresses marked as non-statements, and then
 # disassemble the function.

> +	compile_unit {
> +	    {producer "gcc" }
> +	    {language @DW_LANG_C}
> +	    {name ${srcfile3}}
> +	    {low_pc 0 addr}
> +	    {stmt_list ${lines_label} DW_FORM_sec_offset}
> +	} {
> +	    subprogram {
> +		{external 1 flag}
> +		{name main}
> +		{low_pc $main_start addr}
> +		{high_pc "$main_start + $main_len" addr}

I wonder whether this could use MACRO_AT_func ?

> +set build_options {nodebug optimize=-O1}

OOC, why does the testcase need -O1 ?

Otherwise this LGTM.

Thanks for writing the testcase -- it obviously took a lot more
work to write it than the GDB fix itself.

Pedro Alves


More information about the Gdb-patches mailing list