mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
procedure-properties for RTL functions
* module/system/vm/assembler.scm (link-procprops, link-objects): Arrange to write procedure property links out to a separate section. * libguile/procprop.c (scm_procedure_properties): * libguile/programs.h: * libguile/programs.c (scm_i_rtl_program_properties): * module/system/vm/debug.scm (find-program-properties): Wire up procedure-properties for RTL procedures. Yeah! Fistpumps! :) * module/system/vm/debug.scm (find-program-debug-info): Return #f if the string is "", as it is if we don't have a name. Perhaps elf-symbol-name should return #f in that case... * test-suite/tests/rtl.test: Add some tests.
This commit is contained in:
parent
bf8328ec16
commit
c4c098e355
7 changed files with 179 additions and 8 deletions
|
@ -357,3 +357,55 @@
|
|||
(return 0)
|
||||
(end-arity)
|
||||
(end-program))))))
|
||||
|
||||
(with-test-prefix "procedure properties"
|
||||
;; No properties.
|
||||
(pass-if-equal '()
|
||||
(procedure-properties
|
||||
(assemble-program
|
||||
'((begin-program foo ())
|
||||
(begin-standard-arity () 1 #f)
|
||||
(load-constant 0 42)
|
||||
(return 0)
|
||||
(end-arity)
|
||||
(end-program)))))
|
||||
|
||||
;; Name and docstring (which actually don't go out to procprops).
|
||||
(pass-if-equal '((name . foo)
|
||||
(documentation . "qux qux"))
|
||||
(procedure-properties
|
||||
(assemble-program
|
||||
'((begin-program foo ((name . foo) (documentation . "qux qux")))
|
||||
(begin-standard-arity () 1 #f)
|
||||
(load-constant 0 42)
|
||||
(return 0)
|
||||
(end-arity)
|
||||
(end-program)))))
|
||||
|
||||
;; A property that actually needs serialization.
|
||||
(pass-if-equal '((name . foo)
|
||||
(documentation . "qux qux")
|
||||
(moo . "mooooooooooooo"))
|
||||
(procedure-properties
|
||||
(assemble-program
|
||||
'((begin-program foo ((name . foo)
|
||||
(documentation . "qux qux")
|
||||
(moo . "mooooooooooooo")))
|
||||
(begin-standard-arity () 1 #f)
|
||||
(load-constant 0 42)
|
||||
(return 0)
|
||||
(end-arity)
|
||||
(end-program)))))
|
||||
|
||||
;; Procedure-name still works in this case.
|
||||
(pass-if-equal 'foo
|
||||
(procedure-name
|
||||
(assemble-program
|
||||
'((begin-program foo ((name . foo)
|
||||
(documentation . "qux qux")
|
||||
(moo . "mooooooooooooo")))
|
||||
(begin-standard-arity () 1 #f)
|
||||
(load-constant 0 42)
|
||||
(return 0)
|
||||
(end-arity)
|
||||
(end-program))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue