-
Notifications
You must be signed in to change notification settings - Fork 35
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
Dumping and checking struct definitions that are not directly used as function arguments #31
Comments
Hello! Is it optimized out from the binary by the compiler? |
Good question! I am not even sure if the struct definition will appear in the binary. From my understanding, the information about the struct members should come from the struct definition in the header file, right? |
It is not part of the stripped binary. But I mean the binary with debug-info (extra Let's check this by:
|
If it's not part of the debug-info then |
Thanks! I think we are on the right track. I checked the content of the DEBUG_DUMP and the struct that is passed as
I'll investigate the gcc options to see if there is anything useful there. |
This looks promising: Source: https://stackoverflow.com/questions/35324109/gdb-see-unused-struct-typedef Let me run some test and I'll get back to you. |
It works for me. Probably we need to add this option to abi-dumper documentation near the |
Good idea! That would be very useful for future reference. |
Hello and thanks a lot for developing this great set of tools!
I am using this to check a C library that exposes a large number of symbols in its public interface.
Some of these symbols are struct definitions that are not directly used in any of the public functions.
For example, in one of my header files I have the following:
The type of
void *o
depends on the value of the first argumenttype
. Thestruct data
is one of the possible argument types and it will be casted inside the function.The problem is that non-backward compatible changes to
struct data
are not detected and flagged as error by the tool. In fact, it looks likestruct data
is not even part of the dump.So far I tried to add the options
-all -dump-static
to the abi-dumper as well as-ext
to the abi-compliance-checker. However these do not seem to work.The only way to detect these changes is to add a dummy function that explicitly takes an argument of type
struct data
.This is not very friendly and convenient to use. Is there any other option that I should try?
Thanks!
The text was updated successfully, but these errors were encountered: