From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113126 invoked by alias); 23 May 2018 04:59:02 -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 113098 invoked by uid 89); 23 May 2018 04:59:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=readers, exhaustive, attempted, hacks X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.185.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 May 2018 04:58:59 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 4108A400DE837 for ; Tue, 22 May 2018 23:58:58 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id LLrWfGDI0bXuJLLrWfXsSq; Tue, 22 May 2018 23:58:58 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:56108 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fLLrW-003S5D-0P for gdb-patches@sourceware.org; Tue, 22 May 2018 23:58:58 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [RFA 00/42] Remove globals from buildsym Date: Wed, 23 May 2018 04:59:00 -0000 Message-Id: <20180523045851.11660-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fLLrW-003S5D-0P X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya.Home) [174.29.44.154]:56108 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-05/txt/msg00574.txt.bz2 I've long wanted to remove the globals from buildsym and generally clean it up. I've finally tackled this project, and this series is the result. I'm afraid it is a bit on the long side. However, I tried to make each patch relativey small. Most of them should be easy to review -- and a few are trivial. Also, I simultaneously wrote this series and learned about some the workings of buildsym. So, there are some cases where something is done -- say, an assertion added or a variable made static -- only to be un-done later in the series. Reordering seemed generally painful so I have left it as is. The general idea behind the patches is to move each global variable (or related set of global variables) into the existing buildsym_compunit structure. Along the way, some minor cleanups are done, for example moving stabs-specific things to stabsread. Once all of the state is in buildsym_compunit, it is put into buildsym.h for use by symbol readers. Here, I've converted the DWARF reader to use the new-style API, leaving the other readers alone. (The other readers continue to rely on a global, but now only one.) I haven't tried much to clean up buildsym itself. The API is just as unwieldy as ever -- it just no longer has global state. I have, however, replaced some data structures with self-managing ones. There are some holes with the series that you may wish to consider. * Perhaps some more comments could be added. * There are still some stabs-specific hacks in buildsym.c that I have not attempted to remove. * There are some remaining calls to set_last_source_file (NULL) that could perhaps be removed as unnecessary. I did not check. Regression tested by the buildbot. I also did a reasonable, but not exhaustive, amount of testing here. I've at least smoke-tested the stabs reader by running some tests with --target_board=stabs. Tom