You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for making Semcode. The query program is super useful when working with the Linux kernel.
Is there a way to find where members of a C struct are referenced in a Semcode-indexed codebase?
For example, in the Linux kernel, there's the struct rt_mutex_base type, which looks like this:
I want to find all places in the kernel where the rt_mutex_base waiters member is referenced.
Using regular old grep, we can of course search for functions that use rt_mutex_base and then further filter the results for functions that contain .waiters or ->waiters. However, this can be tedious if there's lots of results, and can return false positives too.
For example, consider if there was some function like this:
This would get caught in the grep search, because it contains a reference to struct rt_mutex_base and ->waiters. However, this isn't what we want, because it doesn't specifically reference struct rt_mutex_base's waiters member.
Is there some way Semcode can find all references to struct rt_mutex_base::waiters specifically?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Thank you for making Semcode. The query program is super useful when working with the Linux kernel.
Is there a way to find where members of a C struct are referenced in a Semcode-indexed codebase?
For example, in the Linux kernel, there's the
struct rt_mutex_basetype, which looks like this:I want to find all places in the kernel where the rt_mutex_base
waitersmember is referenced.Using regular old grep, we can of course search for functions that use
rt_mutex_baseand then further filter the results for functions that contain.waitersor->waiters. However, this can be tedious if there's lots of results, and can return false positives too.For example, consider if there was some function like this:
This would get caught in the grep search, because it contains a reference to
struct rt_mutex_baseand->waiters. However, this isn't what we want, because it doesn't specifically referencestruct rt_mutex_base'swaitersmember.Is there some way Semcode can find all references to struct
rt_mutex_base::waitersspecifically?Beta Was this translation helpful? Give feedback.
All reactions