This is the mail archive of the gdb@sourceware.org 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: signal 0 command


"Seong-Kook Shin" <cinsky@gmail.com> writes:

> If I understand correctly, I can issue "signal 0" to ignore the current
> signal GDB caught, right?  So I made a simple program to raise SIGSEGV:
>
> void
> foo(const char *str)
> {
>   char *p = 0;     /* This should be "char *p = str" */
>
>   while (*p != '\0') {
>     /* do something */
>     p++;
>   }
> }
>
> After reading the manual, I thought that it is possible to
> undo the generation of SIGSEGV after modifying the value `p'.
> But when I set the value of `p' corrently, and execute "signal 0",
> I can still see the SIGSEGV is generated.

Modifying the variable does not necessarily mean that the current
instruction can see the change.  The value may be been loaded into a
register which is used instead by the insn.  You may have to modify the
program counter to move back to where the variable's value is loaded.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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