This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: gdb/2188: gdb 6.5 -- internal error with "-var-update *" command
- From: Greg Watson <g dot watson at computer dot org>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 2 Jan 2007 21:08:01 -0000
- Subject: Re: gdb/2188: gdb 6.5 -- internal error with "-var-update *" command
- Reply-to: Greg Watson <g dot watson at computer dot org>
The following reply was made to PR gdb/2188; it has been noted by GNATS.
From: Greg Watson <g.watson@computer.org>
To: gdb-gnats@sources.redhat.com,
nobody@sources.redhat.com,
Greg Watson <g.watson@computer.org>,
Clement Chu <clement.chu@csse.monash.edu.au>,
gdb-prs@sources.redhat.com
Cc:
Subject: Re: gdb/2188: gdb 6.5 -- internal error with "-var-update *" command
Date: Tue, 2 Jan 2007 14:06:27 -0700
I've isolated this problem further. MPI is no longer required to
repeat the problem. The environment is FC5, gcc 4.1.0 20060304 (Red
Hat 4.1.0-3), gdb 6.5.
Compile this code with 'gcc -g -o test test.c':
#include <stdio.h>
#include <stdlib.h>
int func(int *x)
{
char *env = getenv("HOME");
printf("env=%s\n", env);
return 0;
}
int main(int argc, char *argv[])
{
func(&argc);
printf("hello\n");
return 0;
}
Debug with gdb. Step over the call to func, then print the stack
using 'where':
$ gdb test
GNU gdb 6.5
Copyright (C) 2006 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 "i686-pc-linux-gnu"...Using host
libthread_db library
"/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x8048424: file test.c, line 13.
(gdb) r
Starting program: /home/greg/test
Breakpoint 1, main (argc=1, argv=0xbf9fc8d4) at test.c:13
13 func(&argc);
(gdb) n
env=/home/greg
14 printf("hello\n");
(gdb) where
#0 main (argc=Cannot access memory at address 0x0
) at test.c:14
(gdb)
Regards,
Greg