Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debug] Lazily update frames of all threads in all-stop mode #7281

Merged
merged 1 commit into from
Mar 16, 2020

Commits on Mar 5, 2020

  1. [debug] Lazily update frames of all threads in all-stop mode

    A re-make of d1678ad.
    
    The changed bits:
    
    ```diff
    @@ -181,7 +196,17 @@ export class DebugThread extends DebugThreadData implements TreeElement {
             return [...result.values()];
         }
         protected clearFrames(): void {
    +        // Clear all frames
             this._frames.clear();
    +
    +        // Cancel all request promises
    +        this.pendingFetchCancel.cancel();
    +        this.pendingFetchCancel = new CancellationTokenSource();
    +
    +        // Empty all current requests
    +        this.pendingFetch = Promise.resolve([]);
    +        this._pendingFetchCount = 0;
    +
             this.updateCurrentFrame();
         }
         protected updateCurrentFrame(): void {
    ```
    
    So what's the difference? Well, if you got multiple stops fast enough,
    pending frames would be blocking the refresh from happening. Since
    `updateFrames` was being called from one more place (when switching
    thread), it forced me to avoid pointless lookups as to not error (GDB
    complains when you're trying to fetch something that has already been
    fetched). This new behavior that avoids pointless refreshes didn't
    take speed into account, and could potentially block an entirely new
    fetch.
    
    To fix this, I cancel all frame fetches when clearing frames (which is
    done when updating a thread in all-stop mode).
    
    Signed-off-by: Samuel Frylmark <samuel.frylmark@ericsson.com>
    sfrylmark committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    df21bd8 View commit details
    Browse the repository at this point in the history