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

The debugger action model is not updated automatically, needs refactoring #367

Closed
adri09070 opened this issue May 4, 2022 · 6 comments · Fixed by #368 or #399
Closed

The debugger action model is not updated automatically, needs refactoring #367

adri09070 opened this issue May 4, 2022 · 6 comments · Fixed by #368 or #399
Labels
debugger enhancement New feature or request

Comments

@adri09070
Copy link
Contributor

When an instance of StDebugger is notified with an event, the debugger action model is not updated automatically. This is the case, when it is notified that the session's state has changed, or when a new method has been created. For instance:

updateStep
	self flag: #DBG_UPDATE_OF_MODEL_SHOULD_BE_AUTOMATED.
	debuggerActionModel updateTopContext.
	debuggerActionModel updateContextPredicate.	
	debuggerActionModel updateDebugSession.
		
	self updateStackFromSession: self session.
	self updateWindowTitle.
	self updateExtensionsFrom: self session.	
	self updateToolbar.
	self flag: #DBG_INSPECTOR_UPDATE_BUG.
	inspector getRawInspectorPresenterOrNil ifNotNil: [ :p | p update ]

This is a problem because the debugger action model is part of the debugger's logic, so it should be able to exist without a GUI.

Furthermore, the session is encapsulated in a session holder, through which the debugger accesses the session. However, it is not needed as the debugger action model can now access the session, so it could notify the GUI when the session has changed. As a result, all session events and system announcement events should be moved to the action model so that it can update automatically.

To finish with, each session event triggers the call of a specific method but all these methods call the same method: updateStep. For instance:

updateStepInto
	self updateStep

Methods like these are unused hooks so they can be removed in the process of the refactoring

@adri09070
Copy link
Contributor Author

Is it possible to reopen this issue and the associated PR or do I have to create new ones ? @MarcusDenker

@MarcusDenker MarcusDenker reopened this Jul 20, 2022
@MarcusDenker
Copy link
Contributor

Issue is easy to re-open, for the PR I think one needs to redo it (as it was merged and then un-done)

@adri09070
Copy link
Contributor Author

adri09070 commented Jul 20, 2022

I'm confused because now, I can't do another PR because GitHub says that my branch is not ahead of Pharo-spec:Pharo11... But you reverted the changes so, it should be ahead

What can I do to do a new PR with the same commits as the other one ?

@adri09070
Copy link
Contributor Author

adri09070 commented Jul 20, 2022

I discovered that we can checkout branch and revert the revert and create a new PR with that...

But there will only be one commit instead of all commits I initially had

@MarcusDenker
Copy link
Contributor

ah, good. I guess losing the intermediate commits is not that of a problem (I think there is even a style arguing that every PR should be one commit and intermediates should be merged)

@adri09070
Copy link
Contributor Author

Ok, I'll do it then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger enhancement New feature or request
Projects
Archived in project
2 participants