From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15557 invoked by alias); 6 Dec 2002 00:54:13 -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 15447 invoked from network); 6 Dec 2002 00:54:13 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 6 Dec 2002 00:54:13 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gB60T2P30173 for ; Thu, 5 Dec 2002 19:29:02 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB60sCD10679; Thu, 5 Dec 2002 19:54:12 -0500 Received: from localhost.localdomain (vpn50-49.rdu.redhat.com [172.16.50.49]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB60sB929603; Thu, 5 Dec 2002 19:54:11 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id gB60s5u17617; Thu, 5 Dec 2002 17:54:05 -0700 Date: Thu, 05 Dec 2002 16:56:00 -0000 From: Kevin Buettner Message-Id: <1021206005405.ZM17616@localhost.localdomain> In-Reply-To: Josh Martin "Re: [PATCH]: gdb/769 - segv fault on "info shared" on GDB 5.2.1 HPUX64 11.00" (Oct 9, 5:42pm) References: <200210092342.g99Ngrp05819@atoae450.abq.sc.philips.com> To: Josh Martin , gdb-patches@sources.redhat.com Subject: Re: [PATCH]: gdb/769 - segv fault on "info shared" on GDB 5.2.1 HPUX64 11.00 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-12/txt/msg00218.txt.bz2 On Oct 9, 5:42pm, Josh Martin wrote: > Here's the ChangeLog entry that I forgot to post. Unfortunately I cannot get > expect to work on my system, so I can neither create a test case for this bug, > nor verify other tests after this patch. > > - Josh Martin > > 2002-09-28 Josh Martin > > * solib.c (info_sharedlibrary_command): Added catch for potential > dereference of NULL pointer (current_target_so_ops). > Fix PR gdb/769. > > > For platforms that aren't covered by the gdb/solib-foo.c files and the gdbarch > > platform dependancy files the "info sharedlibrary" command will cause a > > segmentation fault by dereferencing a NULL pointer (current_target_so_ops) in > > gdb/solib.c:update_solib_list. The patch checks if current_target_so_ops is > > NULL, and if so it responds with a "command not implemented" message. > > > > What I really wanted to do was to implement support for HPUX 11.00 64-bit > w/GCC. > > It shouldn't be too difficult as 64-bit GCC in HPUX 11.00 uses GNU ld and the > > "standard" elf64hppa object format. Unfortunately I had no idea how to proceed > > or where to find the neccesary information, thus I stuck with this "band-aid" > > patch. I've been thinking about this patch some more. What I'm wondering is why your hpux target uses solib.o without defining an appropriate solib-hpux.c (or whatever) file? Anyway, with regard to catching potential dereferences to a NULL current_target_so_ops, I'm inclined to handle this either via a gdb_assert() or an explicit check (perhaps in the TARGET_SO_* macros) with a call to internal_error(). Because that's really what it is. We shouldn't be in solib.c at all if an appropriate backend hasn't been defined. Kevin