From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7089 invoked by alias); 17 Feb 2009 13:10:32 -0000 Received: (qmail 7081 invoked by uid 22791); 17 Feb 2009 13:10:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Feb 2009 13:10:24 +0000 Received: (qmail 23130 invoked from network); 17 Feb 2009 13:10:22 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Feb 2009 13:10:22 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: Modernize solaris threads support. Date: Tue, 17 Feb 2009 13:30:00 -0000 User-Agent: KMail/1.9.10 References: <200902160549.49108.pedro@codesourcery.com> <200902162050.49191.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902171310.24234.pedro@codesourcery.com> 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: 2009-02/txt/msg00347.txt.bz2 On Tuesday 17 February 2009 03:56:57, Eli Zaretskii wrote: > > From: Pedro Alves > > Date: Mon, 16 Feb 2009 20:50:48 +0000 > > > > What are thinking you would have to do yourself? > > Adjust the prototypes. > You don't have to adjust anything yourself. I've done that already. Otherwise, I wouldn't have gone through the trouble of touching go32-nat.c at all, would I? --- that's the whole point of that hunk. I'm thinking there's some miscomunication going on. Let's step back a bit. On Monday 16 February 2009 19:09:57, Eli Zaretskii wrote: > > -static void go32_resume (ptid_t ptid, int step, > > - enum target_signal siggnal); > > -static void go32_fetch_registers (struct regcache *, int regno); > > static void store_register (const struct regcache *, int regno); > > -static void go32_store_registers (struct regcache *, int regno); > > Why did you need to remove these prototypes while at that? > Let's call things by their proper names. The prototypes of these target_ops callbacks have changed --- I've added a new argument. While adjusting the go32 target, I found that I had to adjust these declarations, in addition to their corresponding function definitions. But then, I noticed that these declarations aren't really needed, since the go32_resume, go32_fetch_registers and go32_store_registers functions have static linkage, and, are declared before their first usage, that is, way down in the go32-nat.c file, like so: static void init_go32_ops (void) { (...) go32_ops.to_resume = go32_resume; (...) go32_ops.to_fetch_registers = go32_fetch_registers; go32_ops.to_store_registers = go32_store_registers; (...) } This is what was in the patch touching go32-nat.c: >quilt diff go32-nat.c Index: src/gdb/go32-nat.c =================================================================== --- src.orig/gdb/go32-nat.c 2009-02-16 00:20:30.000000000 +0000 +++ src/gdb/go32-nat.c 2009-02-16 03:26:06.000000000 +0000 @@ -169,11 +169,7 @@ static void go32_open (char *name, int f static void go32_close (int quitting); static void go32_attach (char *args, int from_tty); static void go32_detach (char *args, int from_tty); -static void go32_resume (ptid_t ptid, int step, - enum target_signal siggnal); -static void go32_fetch_registers (struct regcache *, int regno); static void store_register (const struct regcache *, int regno); -static void go32_store_registers (struct regcache *, int regno); All these three declarations I was removing, ... static void go32_prepare_to_store (struct regcache *); static int go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, @@ -321,7 +317,8 @@ static int resume_is_step; static int resume_signal = -1; static void -go32_resume (ptid_t ptid, int step, enum target_signal siggnal) +go32_resume (struct target_ops *ops, + ptid_t ptid, int step, enum target_signal siggnal) { int i; ... I'm already adjusting here, ... @@ -478,7 +475,8 @@ fetch_register (struct regcache *regcach } static void -go32_fetch_registers (struct regcache *regcache, int regno) +go32_fetch_registers (struct target_ops *ops, + struct regcache *regcache, int regno) { ... and here, ... if (regno >= 0) fetch_register (regcache, regno); @@ -507,7 +505,8 @@ store_register (const struct regcache *r } static void -go32_store_registers (struct regcache *regcache, int regno) +go32_store_registers (struct target_ops *ops, + struct regcache *regcache, int regno) { ... and here, ... unsigned r; @@ -859,7 +858,7 @@ go32_terminal_ours (void) } static int -go32_thread_alive (ptid_t ptid) +go32_thread_alive (struct target_ops *ops, ptid_t ptid) { ... plus, this one didn't have a forward declaration, but, I've adjusted it nonetheless. return 1; } As you can see, you wouldn't have to do anything --- I've done all your work already. Did I miss something else? If you still want those declarations for some reason, I'll put them back. -- Pedro Alves