This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb -write, core dumps
- From: Nitin Gupta <toolchain at gmail dot com>
- To: gdb at sources dot redhat dot com, cagney at gnu dot org
- Date: Mon, 7 Mar 2005 14:24:39 -0800
- Subject: Re: gdb -write, core dumps
- References: <4c97fada050302154548bed9d4@mail.gmail.com>
- Reply-to: Nitin Gupta <toolchain at gmail dot com>
BTW, It is bug #1410 in GDB bugs list.
http://www.gnu.org/software/gdb/bugs/
I am not sure if there is a patch available for it.
On Wed, 2 Mar 2005 15:45:53 -0800, Nitin Gupta <toolchain@gmail.com> wrote:
> I see that "gdb -write" is doing a core dump, while modifying the binary.
> I see this problem on gdb-6.1 as well as on gdb-6.3
>
> Any suggestion on what I might be doing wrong?
>
> foo.c:
> volatile int i=4;
> main() { }
>
> gcc -g foo.c -o foo
>
> Then, patch the global variable:
>
> gdb -write foo
> .....
>
> (gdb) p i
> $1 = 4
> (gdb) p i=3
> $2 = 3
> (gdb) q
> Segmentation fault
>