From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29072 invoked by alias); 24 Oct 2012 18:18:10 -0000 Received: (qmail 29064 invoked by uid 22791); 24 Oct 2012 18:18:09 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Oct 2012 18:18:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B7D5C1C75F5; Wed, 24 Oct 2012 14:18:03 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id t3Dvk0Bt3+JK; Wed, 24 Oct 2012 14:18:03 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9662F1C7579; Wed, 24 Oct 2012 14:18:03 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 3CF8FC88A1; Wed, 24 Oct 2012 14:18:01 -0400 (EDT) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [commit/Ada] use lbasename when testing if file is part of Ada runtime. Date: Wed, 24 Oct 2012 18:18:00 -0000 Message-Id: <1351102680-24854-1-git-send-email-brobecker@adacore.com> 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: 2012-10/txt/msg00473.txt.bz2 We use a list of regular expressions to match a symtab filenames against the names of the files in the Ada runtime. These regular expressions do assume that the filename is a basename, however. So make sure to evaluate these regular expressions against the symtab's filename. Without this patch, we run into problems when the Ada runtime was built using a project file (through gprbuild). gdb/ChangeLog: * ada-lang.c (is_known_support_routine): Use lbasename when matching the symtab's filename against known_runtime_file_name_patterns. Tested on x86_64-linux. Checked in. --- gdb/ChangeLog | 6 ++++++ gdb/ada-lang.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 55ad4d9..a4dd74e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2012-10-24 Joel Brobecker + * ada-lang.c (is_known_support_routine): Use lbasename when + matching the symtab's filename against + known_runtime_file_name_patterns. + +2012-10-24 Joel Brobecker + * ada-lang.c (ada_same_array_size_p): New function. (ada_promote_array_of_integrals): New function. (coerce_for_assign): Add handling of arrays where the elements diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index edef6bd..2dde814 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10973,7 +10973,7 @@ is_known_support_routine (struct frame_info *frame) for (i = 0; known_runtime_file_name_patterns[i] != NULL; i += 1) { re_comp (known_runtime_file_name_patterns[i]); - if (re_exec (sal.symtab->filename)) + if (re_exec (lbasename (sal.symtab->filename))) return 1; if (sal.symtab->objfile != NULL && re_exec (sal.symtab->objfile->name)) -- 1.7.9.5