Skip to content

C++: Support printing of global and namespace variables in PrintAST #13775

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

Merged
merged 5 commits into from
Jul 26, 2023

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Jul 19, 2023

Also rename shouldPrintFunction to shouldPrintDeclaration, as an initial step towards this.

@jketema jketema force-pushed the print-global branch 2 times, most recently from 74ebdae to e69bec1 Compare July 20, 2023 09:43
A configuration should always exist, because it does not have a charpred
that could prevent this.
@jketema jketema marked this pull request as ready for review July 25, 2023 12:10
@jketema jketema requested review from a team as code owners July 25, 2023 12:10
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, but otherwise this LGTM!

@MathiasVP
Copy link
Contributor

Also: I assume you tried this locally and double checked the that performance is fine on a non-trivial database? I remember we've had issues in the past with these VSCode-related queries not being tested on DCA and not noticing a join-order issue.

@jketema
Copy link
Contributor Author

jketema commented Jul 25, 2023

Also: I assume you tried this locally and double checked the that performance is fine on a non-trivial database? I remember we've had issues in the past with these VSCode-related queries not being tested on DCA and not noticing a join-order issue.

Good point. I tried this on one file in one database, but maybe I should do a bit more extensive testing. Do you have any suggestions for a database/files on which I should try this?

@MathiasVP
Copy link
Contributor

Good point. I tried this on one file in one database, but maybe I should do a bit more extensive testing. Do you have any suggestions for a database/files on which I should try this?

If I were to point to a really evil file I'd point you to https://raw.githubusercontent.com/wireshark/wireshark/master/epan/dissectors/packet-rrc.c (which exists in the Wireshark DB you can download from DCA) 😄.

@jketema
Copy link
Contributor Author

jketema commented Jul 25, 2023

Good point. I tried this on one file in one database, but maybe I should do a bit more extensive testing. Do you have any suggestions for a database/files on which I should try this?

If I were to point to a really evil file I'd point you to https://raw.githubusercontent.com/wireshark/wireshark/master/epan/dissectors/packet-rrc.c (which exists in the Wireshark DB you can download from DCA) 😄.

Either with and without the change VSCode is not able to render the file:

Reading bqrs data failed with args:
    bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set nodes /var/folders/ls/pjlfr1pd7_lfd3zkf6bs1rl00000gn/T/queries_-53148-B7zLvImBA6GV/contextual-query-storage/printAst.ql-l2Kn-8kMvGRFEfKAt60ZJ/results.bqrs
Error: Cannot create a string longer than 0x1fffffe8 characters (codeQL.viewAstContextEditor)

The time it takes to get to that point is roughly similar

@MathiasVP
Copy link
Contributor

Ah, yes. That's a VSCode issue I guess 😭

@jketema
Copy link
Contributor Author

jketema commented Jul 26, 2023

Ah, yes. That's a VSCode issue I guess 😭

I've tried this on some other files in the same Wireshark directory. The speed doesn't seem to have changed significantly on those files.

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jketema jketema merged commit a4a4926 into github:main Jul 26, 2023
@jketema jketema deleted the print-global branch July 26, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants