From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22910 invoked by alias); 9 Jun 2009 16:10:43 -0000 Received: (qmail 22901 invoked by uid 22791); 9 Jun 2009 16:10:41 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Jun 2009 16:10:30 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ME3u2-0003N5-Jl for gdb@sources.redhat.com; Tue, 09 Jun 2009 16:10:22 +0000 Received: from 132.207.220.31 ([132.207.220.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jun 2009 16:10:22 +0000 Received: from aristovski by 132.207.220.31 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Jun 2009 16:10:22 +0000 To: gdb@sources.redhat.com From: Aleksandar Ristovski Subject: Re: corelow and threads question Date: Tue, 09 Jun 2009 16:10:00 -0000 Message-ID: References: <200906052025.10264.pedro@codesourcery.com> <200906060127.57034.pedro@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <200906060127.57034.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/msg00077.txt.bz2 Hello Pedro, Thanks for your comments. Pedro Alves wrote: > On Friday 05 June 2009 20:40:23, Aleksandar Ristovski wrote: > >> +static LONGEST >> +nto_core_xfer_partial (struct target_ops *ops, enum target_object object, >> + const char *annex, gdb_byte *readbuf, >> + const gdb_byte *writebuf, ULONGEST offset, LONGEST len) >> +{ >> + if (object == TARGET_OBJECT_AUXV >> + && readbuf) >> + { ... > > You don't really need this. Fix bfd/elf.c to grok the note, and export > a .auxv section, just like corelow.c expects, and other archs do. I agree, however, my problem is, we do not really dump auxv in a note, I have to retrieve auxv from initial stack; I only read status from the note (and from status initial stack), then have to read target memory to fetch auxv. > >> + core_ops->to_extra_thread_info = nto_target_extra_thread_info; > > Looks like one of two things would be possible here: > - a gdbarch callback so that cores can customize this, move the > needed code into a nto-tdep.c file, and register the callback. > - come up with new fake bfd sections like e.g., ".thrextrainfo/TID" > (named similarly to to .reg/TID), whose contents would simply be the > string GDB should display, in target_extra_thread_info. Implement support > for that in bfd and corelow.c. The main purpose of fetching extra thread info is to fetch thread statuses. > >> + core_ops->to_xfer_partial = nto_core_xfer_partial; > > This isn't needed, as explained. > >> + core_ops->to_pid_to_str = nto_pid_to_str; > > There's already a gdbarch callback for this. Ok, thanks. > >> + core_ops->to_find_new_threads = nto_find_new_threads_in_core; > > Then you'd not have a need for this. Do any extra needed processing > lazilly in to_extra_thread_info if you must. > But I do not have my to_extra_thread_info active? I think this is going back to my initial question (pardon my ignorance): how do I "install" my to_extra_thread_info? I don't see a clean way of pushing my core_ops on top of default ones (and I thought that would be a clean way). I think letting architecture push its customization on top of default provided _ops would be very useful. In the core_ops example, maybe we could have arch. callback for that, and have the callback be called from core_open just after core_open pushes core_ops? That would definitely solve all the problems I have in a generic way. Thanks, -- Aleksandar Ristovski QNX Software Systems