-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add support for SeparatedCode symbols. #622
Conversation
Codecov Report
@@ Coverage Diff @@
## master #622 +/- ##
==========================================
- Coverage 69.19% 69.13% -0.06%
==========================================
Files 84 84
Lines 16873 16883 +10
==========================================
- Hits 11675 11672 -3
- Misses 5198 5211 +13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
As you mention changes to the symcache size / number of functions:
We currently uniquely identify functions by their name and entry_pc
/ address.
The growth in number of functions you observe is thus duplicates with a "bogus" entry_pc
.
The intention of Function::address
, and entry_pc
as we persist it into the symcache was to give, well, the entry point of the function, as you would call it from other code. Thats why we already have duplicates for inline functions. We may have one "unique function" for the non-inlined version with its "real" entry_pc
. Plus another value for the inlined version for which we set the entry_pc
to a sentinel value that says "has none".
Do you think that makes sense in general?
And specific to this change: What does address
mean in this case for such split functions (which I guess pdb calls SeparatedCode). Can you actually properly call
these with their address
? Or are they missing the normal function prolog/epilog?
Oh, interesting, I didn't know about
I see. But isn't this a mixing of two very different concerns?
These two questions seem to have very different areas of application. For my purposes, I am only ever interested in the first, never in the second. If I was interested in the second, then the address wouldn't be enough, I'd also need to know calling convention / parameter types / etc.
Sure, I guess? You can't call "inlined" functions so it makes sense to give them a value of None. But I can't really say more unless I know what people are using
I don't know for sure but I strongly suspect that they're missing prolog / epilog and you can't call them. |
The idea of Speaking of split functions: Is it guaranteed that the split code is always "higher"/"after" the entry point? I wonder if we can assume that this offset is always positive? Thats a question for both pdb and dwarf though. |
Oh, of course! For things like I'm even using that exact field in the profiler! I totally forgot. I use it to collect a list of symbol addresses. And this list of symbol addresses, or ideally symbol "address ranges", is what I'm planning to use in the upcoming assembly view in the profiler:
For this purpose, I think having multiple
I don't know, but I would be surprised if there was such a guarantee. For example I could imagine that the linker might want to reorder your functions sometimes, without much care for which functions belong together. |
I would assume as much, yes :-( So for split top-level functions, you would most likely really have the offset relative to that chunk of code. No matter if it is a "real" function with prolog etc that you So for the use-case of "show me the surrounding asm code", you would really want the complete addr range and not only the |
SeparatedCode symbols usually directly follow their associated Procedure
symbol. They describe a part of the function that has been extracted out
and moved to a separate place. They come with their own set of line
information and can be treated very similarly to regular functions.
The impact of this patch can be tested on a combase.pdb from the
Microsoft symbol server:
Before this patch:
(wrong symbol)
After this patch:
The symcache for combase.pdb grows from 10.6 MB to 11 MB, and from
having 28844 functions to having 31194 functions.