Subject: gcc weirdness
To: None <netbsd-help@netbsd.org, port-i386@netbsd.org>
From: None <collver@linuxfreemail.com>
List: port-i386
Date: 10/23/2001 08:25:45
Hi,

I'm seeing weird things in a nethack variant when debugging it with gdb:
 _________________________________________________________________________
|Breakpoint 1, dosave0 () at save.c:123
|123             printf("debug1: %p\n", tmp_save);
|(gdb) n
|debug1: 0xbfbfd7c8
|124             tmp_save = ((char *)&SAVEF[0]);
|(gdb) s
|125             printf("debug2: %p, %p\n", tmp_save, ((char *)&SAVEF[0]));
|(gdb) n
|debug2: 0x822dfe0, 0x822dfe0
|126             fq_save = fqname((const char *)tmp_save, SAVEPREFIX, 1);
|/* level files take 0 */
|(gdb) p tmp_save
|$1 = 0x81d4eb0 "U\211åSè"


The declarations from src/save.c:116, src/files.c:69, and include/decl.h:22
116             char *tmp_save;
69      char SAVEF[SAVESIZE];
22	E char SAVEF[];

Can anyone give me a hint about why the output from line 125 indicated a
different value for tmp_save than what GDB reported?


Thank you!

Ben