From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24842 invoked by alias); 15 Jan 2012 18:49:11 -0000 Received: (qmail 24834 invoked by uid 22791); 15 Jan 2012 18:49:10 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 Jan 2012 18:48:57 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0FImvnL032625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 15 Jan 2012 13:48:57 -0500 Received: from psique ([10.3.112.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0FImrJT015699 for ; Sun, 15 Jan 2012 13:48:55 -0500 From: Sergio Durigan Junior To: gdb-patches@sourceware.org Subject: [RFC 0/8] Beginning to remove globals from parser-defs.h X-URL: http://www.redhat.com Date: Sun, 15 Jan 2012 18:51:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2012-01/txt/msg00523.txt.bz2 Hello, I have been working on this during my weekends, and I would like to know what you guys think about this set of patches. While I was working on another patch, I started to dive into the current expression parsing mechanism, and it really bothered me all those globals. So, as a pet project, I decided to start removing them. Initially I tried to remove them all, and create a big structure which would hold the parsing state and be passed to parser-specific functions. Unfortunately, this task proved to be non-sense because of its size and increasing complexity, so I decided to tackle the problem using another way: baby steps, as Tom would say. These 8 patches basically contain adaptations on every .y file, as well as on the *-lang.h ones, and on parser-defs.h/parse.c files. The idea now is to make three fields non-global: `expout', `expout_size' and `expout_ptr'. There are still some (lots of?) other global variables there, which I didn't touch yet. Maybe some day I will have time/patience for that... I decided to split the patches because the whole diff file contains more than 7 thousand lines. However, I did not bother to make those patches compile independently! So if you want to test, you'll have to apply them all (order should not matter). I hope you like the result. It is still far from ideal, but I believe it is a good step towards this "non-globalization" thing. Comments, as usual, are welcome. The patch has been regtested on an x86_64 and i686 Fedora 15, without regressions. Thank you, Sergio. P.S.: I still haven't written the ChangeLog's, I wanted to know your opinion about it first.