From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2743 invoked by alias); 1 Jul 2009 04:11:01 -0000 Received: (qmail 2727 invoked by uid 22791); 1 Jul 2009 04:10:59 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jul 2009 04:10:56 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A315753041; Tue, 30 Jun 2009 21:10:54 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id 9A35FCDA29; Tue, 30 Jun 2009 21:10:54 -0700 (PDT) Message-ID: <4A4AE147.5060800@vmware.com> Date: Wed, 01 Jul 2009 04:11:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Hui Zhu CC: "gdb@sourceware.org" Subject: Re: What about check the bfd_arch_info before load the solib? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-07/txt/msg00000.txt.bz2 Hui Zhu wrote: > Hi guys, > > In cross-compile remote debug environment, the gdb will load the solib > of local host if user doesn't set sysroot or something. > Load the wrong lib will make gdb get error. > > I think maybe we can add some check code to check if the bfd_arch_info > of this solib is same with the current_gdbarch before load this solib > in. > If not same, output a warning to let user set gdb to load right lib. > > What do you think about it? It would certainly be reasonable to reject an object file (eg. shlib) if it has the wrong architecture type. I'm surprised that we don't already do it.