From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8475 invoked by alias); 21 Jun 2013 17:25:20 -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 8162 invoked by uid 89); 21 Jun 2013 17:25:14 -0000 X-Spam-SWARE-Status: No, score=-6.8 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; Fri, 21 Jun 2013 17:25:13 +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 r5LHPCMG003448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Jun 2013 13:25:12 -0400 Received: from barimba.redhat.com (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5LHPBSq021447 for ; Fri, 21 Jun 2013 13:25:11 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 00/16] clean up remote.c state Date: Fri, 21 Jun 2013 17:25:00 -0000 Message-Id: <1371835506-15691-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-06/txt/msg00606.txt.bz2 I was toying with David Taylor's idea of multi-target support, and I came up with this preliminary series to do some cleanups of remote.c. Most of this cleanup amounts to moving various global variables into struct remote_state. I did each variable (or in some cases, a few clearly related variables) as a separate patch, to make the series maximally understandable. Each patch can essentially be read (though not applied) in isolation. I found the globals using nm. Then I went through them by hand to find ones that clearly must be global. This patch does not fix all the globals in remote.c. It is just a start. For example: * I suspect the remote_g_packet_data stuff must be per-remote * remote_protocol_packets has some per-remote state * I think the client-stop notification code needs some update * Maybe signal handling needs some fixing up, but what else is new After this series goes in, I propose that all future remote.c changes be reviewed to ensure that remote state is in remote_state and not a new global variable. This series also does a couple of other minor cleanups to remote.c. It removes the gdb-specific CRC code in favor of libiberty's; and it fixes an oddity I noticed with sizeof_pkg. I built and regression tested this series on x86-64 Fedora 18 using the native-gdbserver target board. Tom