From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28170 invoked by alias); 26 Sep 2006 22:55:16 -0000 Received: (qmail 28160 invoked by uid 22791); 26 Sep 2006 22:55:15 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Sep 2006 22:55:12 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k8QMsu1Z018523; Wed, 27 Sep 2006 00:54:56 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.8/8.13.6) with ESMTP id k8QMsuJ4018221; Wed, 27 Sep 2006 00:54:56 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id k8QMstOG021914; Wed, 27 Sep 2006 00:54:55 +0200 (CEST) Date: Tue, 26 Sep 2006 22:55:00 -0000 Message-Id: <200609262254.k8QMstOG021914@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: gdb-patches@sourceware.org In-reply-to: <20060923131143.GA22212@host0.dyn.jankratochvil.net> (message from Jan Kratochvil on Sat, 23 Sep 2006 15:11:43 +0200) Subject: Re: [patch] Support gcore for i386 inferiors on amd64 References: <20060923131143.GA22212@host0.dyn.jankratochvil.net> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00189.txt.bz2 > Date: Sat, 23 Sep 2006 15:11:43 +0200 > From: Jan Kratochvil > > Hi, > > currently "gcore" command creates invalid core file for i386 > (32-bit) inferiors running on amd64 gdb/machine. > > bfd interface lacks the proper support so it is supplying its own > implementation of 32-bit target while running on 64-bit built bfd. > > Patch mostly created by Fujitsu. What's the copyright status of this diff? > Attached glibc patch for review for a possible push there. > Still the gdb patch fallbacks on its copy in the case of > legacy/current glibc. > 2006-09-23 Jan Kratochvil > Fujitsu > > * amd64-linux-nat.c: Support new to_elfcore_write_prpsinfo, > to_elfcore_write_prstatus, to_elfcore_write_prfpreg. > (i386_linux_gregset32_reg_offset): New mapping for i386 on amd64. > (amd64_linux_gcore_create_hook): New hook for modifying segment attrs. > * gcore.c (gcore_create_hook): Hook function variable. > (gcore_create_callback): Call (*gcore_create_hook). > * configure.ac: Check for sys/user32.h, sys/procfs32.h. > * configure, config.in: Regenerated. > * corelow.c (init_core_ops): Support new to_elfcore_write_prpsinfo, > to_elfcore_write_prstatus, to_elfcore_write_prfpreg. > * fbsd-nat.c (fbsd_make_corefile_notes): Virtualize elfcore_*. > * linux-nat.c (linux_nat_do_thread_registers): Likewise. > (linux_nat_make_corefile_notes): Likewise. > * procfs.c (procfs_do_thread_registers): Likewise. > (procfs_make_note_section): Likewise. > * target.c (update_current_target): Likewise. > * target.h (struct target_ops): Likewise. > * Makefile.in: Dependencies updated. I don't think the elfcore_write_xxx functions belong in the target vector. They're specific to one type of core file format that's shared by only three or four operating systems. And even then there's quite a bit of variation between systems. I think it is simpler to keep this Linux-specific (although Solaris probably needs something similar). There are a few other problems with the code too, but I will nag about that later. Mark