From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95682 invoked by alias); 21 Nov 2017 16:11:05 -0000 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 Received: (qmail 95648 invoked by uid 89); 21 Nov 2017 16:11:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=BAYES_00,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Nov 2017 16:11:04 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F003880C0B; Tue, 21 Nov 2017 16:11:02 +0000 (UTC) Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 224E16C412; Tue, 21 Nov 2017 16:11:01 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org, Joel Brobecker Subject: [PATCH 0/2] Fix a couple gdb.ada/minsyms.exp problems Date: Tue, 21 Nov 2017 16:11:00 -0000 Message-Id: <1511280661-14725-1-git-send-email-palves@redhat.com> X-SW-Source: 2017-11/txt/msg00436.txt.bz2 Hi Joel, all, The new gdb.ada/minsyms.exp testcase fails for me like this: FAIL: gdb.ada/minsyms.exp: print integer(some_minsym) FAIL: gdb.ada/minsyms.exp: print &some_minsym FAIL: gdb.ada/minsyms.exp: print /x integer(&some_minsym) There are two problems here. One's obvious: the testcase hardcodes an expected address for the "some_minsym" variable, which obviously can't work everywhere. The other problem is that if you have debug info for glibc, GDB loses track of the fact that the program is a Ada program, and switches the current language to C, where Ada's cast syntax doesn't work: print integer(some_minsym) A syntax error in expression, near `some_minsym)'. (gdb) FAIL: gdb.ada/minsyms.exp: print integer(some_minsym) print &some_minsym I first thought of doing "set language ada" in the testcase, but looking deeper, I realized that before running to main, GDB knows the program is Ada, and is losing that when handling a shared library event. That looks like a GDB bug, so I'm proposing fixing GDB instead. WDYT? Pedro Alves (2): gdb.ada/minsyms.exp: Don't hardcode the variable's address Don't lose language determined from the "main" name (fix gdb.ada/minsyms.exp) gdb/solib-svr4.c | 15 +++++++++++++++ gdb/testsuite/gdb.ada/minsyms.exp | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) -- 2.5.5