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]

[RFA] Fix off-by-one error in record.c (record_list_release_first)


Hui,

My "info record" patch helped me to find a bug.
I found that, once we start calling record_list_release_first,
we start adding two instructions to the log for every one
instruction we remove.  Therefore the log continues to grow,
even though it is supposed to remain constant in size.

This is because record_insn_num is not incremented if we
call record_list_release_first -- but record_list_release_first
does decrement it.

A one line fix corrects this problem (attached).

Michael

2009-10-12  Michael Snyder  <msnyder@vmware.com>

	* record.c (record_list_release_first): Do not decrement
	record_insn_num.

Index: record.c
===================================================================
RCS file: /cvs/src/src/gdb/record.c,v
retrieving revision 1.20
diff -u -p -r1.20 record.c
--- record.c	27 Sep 2009 02:49:34 -0000	1.20
+++ record.c	12 Oct 2009 16:33:44 -0000
@@ -209,8 +211,6 @@ record_list_release_first (void)
       if (type == record_end)
 	break;
     }
-
-  record_insn_num--;
 }
 
 /* Add a struct record_entry to record_arch_list.  */

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