Skip to content

bug: debugger should signal on completion to avoid overfetching when buffering close to the end #846

Description

@goldfish088

Describe the bug

Image

To Reproduce

Use this C program and debug until around appending the 4th node, then click play to buffer next set of debug states.

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

struct node {
    int val;
    struct node *next;
};

struct node *append(struct node *root, int val) {
    if (root == NULL) {
        struct node *ret = malloc(sizeof(struct node));
        ret->val = val;
        ret->next = NULL;
        return ret;
    }
    
    root->next = append(root->next, val);
    return root;
}

int main(void) {
    int N = 5;
    struct node *n = NULL;
    
    for (int i = 0; i < N; ++i) {
        n = append(n, i+1);
    }
}

Expected behavior

If buffering tries to fetch more debug steps than remaining in program execution, then it should not error lol

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Additional context
Add any other context about the problem here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions