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

Primitive and inlined methods do not show up in context trace #79

Open
BraunTom opened this issue Jun 14, 2022 · 1 comment
Open

Primitive and inlined methods do not show up in context trace #79

BraunTom opened this issue Jun 14, 2022 · 1 comment

Comments

@BraunTom
Copy link

When using the Trace Debugger some methods (mostly unary methods and methods chained to them) do not show up.

For example if you execute
[Parser new parse: #parseSelector class: Parser] traceAndDebug.

at some point you get:
Screenshot 2022-06-14 at 21 26 56

sourceStream does not show up although expected (maybe a problem is that sourceStream is an immediate return?).

If one method is ignored chained methods will get ignored too. Expected would be that they are shown in the trace.
For the same example as above (but for a slightly different location in the method):
Screenshot 2022-06-14 at 22 04 12

I hope I did not overlook anything

@LinqLover
Copy link
Collaborator

Thanks a lot for your feedback! 🚀

Indeed, sourceStream is not displayed in the trace because it is a quick return method. In its current design, the trace only records methods that are actually reached by the debugger (in a normal debugger, you would not see this method either) - technically, quick return methods are implemented as a primitive and are not actually activated with a context frame. But there is already #43 for enhancing the trace with stub entries for methods of this kind.

If one method is ignored chained methods will get ignored too. Expected would be that they are shown in the trace. For the same example as above (but for a slightly different location in the method): Screenshot 2022-06-14 at 22 04 12

Are you referring to #and: here? I don't think is related to message chains - but this is another peculiarity/optimization detail of the Squeak bytecode model: Certain messages such as #ifNil: or #and: are not actually compiled to message sends but to special bytecodes:

image

So again, there is no method activation that could be traced - in the normal debugger, you cannot step into #and: as well. Theoretically, one could try to de-optimize the bytecode during tracing, but since this also would impact the performance, I'm not sure about this trade-off so far ... What is your opinion on this? :-)

@LinqLover LinqLover changed the title Some methods do not show up Some methods do not show up in context trace Jun 14, 2022
@LinqLover LinqLover changed the title Some methods do not show up in context trace Primitive and inlined methods do not show up in context trace Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants