This is the mail archive of the gdb@sources.redhat.com 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]

Re: gdb -write, core dumps


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
>


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