This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 00/40] add cleanup checker and fix cleanup bugs
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:47:06 -0600
- Subject: [PATCH 00/40] add cleanup checker and fix cleanup bugs
This series adds a cleanup checker and then fixes most of the bugs it
notices.
The series as a whole was built and regression-tested on x86-64 Fedora
18. However, there are a couple of patches that I could not test;
e.g., the machoread.c patch. I would appreciate it if someone could
try these on their machine. The branch is archer.git tromey/cleanup-checker.
In most cases the patches are pretty obvious. I kept them short for
ease of reading.
The cleanup checker itself is described in patch #1. This patch also
describes some of the
After this series, there are still some cleanup-related bugs noticed
by the checker. One of these (in dwarf2read.c) is a false report --
the checker is not perfect and there was no nice workaround here.
The remaining errors are:
disasm.c has some spaghetti code; I didn't try to untangle it to see if
there is a bug here or not:
../../archer/gdb/disasm.c: In function âdo_mixed_source_and_assemblyâ:
../../archer/gdb/disasm.c:334:16: error: destructor call with unknown argument [-fpermissive]
../../archer/gdb/disasm.c:335:16: error: destructor call with unknown argument [-fpermissive]
../../archer/gdb/disasm.c:344:1: error: cleanup stack is not empty at return [-fpermissive]
../../archer/gdb/disasm.c:212:19: note: leaked cleanup
../../archer/gdb/disasm.c:211:19: note: leaked cleanup
../../archer/gdb/disasm.c:334:16: error: destructor call with unknown argument [-fpermissive]
../../archer/gdb/disasm.c:335:16: error: destructor call with unknown argument [-fpermissive]
infrun.c bugs, reported to bugzilla:
../../archer/gdb/infrun.c: In function ânormal_stopâ:
../../archer/gdb/infrun.c:6171:1: error: cleanup stack is not empty at return [-fpermissive]
../../archer/gdb/infrun.c:5930:18: note: leaked cleanup
../../archer/gdb/infrun.c:5921:19: note: leaked cleanup
../../archer/gdb/infrun.c: In function âkeep_goingâ:
../../archer/gdb/infrun.c:5728:8: error: cleanup stack is not empty at return [-fpermissive]
../../archer/gdb/infrun.c:5669:19: note: leaked cleanup
I wasn't sure what to do about this -- there are many return paths
here that don't deal with the cleanups:
../../archer/gdb/record-full.c: In function ârecord_full_wait_1â:
../../archer/gdb/record-full.c:1492:1: error: cleanup stack is not empty at return [-fpermissive]
Likewise:
../../archer/gdb/record-btrace.c: In function ârecord_btrace_insn_historyâ:
../../archer/gdb/record-btrace.c:336:1: error: cleanup stack is not empty at return [-fpermissive]
../../archer/gdb/record-btrace.c:274:17: note: leaked cleanup
../../archer/gdb/record-btrace.c: In function ârecord_btrace_call_historyâ:
../../archer/gdb/record-btrace.c:565:1: error: cleanup stack is not empty at return [-fpermissive]
../../archer/gdb/record-btrace.c:503:17: note: leaked cleanup