summaryrefslogtreecommitdiff
path: root/libguile/gsubr.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-08 10:03:48 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-08 10:11:48 +0100
commit0e3a59f75050041f4f6b423a53193609335f708d (patch)
treeae27d016e349331db5814c33708c3a1c59c21670 /libguile/gsubr.c
parent1ab116f39075f8dcf1b6c8084d9afc547f9a85b7 (diff)
downloadguile-0e3a59f75050041f4f6b423a53193609335f708d.tar.gz
Fix reading and writing arities into DWARF.
* libguile/gsubr.h: * libguile/gsubr.c (scm_i_primitive_call_ip): * libguile/programs.c (scm_primitive_call_ip): Adapt to return an absolute address. * module/system/vm/assembler.scm (write-arity-headers): Adapt to write byte addresses (relative to the text base). * module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Return absolute addresses, instead of word offsets relative to the text base. (find-first-arity): Adapt for absolute addresses. * module/system/vm/program.scm (program-arguments-alist): Adapt for arity-low-pc / arity-high-pc absolute addresses.
Diffstat (limited to 'libguile/gsubr.c')
-rw-r--r--libguile/gsubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/gsubr.c b/libguile/gsubr.c
index 5dd767df7..96fab4eda 100644
--- a/libguile/gsubr.c
+++ b/libguile/gsubr.c
@@ -286,7 +286,7 @@ scm_i_primitive_arity (SCM prim, int *req, int *opt, int *rest)
return 1;
}
-int
+scm_t_uintptr
scm_i_primitive_call_ip (SCM subr)
{
const scm_t_uint32 *code = SCM_RTL_PROGRAM_CODE (subr);
@@ -294,7 +294,7 @@ scm_i_primitive_call_ip (SCM subr)
/* A stub is 4 32-bit words long, or 16 bytes. The call will be one
instruction, in either the fourth, third, or second word. Return a
byte offset from the entry. */
- return code[3] ? 12 : code[2] ? 8 : 4;
+ return (scm_t_uintptr)(code + (code[3] ? 3 : code[2] ? 2 : 1));
}
SCM