GNU bug report logs -
#25316
26.0.50; Bugs in testcover-reinstrument
Previous Next
Reported by: Gemini Lasswell <gazally <at> runbox.com>
Date: Sun, 1 Jan 2017 00:41:02 UTC
Severity: normal
Tags: patch
Found in version 26.0.50
Done: Gemini Lasswell <gazally <at> runbox.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Gemini Lasswell <gazally <at> runbox.com> writes:
> (edebug-enter): New function which changes behavior of Edebug based
> on symbol property 'edebug-behavior and edebug-behavior-alist.
Those should be wrapped in quotes as in `edebug-behavior' and
`edebug-behavior-alist'.
> -(defun edebug-enter (function args body)
> +(defun edebug-enter (func args body)
> + "Enter Edebug for a function.
> +FUNC should be the symbol with the Edebug information, ARGS is
> +the list of arguments and BODY is the code.
> +
> +Look up the `edebug-behavior' for FUNC in `edebug-behavior-alist'
> +and run its entry function, and set up `edebug-before' and
> +`edebug-after'."
> + (cl-letf* ((behavior (get func 'edebug-behavior))
> + (functions (cdr (assoc behavior edebug-behavior-alist)))
> + ((symbol-function #'edebug-before) (nth 1 functions))
> + ((symbol-function #'edebug-after) (nth 2 functions)))
> + (funcall (nth 0 functions) func args body)))
Overriding the function-definition of edebug-before and edebug-after
doesn't seem very clean. It would be better to have an
edebug-before-function which is `funcall'ed I think (I know your patch
didn't introduce this, it just makes it more obvious. Perhaps it could
be addressed later).
> (defun edebug-run-slow ()
> - (defalias 'edebug-before 'edebug-slow-before)
> - (defalias 'edebug-after 'edebug-slow-after))
> + "Set up Edebug's normal behavior."
> + (setf (cdr (assq 'edebug edebug-behavior-alist))
> + '(edebug-default-enter edebug-slow-before edebug-slow-after)))
> +(defun testcover-analyze-coverage (form)
> + (pcase form
> + (`(quote . ,_)
> + ;; A quoted form is 1value. Edebug could have instrumented
> + ;; something inside the form if an Edebug spec contained a quote.
> + ;; It's also possible that the quoted form is a circular object.
> + ;; To avoid infinite recursion, don't examine quoted objects.
> + ;; This will cause the coverage marks on an instrumented quoted
> + ;; form to look odd. See bug#25316.
> + '1value)
Missed double spacing again.
> + ((or `(\` ,bq-form) `(\` . ,bq-form))
Isn't only the first of these is needed? (read "`foo") ;=> (\` foo)
> +(defun testcover-analyze-coverage-wrapped-form (form)
> + (pcase form
> + ((or `(\` ,bq-form) `(\` . ,bq-form))
As above.
This bug report was last modified 7 years and 225 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.