pyOCD icon indicating copy to clipboard operation
pyOCD copied to clipboard

Fixed bug in dap.py - local call of function overwritten the input pa…

Open Gargy007 opened this issue 3 years ago • 1 comments

Hello, I found bad hadling of now parameter in dap.py read_ap_multiple method.

Hope that this will be useful.

Gargy007 avatar Aug 17 '20 08:08 Gargy007

Hi @Gargy007 , did you see an issue caused by the original code? It was intentionally written that way so that the call to self.probe_read_ap_multiple() always returns a result callback, which then is always invoked in read_ap_multiple_cb(). The point is to a) simplify the number of code paths, b) ensure that the returned read callback is wrapped in the exception handler in read_ap_multiple_cb() when it is executed (so _handle_error() is called on an exception).

However, I could have certainly made a mistake! In any case, I really appreciate you contributing. 😄

flit avatar Aug 20 '20 22:08 flit