devsoc-unsw / devsoc-unsw/structs.sh
bug: debugger should signal on completion to avoid overfetching when buffering close to the end
- Dominant language
- TypeScript
- Stars
- 40
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
**To Reproduce**
Use this C program and debug until around appending the 4th node, then click play to buffer next set of debug states.
```c
#include
#include
#include
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.
**Additional context**
Add any other context about the problem here.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with the provided C program: debug until around the fourth appended node, click play, and observe buffering near program completion. Trace the debugger's buffering and completion flow; done means fetching beyond the remaining debug steps signals completion cleanly instead of producing an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100