Bug 13427

Summary: gdb reports wrong info
Product: Base System Reporter: Jin Guojun <jin>
Component: gnuAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   

Description Jin Guojun 1999-08-28 01:30:01 UTC
% gdb timidity
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) l
518              }
519       close_file(fp);
520       return 0;
521     }
522     #ifdef __WIN32__
523     int __cdecl main(int argc, char **argv)
524     #else
525     int main(int argc, char **argv)
526     #endif
527     {
(gdb) b 698
Breakpoint 1 at 0x804a7a3: file timidity.c, line 698.
(gdb) run ~/music/club.MID
Starting program: /tmp/timidity-0.2i/timidity ~/music/club.MID
argc = 2, optind = 1

Breakpoint 1, main (argc=-1077945350, argv=0xbfbfdc26) at timidity.c:699
699             fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
(gdb) p argc
$1 = -1077945350
(gdb) n
argc = 2, optind = 1
700       if (optind<argc)
(gdb) p optind
$2 = 1
(gdb) p argc
$3 = -1077945350
(gdb) display optind
1: {<data variable, no debug info>} (void *) 0x805db78 = 1
(gdb) display argc
2: argc = -1077945350
(gdb)
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 2000-07-10 10:49:43 UTC
Responsible Changed
From-To: freebsd-bugs->obrien
Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2001-09-10 17:25:06 UTC
Responsible Changed
From-To: obrien->freebsd-bugs

I am not the maintainer.
Comment 3 iedowse freebsd_committer freebsd_triage 2002-01-21 21:16:05 UTC
State Changed
From-To: open->feedback


Does this problem still exist in more recent FreeBSD releases?
Comment 4 iedowse freebsd_committer freebsd_triage 2002-01-21 21:49:07 UTC
State Changed
From-To: feedback->closed


Mail to submitter bounces.
Comment 5 Sheldon Hearn 2002-01-31 10:09:59 UTC
On Tue, 22 Jan 2002 06:15:03 +0200, Giorgos Keramidas wrote:

> > Does this problem still exist in more recent FreeBSD releases?
> 
> Yes, on -CURRENT built on Jan 12 (I 've been lazy updating my CURRENT
> box) and on a fresh installation of 4.4-RELEASE I did this afternoon,
> the bug is still there.  The information printed for the current stack
> frame by gdb(1) is wrong, in programs compiled with -ggdb.
> 
> I'm trying to find out why this happens on my machine, and I've
> contacted Rexpixel <gmh003532@brfmasthugget.se> (who frequents that
> IRC channel) with today's tests and results.
> 
> Can we leave this open for a while?

The PR doesn't need to remain open if it's the same problem as PR 24132,
which is open and assigned to a willling GDB maintainer.

Ciao,
Sheldon.