* [PATCH/RFC] Add FUNCTION_START_OFFSET to return value of find_function_addr
@ 2004-04-14 11:23 Mark Kettenis
2004-04-14 16:27 ` Andrew Cagney
2004-04-18 19:14 ` Mark Kettenis
0 siblings, 2 replies; 4+ messages in thread
From: Mark Kettenis @ 2004-04-14 11:23 UTC (permalink / raw)
To: gdb-patches
The reason why inferior function calls don't work on the VAX is pretty
simple. On the VAX the first instruction of a function has an offset
of 2 bytes from the function's address; that's why we have
FUNCTION_START_OFFSET in GDB. At the function's start address itself
we find the function's entry mask, which defines which registers
should be saved. The generic dummy frame framework doesn't take this
into account, and sets the PC to the function's address. The result
is a SIGILL. The attached patch fixes the problems by adding
FUNCTION_START_OFFSET to the return value of
infcall.c:find_function_addr(). Currently the VAX is the only target
that sets FUNCTION_START_OFFSET.
With this patch, the majority of the inferior function call tests in
the testsuite pass. Most of the failures are related to function
calls involving floating point arguments. This is because GDB doesn't
understand the VAX floating-point format.
If nobody objects, I'll check this in in a few days.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* infcall.c (find_function_addr): Add FUNCTION_START_OFFSET.
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.40
diff -u -p -r1.40 infcall.c
--- infcall.c 7 Mar 2004 18:06:14 -0000 1.40
+++ infcall.c 14 Apr 2004 11:01:40 -0000
@@ -206,7 +206,7 @@ find_function_addr (struct value *functi
error ("Invalid data type for function to be called.");
*retval_type = value_type;
- return funaddr;
+ return funaddr + FUNCTION_START_OFFSET;
}
/* Call breakpoint_auto_delete on the current contents of the bpstat
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-04-18 19:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 11:23 [PATCH/RFC] Add FUNCTION_START_OFFSET to return value of find_function_addr Mark Kettenis
2004-04-14 16:27 ` Andrew Cagney
2004-04-14 17:42 ` Mark Kettenis
2004-04-18 19:14 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox