This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] target debug: Improve printing of flags


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...".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]