Skip to content

Removing UIMnagaer dependencies from the debugger infrastructure#16015

Merged
Ducasse merged 6 commits intopharo-project:Pharo13from
StevenCostiou:15454-Exception-MUST-NOT-refer-to-UIManager-
Jun 19, 2024
Merged

Removing UIMnagaer dependencies from the debugger infrastructure#16015
Ducasse merged 6 commits intopharo-project:Pharo13from
StevenCostiou:15454-Exception-MUST-NOT-refer-to-UIManager-

Conversation

@StevenCostiou
Copy link
Collaborator

  • cleans the DebugSession
  • cleans Oups (almost, I did not touch two methods about warnings yet)

Debuggers are now responsible to handle specific backend requirements:

  • graphical debuggers cannot be used if the system is not in graphical mode
  • the spec debugger now asks its application backend to know if there are specific actions to take before opening

The PR alone kills the spec debugger.
The debugger can only work after a dedicated PR taking into account the modifications of this PR.

This PR should:

Instead, it asks all debugger if they can be opened, and debuggers now by default can open only if we're in graphical mode.
Debuggers that can open in headless (e.g.., loggers) have to redefine `handleDebugRequest:` and return an appropriate boolean.
Debugger using the core model should not care about the UI backend.
Copy link
Member

@guillep guillep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly much cleaner!

I'll put the PR as draft to avoid accidental merges :)

Comment on lines -93 to -100
self spawnNewUIProcessIfNecessary: aDebugRequest.
self ensureExceptionIn: aDebugRequest debugSession.

"Schedule the debugger opening in a deferred UI message to address redraw problems after opening a debugger e.g. from the testrunner."
debuggerOpeningStrategy := self debuggerSelectionStrategy.
self defaultUIManager defer: [
debuggerOpeningStrategy openDebuggerForSession:
aDebugRequest debugSession ].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you comment somewhere in the PR where is the code replacing this functionality? Is it in Spec? Somewhere else? is it WIP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it is there pharo-spec/NewTools#667
The spec debugger asks its application for the used backend, which in turn gives back a debug session specialized for that backend (Morphic or Gtk).
The specialized debug session is now handling the removed code that you pointed out.

It also means that if I want to create a new debugger, and if it should work with Morphic, I also have to ask the backend and the specialized session what to do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words: Morphic affairs are now Morphic affairs only.

@guillep guillep marked this pull request as draft January 23, 2024 13:46
@Ducasse
Copy link
Member

Ducasse commented Jan 24, 2024

This is really good to see some improvements there!
Thanks a lot.

@Ducasse
Copy link
Member

Ducasse commented Feb 4, 2024

@guillep @StevenCostiou is this ready to go?

@StevenCostiou
Copy link
Collaborator Author

This is too complicated and now we're frozen...
It will be for the early Pharo13

@Ducasse Ducasse changed the base branch from Pharo12 to Pharo13 June 13, 2024 07:25
@Ducasse Ducasse marked this pull request as ready for review June 13, 2024 07:25
@Ducasse
Copy link
Member

Ducasse commented Jun 13, 2024

I moved it to P13 and relaucnhed the tests

@StevenCostiou
Copy link
Collaborator Author

Thanks!
It is linked to pharo-spec/NewTools#667 which is now in conflict.
The good part is that the newtools changes may not be reqeuired anymore, I need to check.

@Ducasse
Copy link
Member

Ducasse commented Jun 19, 2024

All the tests are passing on windows so I will merge it.

@Ducasse Ducasse merged commit b446f7e into pharo-project:Pharo13 Jun 19, 2024
@StevenCostiou
Copy link
Collaborator Author

Thanks!
Last time I checked tests were not good :)
This is cool that everything is fixed.

@astares
Copy link
Member

astares commented Jun 20, 2024

Thanks for the rollback @jecisc

Looks like more work is required from @StevenCostiou

This change froze the image when you already have put a simple halt into your code or call a non-existing message on a class (leading to a DNU).

@jecisc
Copy link
Member

jecisc commented Jun 20, 2024

We were missing some code from NewTools. This should work now and the change is again present in the image

@StevenCostiou
Copy link
Collaborator Author

Thanks for the rollback @jecisc

Looks like more work is required from @StevenCostiou

This change froze the image when you already have put a simple halt into your code or call a non-existing message on a class (leading to a DNU).

Not really, it was written on the PR description: do not merge!
It was waiting for a new tools change, that we integrated earlier this afternoon.

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

Successfully merging this pull request may close these issues.

DebugSession MUST NOT refer to UIManager

5 participants