From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19495 invoked by alias); 5 Jun 2009 19:24:27 -0000 Received: (qmail 19485 invoked by uid 22791); 5 Jun 2009 19:24:27 -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; Fri, 05 Jun 2009 19:24:21 +0000 Received: (qmail 15413 invoked from network); 5 Jun 2009 19:24:19 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Jun 2009 19:24:19 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: corelow and threads question Date: Fri, 05 Jun 2009 19:24:00 -0000 User-Agent: KMail/1.9.10 Cc: Aleksandar Ristovski References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906052025.10264.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00054.txt.bz2 On Friday 05 June 2009 19:54:54, Aleksandar Ristovski wrote: > With corelow.c patched as proposed, on Neutrino I could do this: > > For NTO, I "hijack" core_ops: > static void > init_nto_core_ops () > { > struct target_ops *core_ops; > > core_ops = find_core_target (); > gdb_assert (core_ops && core_ops->to_shortname != NULL > && !!"core_ops must be initialized first!"); > original_core_ops = *core_ops; > core_ops->to_extra_thread_info = > nto_target_extra_thread_info; > core_ops->to_open = nto_core_open; > core_ops->to_xfer_partial = nto_core_xfer_partial; > core_ops->to_pid_to_str = nto_pid_to_str; > } As I mentioned in the other threads, this is fine as a local change, but not so to have in GDB proper, so it does go against your goal of pushing all your local changes. :-/ This is depending on the order of which the _initialize routines are called, hence the gdb_assert. I just cleaned up the only left over target that was doing a similar hack (sol-threads.c) a couple of months ago, to not do so. Again, it's hard to come up with a better alternative without knowing what you're doing in those overrides. Maybe what you need is a thread_stratum target sitting on top of nto-procfs.c or corelow.c. Maybe we need new gdbarch callbacks. -- Pedro Alves