aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-06-25 12:38:59 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-25 12:40:10 +0200
commitf076f0349cb958b451872ce4a7987821533c2f49 (patch)
treeffa2e335184c0704fc23b9ef391bde749d09b285
parentd7e2ebe7e73105766a854f4f0e3a5c509fd0e82a (diff)
downloadgdb-f076f0349cb958b451872ce4a7987821533c2f49.zip
gdb-f076f0349cb958b451872ce4a7987821533c2f49.tar.gz
gdb-f076f0349cb958b451872ce4a7987821533c2f49.tar.bz2
x86-dregs: Print debug registers one per line
This get around this warning given by clang... /home/emaisin/src/binutils-gdb/gdb/nat/x86-dregs.c:209:7: error: variable 'i' is incremented both in the loop header and in the loop body [-Werror,-Wfor-loop-analysis] i++; ^ /home/emaisin/src/binutils-gdb/gdb/nat/x86-dregs.c:199:32: note: incremented here ALL_DEBUG_ADDRESS_REGISTERS (i) ^ ... I decided in the end to simply print the debug registers one per line. I don't think it particularly helps readability to have them two per line anyway. gdb/ChangeLog: * nat/x86-dregs.c (x86_show_dr): Print registers one per line.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/nat/x86-dregs.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bbbd5fb..7914b1d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-06-25 Simon Marchi <simon.marchi@ericsson.com>
+
+ * nat/x86-dregs.c (x86_show_dr): Print registers one per line.
+
2017-06-23 Alan Hayward <alan.hayward@arm.com>
* xtensa-tdep.c (XTENSA_MAX_REGISTER_SIZE): Add.
diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c
index 8c8adfa..478aa91 100644
--- a/gdb/nat/x86-dregs.c
+++ b/gdb/nat/x86-dregs.c
@@ -193,20 +193,16 @@ x86_show_dr (struct x86_debug_reg_state *state,
here. */
: "??unknown??"))));
debug_printf (":\n");
- debug_printf ("\tCONTROL (DR7): %s STATUS (DR6): %s\n",
- phex (state->dr_control_mirror, 8),
- phex (state->dr_status_mirror, 8));
+
+ debug_printf ("\tCONTROL (DR7): 0x%s\n", phex (state->dr_control_mirror, 8));
+ debug_printf ("\tSTATUS (DR6): 0x%s\n", phex (state->dr_status_mirror, 8));
+
ALL_DEBUG_ADDRESS_REGISTERS (i)
{
- debug_printf ("\
-\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
+ debug_printf ("\tDR%d: addr=0x%s, ref.count=%d\n",
i, phex (state->dr_mirror[i],
x86_get_debug_register_length ()),
- state->dr_ref_count[i],
- i + 1, phex (state->dr_mirror[i + 1],
- x86_get_debug_register_length ()),
- state->dr_ref_count[i + 1]);
- i++;
+ state->dr_ref_count[i]);
}
}