From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Hui Zhu <teawater@gmail.com>
Subject: [RFA] Fix off-by-one error in record.c (record_list_release_first)
Date: Mon, 12 Oct 2009 16:39:00 -0000 [thread overview]
Message-ID: <4AD35AB6.2050903@vmware.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
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
[-- Attachment #2: insn_num.txt --]
[-- Type: text/plain, Size: 570 bytes --]
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. */
next reply other threads:[~2009-10-12 16:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 16:39 Michael Snyder [this message]
2009-10-13 2:17 ` Jiang Jilin
2009-10-13 6:46 ` Hui Zhu
2009-10-13 8:28 ` Jiang Jilin
2009-10-13 18:06 ` Michael Snyder
2009-10-15 3:18 ` Hui Zhu
2009-10-15 16:53 ` Michael Snyder
2009-10-13 17:25 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AD35AB6.2050903@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
--cc=teawater@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox