Skip to content
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

Union/Structure Analysis #3

Open
Theldus opened this issue Nov 22, 2019 · 0 comments
Open

Union/Structure Analysis #3

Theldus opened this issue Nov 22, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Theldus
Copy link
Owner

Theldus commented Nov 22, 2019

Description

PBD lacks structures and unions analysis at the moment. Since structures could go arbitrarily deep (like a tree of structs) the dwarf analysis must be changed to accommodate these changes and, at the moment, the inner code -- that does the dwarf analysis -- do not have the proper data structure to handle this.

Some proposed approaches:
1. Recursively parses the structure and for each base type found add into the variables list (as a common variable, instead of a structure item) with the proper variable location calculated too. This approach is 'reasonably' good: 1) require 'few' changes in dwarf analysis stage and 2) requires no changes (or very few) in the variables check stage.

Although good, since each variable member is dealt with as a simple variable, a huge structure could be penalized in terms of performance.

2. During dwarf analysis: create an auxiliary data structure that holds each variable location and uses it in the variable check stage. Although this method requires more change in both (dwarf and variable check) stages, this approach can lead to a more performative code since the entire structure could be scanned as a 'huge' single type, and in case of changes, the offset is searched in this auxiliary data structure.

*Unions analysis implies all the above statements and also: how can I format the output on the screen? If a union holds multiples data types, what data type should be used?

Anyways, any help in that sense is welcome, ;-).

@Theldus Theldus added enhancement New feature or request help wanted Extra attention is needed labels Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant