From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 464 invoked by alias); 19 Apr 2006 08:15:22 -0000 Received: (qmail 454 invoked by uid 22791); 19 Apr 2006 08:15:20 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Apr 2006 08:15:19 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-206-41.inter.net.il [80.230.206.41]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id DZT57866 (AUTH halo1); Wed, 19 Apr 2006 11:15:14 +0300 (IDT) Date: Wed, 19 Apr 2006 08:15:00 -0000 Message-Id: From: Eli Zaretskii To: Randolph Chung CC: gdb-patches@sources.redhat.com In-reply-to: <44458D3D.4030506@tausq.org> (message from Randolph Chung on Wed, 19 Apr 2006 09:07:09 +0800) Subject: Re: [rfa] Shared object matching for solib-som.c Reply-to: Eli Zaretskii References: <44458D3D.4030506@tausq.org> X-IsSubscribed: yes 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-04/txt/msg00255.txt.bz2 > Date: Wed, 19 Apr 2006 09:07:09 +0800 > From: Randolph Chung > > @@ -787,7 +794,21 @@ som_solib_section_offsets (struct objfil > { > /* Oh what a pain! We need the offsets before so_list->objfile > is valid. The BFDs will never match. Make a best guess. */ > - if (strstr (objfile->name, so_list->so_name)) > + char *p1, *p2; > + > + p1 = strrchr(objfile->name, '/'); > + p2 = strrchr(so_list->so_name, '/'); > + > + if (p1) > + p1++; > + else > + p1 = objfile->name; > + if (p2) > + p2++; > + else > + p2 = so_list->so_name; > + > + if (strcmp (p1, p2) == 0) > { > asection *private_section; Please don't use literal slash characters in GDB sources: they are non-portable. AFAICS, you simply need to use lbasename here, on both file names.