Skip to content

How to check if Hermes bytecode bundle contains debug info? #1129

Answered by tmikov
krystofwoldrich asked this question in Q&A
Discussion options

You must be logged in to vote

This all actually has logic behind it.

-g0 should never be used. It is there for completeness and testing. It emits no location information of any kind.

-g1, which is the default, emits only enough information to generate stack traces. This information is restricted only to locations where an exception can be thrown (this is done to minimize the size of the bundle). Naturally, with -g1 there is no information about locations of function declarations. -g1 produces the default behavior one expects from a JS engine - stack traces with locations.

-g2 emits information for all locations. If you use -g2, getFunctionLocation() will return line and column. Of course, the bundle will be larger.

-g3

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@krystofwoldrich
Comment options

@tmikov
Comment options

@krystofwoldrich
Comment options

Answer selected by krystofwoldrich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants