From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13015 invoked by alias); 28 Sep 2002 17:23:44 -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 13007 invoked from network); 28 Sep 2002 17:23:44 -0000 Received: from unknown (HELO gw-us1.philips.com) (63.114.235.94) by sources.redhat.com with SMTP; 28 Sep 2002 17:23:44 -0000 Received: from smtpscan-us2.philips.com (unknown [167.81.233.26]) by gw-us1.philips.com (Postfix) with ESMTP id C15EC3D4E3 for ; Sat, 28 Sep 2002 12:23:43 -0500 (CDT) Received: from smtprelay-us1.philips.com (localhost [127.0.0.1]) by smtpscan-us2.philips.com (8.9.3/8.8.5-1.2.2m-19990317) with ESMTP id MAA08899 for ; Sat, 28 Sep 2002 12:23:43 -0500 (CDT) Received: from smtphub.abq.sc.philips.com (smtphub.abq.sc.philips.com [130.140.3.9]) by smtprelay-us1.philips.com (8.9.3/8.8.5-1.2.2m-19990317) with ESMTP id MAA07385 for ; Sat, 28 Sep 2002 12:23:42 -0500 (CDT) Received: from atoae450.abq.sc.philips.com (atoae450.abq.sc.philips.com [130.140.5.8]) by smtphub.abq.sc.philips.com (8.8.5/8.8.5) with ESMTP id LAA24106 for ; Sat, 28 Sep 2002 11:25:01 -0600 (MDT) Received: from abqn42.abq.sc.philips.com (abqn42 [130.140.5.42]) by atoae450.abq.sc.philips.com (8.11.6+Sun/8.11.6) with SMTP id g8SHNep09485 for ; Sat, 28 Sep 2002 11:23:41 -0600 (MDT) Message-Id: <200209281723.g8SHNep09485@atoae450.abq.sc.philips.com> Date: Sat, 28 Sep 2002 10:23:00 -0000 From: Josh Martin Reply-To: Josh Martin Subject: [PATCH]: gdb/769 - segv fault on "info shared" on GDB 5.2.1 HPUX64 11.00 To: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: FyEKseXasGYgTIvCzX7kTg== X-SW-Source: 2002-09/txt/msg00702.txt.bz2 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. What follows is a diff -up patch for gdb-5.2.1/gdb/solib.c - Josh Martin --- solib.c~ Tue Feb 26 18:40:35 2002 +++ solib.c Sat Sep 28 08:43:03 2002 @@ -619,6 +619,19 @@ info_sharedlibrary_command (char *ignore int addr_width; char *addr_fmt; + /* + This is usually defined in a platform specific solib-foo.c/.h + file. Eventually the definition should be migrated to the + gdbarch files. In the mean time keep this from core dumping on + platforms where there is no implementation. + */ + if (current_target_so_ops == NULL) + { + printf_unfiltered("Shared library info is not yet implemented on this " + "platform\n"); + return; + } + if (TARGET_PTR_BIT == 32) { addr_width = 8 + 4;