gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 17 Apr 2011 18:09:02 +0000 (18:09 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 17 Apr 2011 18:09:02 +0000 (18:09 +0000)
* elfread.c (elf_symtab_read): Do not ignore .L symbols if they are
BSF_SYNTHETIC.

gdb/testsuite/
* gdb.base/callfuncs.c (Lcallfunc, callfunc): New functions.
* gdb.base/callfuncs.exp (print callfunc (Lcallfunc, 5)): New test.

gdb/ChangeLog
gdb/elfread.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/callfuncs.c
gdb/testsuite/gdb.base/callfuncs.exp

index e81afd7c566f2e099f11f037918a2166125ce2e6..b44889e70df6c7f1141a28201341c066dc8f710f 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * elfread.c (elf_symtab_read): Do not ignore .L symbols if they are
+       BSF_SYNTHETIC.
+
 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix Python access to inlined frames.
index b9cfa136fe4e4945f78a9e43e3aefacc66c11408..2d589a42905b7a9702792ac43c1af675a4ebed84 100644 (file)
@@ -412,7 +412,11 @@ elf_symtab_read (struct objfile *objfile, int type,
                  else
                    ms_type = mst_text;
                }
-             else if ((sym->name[0] == '.' && sym->name[1] == 'L')
+             /* The BSF_SYNTHETIC check is there to omit ppc64 function
+                descriptors mistaken for static functions starting with 'L'.
+                */
+             else if ((sym->name[0] == '.' && sym->name[1] == 'L'
+                       && (sym->flags & BSF_SYNTHETIC) == 0)
                       || ((sym->flags & BSF_LOCAL)
                           && sym->name[0] == '$'
                           && sym->name[1] == 'L'))
index af1fd5f4b30ad425e51ccf5b093c828e10d62d55..f1f8d3c7adde3015826de96fa632a635f1f37ca9 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.base/callfuncs.c (Lcallfunc, callfunc): New functions.
+       * gdb.base/callfuncs.exp (print callfunc (Lcallfunc, 5)): New test.
+
 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix Python access to inlined frames.
index 2d40650b10215b9d1e1f1a9b65f85be66f955dca..406d22af684da5858f07accf2f7bc3658bb34b3c 100644 (file)
@@ -510,3 +510,15 @@ int main ()
   t_structs_c(struct_val1);
   return 0 ;
 }
+
+static int
+Lcallfunc (int arg)
+{
+  return arg + 1;
+}
+
+int
+callfunc (int (*func) (int value), int value)
+{
+  return Lcallfunc (0) * 0 + func (value) * 2;
+}
index 97efacbed15689c8da9c22d01ce5337f6942addb..27ebd1ec98532be925401f60ee8b9f8ef8c032f3 100644 (file)
@@ -458,3 +458,8 @@ if {![target_info exists gdb,nosignals] && ![istarget "*-*-uclinux*"]} {
 
     gdb_test {set $sp = $old_sp}
 }
+
+# Test function descriptor resolution - the separate debug info .opd section
+# handling vs. local labels `.L'... as `Lcallfunc' starts with `L'.
+
+gdb_test "print callfunc (Lcallfunc, 5)" " = 12"
This page took 0.044515 seconds and 4 git commands to generate.