Package: gdb
Version: 7.2-1
Severity: normal

gdb shows incorrect prototype in backtrace when using GCC's cleanup
attribute. Here's a simple example:

------------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>

int fct (int *x, int y, int z)
{
  void log_cleanup (int *time)
  {
    fprintf (stderr, "x=%d\n", *x);
  }
  int log_time __attribute__ ((cleanup (log_cleanup)));

  *x = y;
  abort ();
  return 0;
}

int main (void)
{
  int x;

  fct (&x, 17, 1);
  return 0;
}

------------------------------------------------------------

$ gcc -Wall -g tst.c -o tst
$ gdb ./tst
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/vlefevre/tst...done.
(gdb) run
Starting program: /home/vlefevre/tst 

Program received signal SIGABRT, Aborted.
0x00007ffff7aaf165 in raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007ffff7aaf165 in raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff7ab1f70 in abort () at abort.c:92
#2  0x00000000004005d9 in fct (y=17, z=1) at tst.c:13
#3  0x00000000004005f7 in main () at tst.c:21

One can see that the x is absent from fct in #2.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gdb depends on:
ii  gdbserver               7.2-1            The GNU Debugger (remote server)
ii  libc6                   2.11.2-13        Embedded GNU C Library: Shared lib
ii  libexpat1               2.0.1-7          XML parsing C library - runtime li
ii  libncurses5             5.9-1            shared libraries for terminal hand
ii  libpython2.6            2.6.6-10         Shared Python runtime library (ver
ii  libreadline6            6.2-1            GNU readline and history libraries
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

gdb recommends no packages.

Versions of packages gdb suggests:
ii  gdb-doc                       7.2-1      The GNU Debugger Documentation

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to