This is the mail archive of the
mailing list for the GDB project.
Re: Setting registers
>>>>> "Eli" == Eli Zaretskii <firstname.lastname@example.org> writes:
>> Date: Fri, 15 Jun 2007 18:25:53 +0530 From: Indira
>> <email@example.com> Cc: firstname.lastname@example.org
>> Yes I am debuggin a core file. We cant set registers while
>> debuggin a core file?
Eli> No, you can't. The program is dead, all you have is the last
Eli> snapshot of its memory. Even if you could set registers (and
Eli> other variables), it would be of no practical use, since you
Eli> cannot run the program. All you can do is examine its memory
Eli> and call stack.
Sometimes it would be useful to be able to. If the stack is corrupt,
or the return address (for processor types that have such a thing) and
you can figure out the correct values, it would be very handy to be
able to tell gdb "here is the right value" and let it use that for
Right now, that's not possible. So if I have a smashed stack, I have
to walk it by hand -- which means looking at local variables is
essentially undoable. It's not always simply a matter of giving the
right SP to gdb, but often it is.