Skip to content

add C utility for debugging symbol tables, under #if 0 #109390

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

Closed
carljm opened this issue Sep 14, 2023 · 1 comment
Closed

add C utility for debugging symbol tables, under #if 0 #109390

carljm opened this issue Sep 14, 2023 · 1 comment
Assignees

Comments

@carljm
Copy link
Member

carljm commented Sep 14, 2023

In flowgraph.c we have some C functions for dumping instructions and basicblocks as text. These are under #if 0 by default, so effectively comments, but they can be very useful to uncomment and use when debugging a tricky compiler issue.

I recently had to debug a symbol table problem, and I wrote a similar function to (recursively) dump a symbol table and its children to a text representation. I propose that we also include this in the source tree, under #if 0 just like the compiler equivalent, to save time for future debuggers.

The Python symtable module does not fill this need, since you can't use it if the symbol table bug is preventing compilation from even completing.

cc @JelleZijlstra

Linked PRs

@carljm carljm self-assigned this Sep 14, 2023
carljm added a commit to carljm/cpython that referenced this issue Sep 14, 2023
carljm added a commit that referenced this issue Sep 20, 2023
csm10495 pushed a commit to csm10495/cpython that referenced this issue Sep 28, 2023
@hugovk
Copy link
Member

hugovk commented Nov 9, 2023

Closing as PR merged, thanks!

@hugovk hugovk closed this as completed Nov 9, 2023
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
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

No branches or pull requests

2 participants