Handle PPC64 function descriptor in Ada decoding
authorJerome Guitton <guitton@adacore.com>
Sat, 8 Sep 2018 21:47:11 +0000 (16:47 -0500)
committerJoel Brobecker <brobecker@adacore.com>
Sat, 8 Sep 2018 21:47:11 +0000 (17:47 -0400)
On PPC64, the entry point of the function "FN" is ".FN" when a function
descriptor is used. One of the consequences of this is that GDB then
presents the name of the function to the user (eg: in backtraces) with
the leading dot, which is a low-level internal detail that the user
should not be seeing.  The Ada decoding should strip it.

gdb/ChangeLog:

* ada-lang.c (ada_decode): strip dot prefix in symbol name.

No testcase added, as a number of existing testcases should already
demonstrate that problem.

gdb/ChangeLog
gdb/ada-lang.c

index 4aeb0ba841f20ad0fc693adce24fa8d33e9a9e25..41b1ad4ceda2a88d7f324caa8011a16f50cc0ea2 100644 (file)
@@ -1,3 +1,7 @@
+2018-09-08  Jerome Guitton  <guitton@adacore.com>
+
+       * ada-lang.c (ada_decode): strip dot prefix in symbol name.
+
 2018-09-08  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c (ada_exception_sal): Replace gdb_assert calls
index c5cddd044ca2752d0eb95ed8c3c467e1741d123e..16c7c51ffa0e33f061866d849132a4e62e8289ff 100644 (file)
@@ -1164,6 +1164,11 @@ ada_decode (const char *encoded)
   static char *decoding_buffer = NULL;
   static size_t decoding_buffer_size = 0;
 
+  /* With function descriptors on PPC64, the value of a symbol named
+     ".FN", if it exists, is the entry point of the function "FN".  */
+  if (encoded[0] == '.')
+    encoded += 1;
+
   /* The name of the Ada main procedure starts with "_ada_".
      This prefix is not part of the decoded name, so skip this part
      if we see this prefix.  */
This page took 0.034399 seconds and 4 git commands to generate.