This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pending/2565: Re: 'p siginfo->si_addr' doesn't work anymore


>Number:         2565
>Category:       pending
>Synopsis:       Re: 'p siginfo->si_addr' doesn't work anymore
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Wed Dec 10 15:58:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 Test inline:
 
 #include <signal.h>
 #include <string.h>
 
 int
 main (int argc, char **argv)
 {
   struct siginfo info; /* make sure it's not related to var name equal type name.  */
   struct siginfo siginfo; /* var vs ... */
   struct siginfo *siginfo_p = &siginfo; /* ... pointer */
 
   return 0;
 }
 
 Some more info:
 
 (gdb) info macro si_addr
 Defined at /usr/include/bits/siginfo.h:122
   included at /usr/include/signal.h:212
   included at /home/pedro/gdb/tests/siginfo_exp.c:1
 #define si_addr _sifields._sigfault.si_addr
 (gdb) 
 
 >/home/pedro/gdb/baseline/build/gdb/gdb ./siginfo_exp
 GNU gdb (GDB) 6.8.50.20081210-cvs
 Copyright (C) 2008 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-unknown-linux-gnu".
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>...
 (gdb) start
 Temporary breakpoint 1 at 0x400460: file siginfo_exp.c, line 9.
 Starting program: /home/pedro/gdb/tests/siginfo_exp
 
 Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe408) at siginfo_exp.c:9
 9         struct siginfo *siginfo_p = &siginfo; /* ... pointer */
 (gdb) p siginfo
 $1 = {si_signo = 1, si_errno = 0, si_code = 0, _sifields = {_pad = {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -134241448, 32767,
       -7296, 32767, -134242304, 32767, 4195034, 0, 0, 0, 1, 0, -139464905, 32767, 0, 0, 134090501, 191}, _kill = {
       si_pid = 1, si_uid = 0}, _timer = {si_tid = 1, si_overrun = 0, si_sigval = {sival_int = 0, sival_ptr = 0x0}},
     _rt = {si_pid = 1, si_uid = 0, si_sigval = {sival_int = 0, sival_ptr = 0x0}}, _sigchld = {si_pid = 1,
       si_uid = 0, si_status = 0, si_utime = 0, si_stime = 0}, _sigfault = {si_addr = 0x1}, _sigpoll = {si_band = 1,
       si_fd = 0}}}
 
  (gdb) p siginfo_p->si_addr
  There is no member named .
  (gdb) macro expand siginfo_p->si_addr
  expands to: siginfo_p->_sifields._sigfault.si_addr
 
 Manual expansion succeeds, but, (guessing) it seems that when evaluating, GDB is trying to further re-expand the si_addr member of _sigfault, as a macro.
 
 Trying the manually expanded form is no help, since GDB tries to expand si_addr, and doesn't fallback to a real member:
 
  (gdb) p siginfo_p->_sifields._sigfault.si_addr
  There is no member named _sifields.
 
 Interestingly, macro expansion when using the '.' operator
 instead of the '->' operator behaves differently:
 
  (gdb) p siginfo.si_addr
  There is no member named .
  (gdb) macro expand siginfo.si_addr
  expands to: siginfo.si_addr
 
 Making sure it's not related to var named siginfo and type named siginfo; printing through a variable, with '.' operator:
  (gdb) p info.si_addr
  There is no member named .
  (gdb) macro expand info.si_addr
  expands to: info.si_addr
 
 Evaluation seems to have expanded, and hit the same bug as before, but manual expansion fails to even expand the first si_addr.
 
 Making sure its not related to the var type, but to the operator used:
 
  (gdb) p siginfo_p.si_addr
  There is no member named .
  (gdb) macro expand siginfo_p.si_addr
  expands to: siginfo_p.si_addr
 
 This is a regression against 6.8:
 
  (gdb) p siginfo.si_addr
  $1 = (void *) 0x1
  (gdb) macro expand  siginfo_p->si_addr
  expands to: siginfo_p->_sifields._sigfault.si_addr
  (gdb) p siginfo_p->si_addr
  $2 = (void *) 0x1
  (gdb)
 
 Although macro expanding with the '.' operator was broken already:
 
  (gdb) macro expand  siginfo.si_addr
  expands to: siginfo.si_addr
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]