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

Can't debug block local variables in GT debugger #1044

Closed
seandenigris opened this issue Aug 3, 2015 · 4 comments
Closed

Can't debug block local variables in GT debugger #1044

seandenigris opened this issue Aug 3, 2015 · 4 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 1044

Describe the problem: what do you get? what do you expect?
In the GT Debugger, when you debug a block with a local variable; you can't read its
value because the variable is unknown...

How to reproduce the problem: step by step if necessary
Write in a Workspace : 
1 = 1 ifTrue: [ |local | local := 1 ]

Debug It!

Use the through button to go into the block.

Try to inspect the local variable.

Additional information: platform, context which may impact the problem

Moose 5.0 latest - Ubuntu 13.10 - x64

Please fill in the labels with the following information:
* Type-Defect
* Component-GT-Debugguer
* Milestone-5.0

Reported by v.blondeau92 on 2014-02-05 14:13:03

@seandenigris
Copy link
Contributor Author

Thanks for the report.

I could reproduce it on your example:
1 = 1 ifTrue: [ 
    |local | 
    local := 1 halt ]

However, on a regular block case, it works fine:
[ |local | local := 1 halt ] value.

Also, if you define the variable outside of the block, it also works fine:
|local | 
1 = 1 ifTrue: [ local := 1 halt ]

Strange. Could it be related to an ifTrue: special handling?

Reported by tudor@tudorgirba.com on 2014-02-06 07:50:46

  • Labels added: Component-GlamorousToolkit

@seandenigris
Copy link
Contributor Author

I think so. Because the block in the ifTrue: is inlined at the compilation...

ifTrue: alternativeBlock 
    "Answer the value of alternativeBlock. Execution does not actually 
    reach here because the expression is compiled in-line."

    ^alternativeBlock value

So the block doesn't exists really at debugging time. 

Reported by v.blondeau92 on 2014-02-06 09:40:26

@seandenigris
Copy link
Contributor Author

This bug also appears with the standard debugger from Pharo 3 and I guess it's a combination
of two things:
- ifTrue: is inlined
- the debugger does not recognize variables from the workspace (https://pharo.fogbugz.com/f/cases/12432)

I'll open a bug report on the Pharo issue tracker.

Reported by chisvasileandrei on 2014-02-08 14:30:10

@seandenigris
Copy link
Contributor Author

This should be handled in the context of Pharo. I close it here.

Reported by tudor@tudorgirba.com on 2014-10-09 05:23:01

  • Status changed: Duplicate

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

1 participant