This is an automated email from Gerrit.

"Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>" just uploaded a new patch 
set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8908

-- gerrit

commit 5caa5be48df46e8ba32ff179005bb9f16bf9853a
Author: Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>
Date:   Mon Mar 31 12:36:36 2025 +0300

    helper/command: don't stop polling under `capture`
    
    The call to `jtag_poll_mask()` was introduced in
    commit 1abc26d7a2b7172184c64d2151bf4803699993da ("helper: fix flaky
    capture command").
    The reasoning was: output from polling could overwrite TCL command's
    result.
    However, commit 2c8c2cb6b1426afc73519a7445a71a0aed36cf0f ("command:
    Prepend logs during command capture") changed the behavior, so that the
    result is appended to the output and does not overwrite it.
    Therefore, there is no point in disabling polling when capturing output.
    
    Moreover, diabling polling may cause a change in behavior, e.g.:
    * A target is using semihosting.
    * `sleep 10000` results in a number of semihosting calls being
      handled due to `target_type::poll` being called approx. every
      `polling_interval` ms.
    * `capture {sleep 10000}` used to result in at most one call to
      `target_type::poll` by `target_call_timer_callbacks()` in
      `jim_command_dispatch()`.
    
    Change-Id: Ic0d1990361a5f1c48f9e88e1560a7927ba8fb577
    Signed-off-by: Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>

diff --git a/src/helper/command.c b/src/helper/command.c
index 218f0581ef..f90cbe86c3 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -635,14 +635,6 @@ COMMAND_HANDLER(handle_command_capture)
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       /* disable polling during capture. This avoids capturing output
-        * from polling.
-        *
-        * This is necessary in order to avoid accidentally getting a non-empty
-        * string for tcl fn's.
-        */
-       bool save_poll_mask = jtag_poll_mask();
-
        log_add_callback(tcl_output, &state);
 
        int jimretval = Jim_EvalObj(CMD_CTX->interp, CMD_JIMTCL_ARGV[0]);
@@ -650,8 +642,6 @@ COMMAND_HANDLER(handle_command_capture)
 
        log_remove_callback(tcl_output, &state);
 
-       jtag_poll_unmask(save_poll_mask);
-
        if (state.output && *state.output)
                command_print(CMD, "%s", state.output);
 

-- 

Reply via email to