Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

How to: create a variable usage trail? #832

Open
PhilipOakley opened this issue Dec 5, 2019 · 0 comments
Open

How to: create a variable usage trail? #832

PhilipOakley opened this issue Dec 5, 2019 · 0 comments

Comments

@PhilipOakley
Copy link

I'm looking for a 'how to' on creating a usage trail for a variable (in this case a config variable), which is currently of a too small type (32bit when 64 bit needed for large file addressing). I then need to patch all usages, which can be tortuous to check.

The "Custom Trail" looks to be what I want but I can't determine how to do that when the trail/trace needs to be via the assignments and comparison expressions.

Can Sourcetrail currently (automatically) follow variable usage, even across a single assignment / comparison / function reference /or (miss?-)use in an expression?

If Source trail cannot currently do the trace can the capability be added to the future features list?


My use case: I am trying to get the Git-for-Windows code to accept >4Gb file sizes.

The historic Windows policy was that 'long' would stay as 32bits for continuity with older programs, and that 'long long' was invented (~special to Windows) as an integer type for 64bits. Also the 'size_t` type would be available as the 64bit addressing type (implementation defined, hence careful portability issues).

The Linux Git usage is much simpler long, like pointer addressing changes to 64 bits in unison, so the code ports without incident, leaving Windows users with a 4Gb file size limit (Ok, Git wasn't designed for really large files but folk do use it...)

I'm looking to trace all the usages of say the config variable big_file_threshold, (and other variables it interacts with an equality of type expectation) through the call stack, including comparisons. One cannot trust (implementation defined) that inappropriate coercions happen, so the change to size_r needs to roll through the code. Hopefully Sourcetrail can/will help.

My Sourcetrail project is at https://github.com/PhilipOakley/git/tree/SourcetrailOption2/Sourcetrail and expects (for database regeneration) Visual Studio community edition 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant