Skip to content

Recursion tree: show a node's value next to its name - #36

Merged
sumnoon merged 1 commit into
mainfrom
feat/node-values
Sep 28, 2026
Merged

sumnoon merged 1 commit into
mainfrom
feat/node-values

Conversation

@sumnoon

@sumnoon sumnoon commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Problem

A call that takes a node pointer was labelled with the heap object's name only, e.g. pre_order(a3). To know which node a3 was, you had to open Memory. It also hid bugs: in this pre-order program the constructor does val = val;, a self-assignment, so no val was ever set, and the tree gave no hint of it.

Change

Pointer arguments and pointer return values now show the object's first plain (non-pointer) field after its name:

  • pre_order(a3:1) → pre_order(a4:2) → pre_order(a6:3), then pre_order(a5:4) for the tree 1(2(3), 4)
  • with the buggy constructor: pre_order(a3:-1163005939), the Windows debug heap's 0xBAADF00D fill, visible straight away

Values longer than 11 characters are dropped, and the label falls back to the name alone. The name stays because it matches the Memory tab.

Checks

  • Traced the program as written and with this->val = val: labels as above, with the sticky note and breadcrumb using the same text.
  • tsc, npm run build and the 13 Node tests pass.

docs/usage.md describes the label.

🤖 Generated with Claude Code

A pointer argument or return value was labelled with the heap object's
name only (pre_order(a3)), so telling which node a call was on meant
opening Memory. Labels now add the object's first plain field, such as
val or data: pre_order(a3:1). Values over 11 characters are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sumnoon
sumnoon merged commit c75f2ea into main Sep 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant