Mail Archives: djgpp/1997/02/03/07:03:30
jrubin wrote:
>
> gcc -g test.c
> gdb a.out
> (gdb) p x
> $1 = 1
> (gdb) set var x = 100
> (gdb) p x
> $2 = 100
> (gdb) r
> Starting program: c:/jsc/runtime/a.out
> test.c: x = 1
> (gdb) q
> warning: cannot close "c:/jsc/runtime/a.out": Permission denied (EACCES)
This comes probably from the fact, that you are changing
the contents of a variable which memory is at this time
not valid. When you start gdb it reads only the symbols
but does not read the program in memory. Normally gdb
should complain that you are trying to access invalid
memory (but it doesn't, why???).
And that 'x' has not the value you have set comes
from the same fact.
BTW: Is that the complete output of gdb or have you snipped
something?
Robert
--
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -