diff options
Diffstat (limited to 'src/print.c')
| -rw-r--r-- | src/print.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c index 425b0dc4ee3..b373aaf6551 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1796,7 +1796,8 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, | |||
| 1796 | case PVEC_MODULE_FUNCTION: | 1796 | case PVEC_MODULE_FUNCTION: |
| 1797 | { | 1797 | { |
| 1798 | print_c_string ("#<module function ", printcharfun); | 1798 | print_c_string ("#<module function ", printcharfun); |
| 1799 | module_funcptr ptr = module_function_address (XMODULE_FUNCTION (obj)); | 1799 | const struct Lisp_Module_Function *function = XMODULE_FUNCTION (obj); |
| 1800 | module_funcptr ptr = module_function_address (function); | ||
| 1800 | char const *file; | 1801 | char const *file; |
| 1801 | char const *symbol; | 1802 | char const *symbol; |
| 1802 | dynlib_addr (ptr, &file, &symbol); | 1803 | dynlib_addr (ptr, &file, &symbol); |
| @@ -1815,6 +1816,19 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, | |||
| 1815 | else | 1816 | else |
| 1816 | print_c_string (symbol, printcharfun); | 1817 | print_c_string (symbol, printcharfun); |
| 1817 | 1818 | ||
| 1819 | void *data = module_function_data (function); | ||
| 1820 | if (data != NULL) | ||
| 1821 | { | ||
| 1822 | uintptr_t ui = (uintptr_t) data; | ||
| 1823 | |||
| 1824 | /* In theory this assignment could lose info on pre-C99 | ||
| 1825 | hosts, but in practice it doesn't. */ | ||
| 1826 | uintmax_t up = ui; | ||
| 1827 | |||
| 1828 | int len = sprintf (buf, " with data 0x%"PRIxMAX, up); | ||
| 1829 | strout (buf, len, len, printcharfun); | ||
| 1830 | } | ||
| 1831 | |||
| 1818 | if (file != NULL) | 1832 | if (file != NULL) |
| 1819 | { | 1833 | { |
| 1820 | print_c_string (" from ", printcharfun); | 1834 | print_c_string (" from ", printcharfun); |
| @@ -1838,7 +1852,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) | |||
| 1838 | { | 1852 | { |
| 1839 | char buf[max (sizeof "from..to..in " + 2 * INT_STRLEN_BOUND (EMACS_INT), | 1853 | char buf[max (sizeof "from..to..in " + 2 * INT_STRLEN_BOUND (EMACS_INT), |
| 1840 | max (sizeof " . #" + INT_STRLEN_BOUND (intmax_t), | 1854 | max (sizeof " . #" + INT_STRLEN_BOUND (intmax_t), |
| 1841 | max ((sizeof "at 0x" | 1855 | max ((sizeof " with data 0x" |
| 1842 | + (sizeof (uintmax_t) * CHAR_BIT + 4 - 1) / 4), | 1856 | + (sizeof (uintmax_t) * CHAR_BIT + 4 - 1) / 4), |
| 1843 | 40)))]; | 1857 | 40)))]; |
| 1844 | current_thread->stack_top = buf; | 1858 | current_thread->stack_top = buf; |