From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23024 invoked by alias); 7 Jul 2009 16:45:39 -0000 Received: (qmail 23014 invoked by uid 22791); 7 Jul 2009 16:45:38 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jul 2009 16:45:31 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n67GjSG6013549 for ; Tue, 7 Jul 2009 16:45:28 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n67GjSEm2306098 for ; Tue, 7 Jul 2009 18:45:28 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n67GjS5G001427 for ; Tue, 7 Jul 2009 18:45:28 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n67GjR0X001418; Tue, 7 Jul 2009 18:45:27 +0200 Message-Id: <200907071645.n67GjR0X001418@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 07 Jul 2009 18:45:27 +0200 Subject: Re: [RFA] Check solib bfd arch To: teawater@gmail.com (Hui Zhu) Date: Tue, 07 Jul 2009 16:45:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml), msnyder@vmware.com (Michael Snyder) In-Reply-To: from "Hui Zhu" at Jul 06, 2009 11:03:47 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00203.txt.bz2 Hui Zhu wrote: > + /* Check bfd arch. */ > + b = gdbarch_bfd_arch_info (target_gdbarch); > + if (b->compatible (b, bfd_get_arch_info (abfd)) != b) > + { > + bfd_close (abfd); > + make_cleanup (xfree, found_pathname); > + error (_("`%s': ARCH not same with inferior."), found_pathname); > + } I'm not sure this should be an error; we allow debugging a main executable whose architecture does not match the target architecture (if the user knows what they're doing), so IMO we should allow this for shared libraries too. A *warning* would be more appropriate. Also, I think it would be good if the message mentioned the architecture in question, along the lines of: warning (_("`%s': Shared library architecture %s is not compatible " "with target architecture %s."), found_pathname, bfd_get_arch_info (abfd)->printable_name, b->printable_name); Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com