[PATCH 2/2] Fix suspendable implementation of 'get-bytevector-some!'

2021-01-22 Thread Andrew Whatson
* module/ice-9/suspendable-ports.scm (get-bytevector-some!): Fix incorrect arguments to bytevector-copy! --- module/ice-9/suspendable-ports.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ice-9/suspendable-ports.scm b/module/ice-9/suspendable-ports.scm index f5f00

[PATCH 1/2] Add tests for get-bytevector-some!

2021-01-22 Thread Andrew Whatson
* test-suite/tests/r6rs-ports.test (get-bytevector-n! [short]): add (get-bytevector-n! [long]): add --- test-suite/tests/r6rs-ports.test | 20 1 file changed, 20 insertions(+) diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test index 4d1981df2..

[PATCH] Properly display locations in "source vector" form.

2022-08-26 Thread Andrew Whatson
Locations are stored in tree-il records in "source vector" form, but `location-string' was rendering these as . * module/system/base/message.scm (location-string): Support locations passed as a file/line/column vector. --- module/system/base/message.scm | 19 +-- 1 file changed, 1

[PATCH] Improve reporting of exception locations

2022-09-19 Thread Andrew Whatson
Most errors were reported as coming from boot-9.scm due to incorrect hard-coded stack-narrowing offsets. This patch fixes the offsets and adds an argument to specify additional frames to skip when calling raise-exception. * libguile/stacks.h: * libguile/stacks.c (scm_skip_stack_frames_fluid): New

[PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2022-09-20 Thread Andrew Whatson
Workaround for . * module/system/vm/frame.scm (frame-call-representation): Treat a binding as "unspecified" if its slot exceeds 'frame-num-locals'. --- module/system/vm/frame.scm | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/s

Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2022-09-22 Thread Andrew Whatson
Maxime Devos wrote: > > I propose to add a link to the bug report in the comments, for future > reference. Also, there is an interest in returning zero values in such > cases: > (that patch didn't work out, but the sentiment is still

[PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2022-09-22 Thread Andrew Whatson
Workaround for . * module/system/vm/frame.scm (frame-call-representation): Treat a binding as "unspecified" if its slot exceeds 'frame-num-locals'. --- module/system/vm/frame.scm | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/s

Re: [PATCH] Improve reporting of exception locations

2022-09-22 Thread Andrew Whatson
Maxime Devos wrote: > > Do you have some test cases, to > >(1) avoid breaking things again with future changes >(2) and show that this patch is correct? > > There recent-ish was a bug report about exception handling (on IRC), it > would be a unfortunate if whatever the fix for that turned

[PATCH] Add tests for warning locations.

2022-09-24 Thread Andrew Whatson
These would have caught . * test-suite/tests/tree-il.test ("warnings"): New tests. * test-suite/tests/tree-il/unbound-spaces.scm: * test-suite/tests/tree-il/unbound-tabs.scm: * test-suite/tests/tree-il/unused-variable.scm: Sample code for compilation warning tests. ---

[PATCH v2] Add tests for warning locations.

2022-09-24 Thread Andrew Whatson
These would have caught . * test-suite/Makefile.am (SCM_TESTS): Add sample code files. * test-suite/tests/tree-il.test ("warnings"): New tests. * test-suite/tests/tree-il/unbound-spaces.scm: * test-suite/tests/tree-il/unbound-tabs.scm: * test-suite/tests/tree-il/unused-

[DRAFT] Improve reporting of exception locations

2022-10-11 Thread Andrew Whatson
Hello guile-dev! I'm working on a revised patch to improve the reporting of exception locations, after last month's initial flawed attempt. The new patch takes the more radical approach of capturing the stack when an exception is created, including it as part of the compound exception object. Th

[DRAFT] Improve reporting of exception locations

2022-10-11 Thread Andrew Whatson
TODO: use exception-stack in other error handlers TODO: print-exception variant for exception objects TODO: test cases for other kinds of errors * module/ice-9/exceptions.scm (&stack): New exception type. (convert-guile-exception): Capture the stack when creating an exception. * module/system/repl

[PATCH v3] Add tests for warning locations.

2022-10-12 Thread Andrew Whatson
These would have caught . * test-suite/tests/tree-il.test ("warnings")("location")["unused variable", "unbound variable (spaces)", "unbound variable (tabs)"]: New tests. --- test-suite/tests/tree-il.test | 48 ++- 1 file changed, 47 inse

Re: [PATCH v2] Add tests for warning locations.

2022-10-12 Thread Andrew Whatson
Ludovic Courtès wrote: > > One minor nitpick and then we’re ready to go: > > > + (with-test-prefix "location" > > + (define (test-file filename) > > + (string-append > > +(dirname (current-filename)) "/" filename)) > > + > > + (pass-if "unused variable" > > + (let ((w

Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2022-10-12 Thread Andrew Whatson
Ludovic Courtès wrote: > > It would be great if you could add a simple test case though, so that > the bug doesn’t eventually come back to haunt us. > > Could you send an updated patch? Ah yes, getting this covered in a test is on my list. I had trouble writing a reproducer previously, I think t

Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2023-01-10 Thread Andrew Whatson
Andrew commit 164bdce6acf53796cb96ef1930a89c6caf84bc39 Author: Andrew Whatson Date: Wed Jan 11 14:04:32 2023 +1000 Test for 'frame-local-ref' errors when printing backtrace. This test reproduces the error from <https://bugs.gnu.org/56493>, and passes with the workaro

Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace.

2023-01-11 Thread Andrew Whatson
Ludovic Courtès wrote: > > Applied, thanks! Thank you! > PS: Please use ‘git format-patch’ so the patch can be directly consumed > by ‘git am’. My mistake, sorry about that. Noted for next time :) Cheers, Andrew