This is the mail archive of the gdb-cvs@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]

src/gdb ChangeLog record-full.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-03-26 20:01:03

Modified files:
	gdb            : ChangeLog record-full.c 

Log message:
	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).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15318&r2=1.15319
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/record-full.c.diff?cvsroot=src&r1=1.5&r2=1.6


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