[PATCH] target debug: Improve printing of flags

Simon Marchi simon.marchi@ericsson.com
Thu Mar 1 19:01:00 GMT 2018


On 2018-03-01 12:04 PM, Simon Marchi wrote:
> Currently, the target debug code prints flags as decimal integers:
> 
>   <- record-btrace->to_call_history (0x240d420, 10, 7)
>   <- record-btrace->to_insn_history (0x240d420, 10, 62)
>                                           flags ----^
> 
> This patch improves that to print an OR expression of the flags:
> 
>   <- record-btrace->to_call_history (0x240e420, 10, RECORD_PRINT_SRC_LINE | RECORD_PRINT_INSN_RANGE | RECORD_PRINT_INDENT_CALLS)
>   <- record-btrace->to_insn_history (0x240e420, 10, DISASSEMBLY_RAW_INSN | DISASSEMBLY_OMIT_FNAME | DISASSEMBLY_FILENAME | DISASSEMBLY_OMIT_PC | DISASSEMBLY_SOURCE)
> 
> Since the list of possible flags is hand-written in the debug functions,
> it is possible that we forget to add one there when we add a new flag.
> In that case, it will be printed in hex (RECORD_PRINT_SRC_LINE | 0x8),
> so we forgot to consider a possible flag here.

Arg, this last sentence should have been "so it will show that we forgot...".



More information about the Gdb-patches mailing list