This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] target debug: Improve printing of flags
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: <markus dot t dot metzger at intel dot com>
- Date: Thu, 1 Mar 2018 14:00:37 -0500
- Subject: Re: [PATCH] target debug: Improve printing of flags
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <1519923851-25998-1-git-send-email-simon.marchi@ericsson.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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...".