record-full.c: Remove always true checks.
authorPedro Alves <palves@redhat.com>
Tue, 26 Mar 2013 20:01:03 +0000 (20:01 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 26 Mar 2013 20:01:03 +0000 (20:01 +0000)
commit7ee70bf5188928a40508628887cfc1ac47d67285
treea76f4d118e10a6b19473a16876b09ec89cb10804
parentdfd1f9bbf2dbc10d0b432e060af0141ab24aafd4
record-full.c: Remove always true checks.

The "set record full insn-number-max" command is an uinteger command.
If the variable that holds the maximum count of logged instructions is
unsigned, it's better if the variable that holds the current number of
logged instructions is also unsigned.  Looking over the code, there's
no case the variable could end up negative.

Then, tests like "if (record_full_insn_max_num)" are always true,
because being a uinteger command means that "set record full
insn-number-max 0" is actually mapped to UINT_MAX internally.  IOW,
the command's variable is never 0.  The checks might make some sense
if 0 wasn't mapped to UINT_MAX, and 0 meant unlimited, but, that's not
how things work.

Tested on x86_64 Fedora 17.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* record-full.c (record_full_insn_num): Make it unsigned.
(record_full_check_insn_num, record_full_message)
(record_full_registers_change, record_full_xfer_partial): Remove
record_full_insn_max_num check (it's always != 0).
(record_full_info, record_full_restore): Use %u as format string.
(): Use %u as format string.
(set_record_full_insn_max_num): Remove record_full_insn_max_num
check (it's always != 0).
gdb/ChangeLog
gdb/record-full.c