From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12290 invoked by alias); 3 Dec 2004 17:44:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12135 invoked from network); 3 Dec 2004 17:43:59 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 3 Dec 2004 17:43:59 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id iB3HhvS0017505; Fri, 3 Dec 2004 18:43:57 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id iB3Hhvol020664; Fri, 3 Dec 2004 18:43:57 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id iB3Hhr2Y020661; Fri, 3 Dec 2004 18:43:53 +0100 (CET) Date: Fri, 03 Dec 2004 17:44:00 -0000 Message-Id: <200412031743.iB3Hhr2Y020661@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: kewarken@qnx.com CC: gdb-patches@sources.redhat.com In-reply-to: <41B0988D.3030005@qnx.com> (message from Kris Warkentin on Fri, 03 Dec 2004 11:47:09 -0500) Subject: Re: Ping: [patch] general updates and improvements to QNX NTO support References: <419E5B3C.3020209@qnx.com> <41A794A8.9090008@qnx.com> <41B0905D.7070408@qnx.com> <200412031617.iB3GHFN3020509@elgar.sibelius.xs4all.nl> <41B0988D.3030005@qnx.com> X-SW-Source: 2004-12/txt/msg00067.txt.bz2 Date: Fri, 03 Dec 2004 11:47:09 -0500 From: Kris Warkentin Hmm....I think the diff hard to read. I haven't gotten rid of struct nto_target_ops in nto-tdep.h. All I did is move the comments into the definition of the structure from outside with the defines. Ah, OK. Sorry, I misread that. I also changed the macro defines so that I can assign and test. ie. old: define nto_regset_fill(regset, data) (*current_nto_target.nto_regset_fill) (regset, data) new: #define nto_regset_fill (current_nto_target.nto_regset_fill) That way I can easily switch targets in code. Hmm. In that case wouldn't it be better to turn current_nto_target into a pointer, and having a `struct nto_target_ops' for each target such that you can switch targets by simply doing a pointer assignment? That would probably get rid of all the macros. I am defining current_nto_target in nto-tdep.h as being extern but I don't declare it there. Is having a global verboten? I has assumed it was okay since we have many precedents like inferior_ptid and current_target and such. Declaring variables as `extern' in a header file is fine, although you should avoid globals if as much as possible. Mark