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

Provide typedef names of anonymous structs/unions where appropriate #17

Open
hainest opened this issue Sep 21, 2021 · 0 comments
Open
Labels

Comments

@hainest
Copy link
Collaborator

hainest commented Sep 21, 2021

typedef struct { int x; } Foo;
void foo(Foo f) {}

Smeagle produces

{
 "library": "libtest.so",
 "locations":
 [
   {
    "function": {
      "name": "_Z3foo3Foo",
      "parameters": [
        {
          "name":"f",
          "type":"{anonymous struct at /home/tim/workspace/Smeagle/abi-examples/test.cpp:19}",
          "class":"Struct",
          "location":"%rdi",
          "direction":"import",
          "size":"4",
          "fields": [
           {
             "name":"x",
             "type":"int",
             "class":"Scalar",
             "size":"4"
           }]
        }
    ]
   }}
]
}

We should try to check if a struct/union is anonymous and, where possible, assign its type name as the name of the typedef. Not all anonymous structs/unions are created via a typedef, so they may just have no name at all.

@mplegendre mplegendre added the low label Jan 13, 2022
@vsoch vsoch transferred this issue from buildsi/Smeagle Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants