This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Function argument no longer in register
- From: Orjan Friberg <orjan dot friberg at axis dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Mar 2004 16:21:19 +0200
- Subject: Function argument no longer in register
- Organization: Axis Communications
Hi all,
What should happen when a function argument goes out of scope because
the register used to pass it is now used for something else? I
encountered the following situation:
foo (char *str)
{
...
i = bar ();
...
}
The str argument is passed in register r10, which is then overwritten
with the return value from bar. If I stop somewhere after the call to
bar and try to "print str", GDB will try to read from the address
pointed out by r10 (i.e. sends an 'm' packet to the remote stub).
I don't know what kind of problem I'm looking at here. Could it be that
the debug information is wrong? I'm guessing GDB somehow fails to
realize that the function argument is out of scope at this point.
--
Orjan Friberg
Axis Communications