Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit/Ada] use lbasename when testing if file is part of Ada runtime.
@ 2012-10-24 18:18 Joel Brobecker
  2012-10-24 20:20 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2012-10-24 18:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

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  <brobecker@adacore.com>
 
+	* 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  <brobecker@adacore.com>
+
 	* 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit/Ada] use lbasename when testing if file is part of Ada runtime.
  2012-10-24 18:18 [commit/Ada] use lbasename when testing if file is part of Ada runtime Joel Brobecker
@ 2012-10-24 20:20 ` Tom Tromey
  2012-10-24 20:24   ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-10-24 20:20 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> We use a list of regular expressions to match a symtab filenames
Joel> against the names of the files in the Ada runtime.  These regular
Joel> expressions do assume that the filename is a basename, however.
Joel> So make sure to evaluate these regular expressions against
Joel> the symtab's filename.

I see some that are absolute, e.g.:

   "/usr/shlib/libpthread\\.so",

Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit/Ada] use lbasename when testing if file is part of Ada runtime.
  2012-10-24 20:20 ` Tom Tromey
@ 2012-10-24 20:24   ` Joel Brobecker
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Brobecker @ 2012-10-24 20:24 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> I see some that are absolute, e.g.:
> 
>    "/usr/shlib/libpthread\\.so",

Ooops! Thanks for pointing this out.  Suprisingly, we haven't had
any issue with this since we installed the change a while ago.

I need to clean the whole thing up. It really should be a gdbarch
method...

-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-24 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 18:18 [commit/Ada] use lbasename when testing if file is part of Ada runtime Joel Brobecker
2012-10-24 20:20 ` Tom Tromey
2012-10-24 20:24   ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox