-
Notifications
You must be signed in to change notification settings - Fork 56
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
Modified StDebuggerActionModel to use Exception>>defaultDescription… #414
base: Pharo13
Are you sure you want to change the base?
Changes from all commits
8b2a753
19f014f
a4e8527
1c1393b
2e6dd93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Extension { #name : #Halt } | ||
|
||
{ #category : #'*NewTools-Debugger' } | ||
Halt >> description [ | ||
(self signalContext receiver isKindOf: Exception) | ||
& (self signalContext selector = #signal) ifTrue: [ ^ 'Halt' ]. | ||
^ 'Halt in ', self signalContext asString. | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -351,7 +351,7 @@ StDebuggerActionModel >> stackOfSize: anInteger [ | |
{ #category : #context } | ||
StDebuggerActionModel >> statusStringForContext [ | ||
|
||
^ self contextPredicate printDescription | ||
^ self exception description | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't throw away context predicates like this. For example, it handles printing for post-mortems and halts. Plus, what you do is done in StDebuggerActionModel>>#contextSignalsAnException
...
and: [ aContext selector = #signal ] ] So, I would propose as a fix to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the comments. I think what is needed most is a set of additional test cases that clarify some of the intended behavior. Since I don't have a spec for the exception handling system, I can only code against guesses about what correct behavior should look like based on examples I find in the image, some of which seem like bugs, as you mention, and some of which I could not find in order to produce, such as any code that generates a post-mortem. Could you perhaps suggest some tests that clarify some of these issues and intended behaviors? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can add a test in which a debugger action model proceeds until it reaches a method with a Halt that uses For post-mortems, it is really hard to get one and I can't think of an easy way to do it. Generally, it happens when we materialize a stack that had been previously fueled out in a file. I don't think there are more cases than these ones and the ones you already cover in your tests. I don't know what @StevenCostiou thinks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I will try to get that working next time I have time to work on this. Would it be preferable to pull request just the tests, or is it preferred to have working code along with tests? I'm trying to get my contracts/type checking library working, but it is considerably less useful than it could be if the exceptions it throws can't describe the type error. |
||
] | ||
|
||
{ #category : #'debug - stepping' } | ||
|
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.
I think that this is bad.
#isKindOf:
is costly and the behavior can be reproduced by callingStDebuggerContextPredicate>>#printDescriptionPrefixOn:
. Using this method would also allow to handle post-mortems (which are just dead contexts: contexts that have already terminated in which we can't step anymore).Overriding
#description
in the classHalt
causes the debugger to displayHalt
when a breakpoint is hit, because the classBreak
inherits fromHalt
.From looking at the code of
StDebuggerActionModel>>#printHaltDescription:
, I would say that the fact that "Halt in" not being displayed by the debugger when executingHalt now
is a bug, so trying to reproduce it like that is not good.