From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8181 invoked by alias); 9 May 2013 18:47:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8171 invoked by uid 89); 9 May 2013 18:47:10 -0000 X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 09 May 2013 18:47:10 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r49Il82q003867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 May 2013 14:47:08 -0400 Received: from barimba (ovpn-113-133.phx2.redhat.com [10.3.113.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r49Il6xn017017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 9 May 2013 14:47:07 -0400 From: Tom Tromey From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 00/40] add cleanup checker and fix cleanup bugs Message-Id: Date: Thu, 09 May 2013 18:47:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-05/txt/msg00315.txt.bz2 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-checke= r. 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=20 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 =E2=80=98do_mixed_source_and_assembl= y=E2=80=99: ../../archer/gdb/disasm.c:334:16: error: destructor call with unknown argum= ent [-fpermissive] ../../archer/gdb/disasm.c:335:16: error: destructor call with unknown argum= ent [-fpermissive] ../../archer/gdb/disasm.c:344:1: error: cleanup stack is not empty at retur= n [-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 argum= ent [-fpermissive] ../../archer/gdb/disasm.c:335:16: error: destructor call with unknown argum= ent [-fpermissive] infrun.c bugs, reported to bugzilla: ../../archer/gdb/infrun.c: In function =E2=80=98normal_stop=E2=80=99: ../../archer/gdb/infrun.c:6171:1: error: cleanup stack is not empty at retu= rn [-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 =E2=80=98keep_going=E2=80=99: ../../archer/gdb/infrun.c:5728:8: error: cleanup stack is not empty at retu= rn [-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 =E2=80=98record_full_wait_1=E2= =80=99: ../../archer/gdb/record-full.c:1492:1: error: cleanup stack is not empty at= return [-fpermissive] Likewise: ../../archer/gdb/record-btrace.c: In function =E2=80=98record_btrace_insn_h= istory=E2=80=99: ../../archer/gdb/record-btrace.c:336:1: error: cleanup stack is not empty a= t return [-fpermissive] ../../archer/gdb/record-btrace.c:274:17: note: leaked cleanup ../../archer/gdb/record-btrace.c: In function =E2=80=98record_btrace_call_h= istory=E2=80=99: ../../archer/gdb/record-btrace.c:565:1: error: cleanup stack is not empty a= t return [-fpermissive] ../../archer/gdb/record-btrace.c:503:17: note: leaked cleanup