Skip to content
New issue

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

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

Already on GitHub? # to your account

Add column numbers to stack traces #149

Closed
bnoordhuis opened this issue Nov 28, 2023 · 2 comments · Fixed by #193
Closed

Add column numbers to stack traces #149

bnoordhuis opened this issue Nov 28, 2023 · 2 comments · Fixed by #193
Labels
enhancement New feature or request

Comments

@bnoordhuis
Copy link
Contributor

quickjs currently only records the line number. Also record the column.

Needs (hopefully) minor tweaks to the token parser and the pc2line RLE data structure that's attached to JSFunctionDef and JSFunctionBytecode objects.

Refs: #134 (comment)

@bnoordhuis bnoordhuis added the enhancement New feature or request label Nov 28, 2023
@ammarahm-ed
Copy link
Contributor

ammarahm-ed commented Nov 28, 2023

For reference this was previously implemented here openwebf/quickjs#12, openwebf/quickjs#1 and some other PRS for quickjs.

@ammarahm-ed
Copy link
Contributor

bnoordhuis added a commit to bnoordhuis/quickjs that referenced this issue Dec 9, 2023
And:
- display them in stack traces
- expose them as Function.prototype.columnNumber

OP_line_num is renamed to OP_source_loc and the pc2line data structure
is extended with the column number in zigzag encoding.

The bytecode version number BC_VERSION is incremented because pc2line
data is read and written by JS_ReadObject() and JS_WriteObject() when
it is present.

Fixes: quickjs-ng#149
bnoordhuis added a commit to bnoordhuis/quickjs that referenced this issue Dec 11, 2023
And:
- display them in stack traces
- expose them as Function.prototype.columnNumber

OP_line_num is renamed to OP_source_loc and the pc2line data structure
is extended with the column number in zigzag encoding.

The bytecode version number BC_VERSION is incremented because pc2line
data is read and written by JS_ReadObject() and JS_WriteObject() when
it is present.

Fixes: quickjs-ng#149
bnoordhuis added a commit to bnoordhuis/quickjs that referenced this issue Dec 11, 2023
And:
- display them in stack traces
- expose them as Function.prototype.columnNumber

OP_line_num is renamed to OP_source_loc and the pc2line data structure
is extended with the column number in zigzag encoding.

The bytecode version number BC_VERSION is incremented because pc2line
data is read and written by JS_ReadObject() and JS_WriteObject() when
it is present.

Fixes: quickjs-ng#149
bnoordhuis added a commit that referenced this issue Dec 11, 2023
And:
- display them in stack traces
- expose them as Function.prototype.columnNumber

OP_line_num is renamed to OP_source_loc and the pc2line data structure
is extended with the column number in zigzag encoding.

The bytecode version number BC_VERSION is incremented because pc2line
data is read and written by JS_ReadObject() and JS_WriteObject() when
it is present.

Fixes: #149
bluesky950520 pushed a commit to bluesky950520/quickjs that referenced this issue Mar 14, 2025
And:
- display them in stack traces
- expose them as Function.prototype.columnNumber

OP_line_num is renamed to OP_source_loc and the pc2line data structure
is extended with the column number in zigzag encoding.

The bytecode version number BC_VERSION is incremented because pc2line
data is read and written by JS_ReadObject() and JS_WriteObject() when
it is present.

Fixes: quickjs-ng/quickjs#149
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants