VDBBreakpointListApplication.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 26 Jul 2022 15:01:33 +0100
changeset 265 f2470f0dd9cd
parent 264 23960fcb9dac
permissions -rw-r--r--
Do not show address for (pseudo) instructions with no code While such instructions do not appear in GDB-produced disassembly, they may appear in some manually-generated instruction lists. One example of such (pseudo) instruction is label.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021-2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

VDBAbstractTreeApplication subclass:#VDBBreakpointListApplication
	instanceVariableNames:'selectedBreakpointHolder'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Others'
!

!VDBBreakpointListApplication class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021-2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
! !

!VDBBreakpointListApplication class methodsFor:'accessing'!

defaultWindowTitle
    ^ self resources string: 'Breakpoints'

    "Created: / 11-07-2017 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 03-10-2018 / 15:39:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:VDBBreakpointListApplication andSelector:#windowSpec
     VDBBreakpointListApplication new openInterface:#windowSpec
     VDBBreakpointListApplication open
    "

    <resource: #canvas>

    ^ 
    #(FullSpec
       name: windowSpec
       uuid: 'bd3ef320-8c37-11e9-a7d4-606720e43e2c'
       window: 
      (WindowSpec
         label: 'VDBAbstractListApplication'
         name: 'VDBAbstractListApplication'
         uuid: '475530e1-4fae-11e9-b432-606720e43e2c'
         min: (Point 10 10)
         bounds: (Rectangle 0 0 300 577)
       )
       component: 
      (SpecCollection
         collection: (
          (VariableVerticalPanelSpec
             name: 'VariableVerticalPanel1'
             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
             uuid: '475530e2-4fae-11e9-b432-606720e43e2c'
             showHandle: true
             snapMode: both
             handlePosition: left
             component: 
            (SpecCollection
               collection: (
                (TransparentBoxSpec
                   name: 'ListBox'
                   uuid: 'bd3ef321-8c37-11e9-a7d4-606720e43e2c'
                   component: 
                  (SpecCollection
                     collection: (
                      (HierarchicalListViewSpec
                         name: 'Breakpoints'
                         layout: (LayoutFrame 0 0 0 0 0 1 0 1)
                         uuid: '475530e3-4fae-11e9-b432-606720e43e2c'
                         model: internalSelectionHolder
                         menu: contextMenu
                         hasHorizontalScrollBar: true
                         hasVerticalScrollBar: true
                         listModel: internalListHolder
                         useIndex: false
                         highlightMode: line
                         doubleClickSelector: doDoubleClick
                         showLines: false
                         useDefaultIcons: false
                         showRoot: false
                         postBuildCallback: postBuildInternalListView:
                       )
                      )
                    
                   )
                 )
                (SubCanvasSpec
                   name: 'BreakpointCanvas'
                   uuid: '475557f0-4fae-11e9-b432-606720e43e2c'
                   hasHorizontalScrollBar: false
                   hasVerticalScrollBar: false
                   majorKey: VDBBreakpointApplication
                   subAspectHolders: 
                  (Array
                     
                    (SubChannelInfoSpec
                       subAspect: breakpointHolder
                       aspect: selectedBreakpointHolder
                     ) 
                    (SubChannelInfoSpec
                       subAspect: debuggerHolder
                       aspect: debuggerHolder
                     )
                   )
                   createNewApplication: true
                   createNewBuilder: false
                 )
                )
              
             )
             handles: (Any 0.5 1.0)
           )
          )
        
       )
     )
! !

!VDBBreakpointListApplication class methodsFor:'plugIn spec'!

aspectSelectors
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this. If it is corrupted,
     the UIPainter may not be able to read the specification."

    "Return a description of exported aspects;
     these can be connected to aspects of an embedding application
     (if this app is embedded in a subCanvas)."

    ^ #(
        #debuggerHolder
      ).

! !

!VDBBreakpointListApplication class methodsFor:'startup-web applications'!

initialPageSpec
    "this is only required for web-applications"

    ^ self shouldImplement
!

pageSpecs
    "this is only required for web-applications"

    ^ self shouldImplement
! !

!VDBBreakpointListApplication methodsFor:'aspects'!

selectedBreakpointHolder
    "return/create the 'selectedBreakpointHolder' value holder (automatically generated)"

    selectedBreakpointHolder isNil ifTrue:[
        selectedBreakpointHolder := ValueHolder new.
    ].
    ^ selectedBreakpointHolder
!

selectedBreakpointHolder:aValueModel
    "set the 'selectedBreakpointHolder' value holder (automatically generated)"

    selectedBreakpointHolder := aValueModel.
! !

!VDBBreakpointListApplication methodsFor:'change & update-delayed'!

delayedUpdateInternalList
    | root list |

    debugger isNil ifTrue:[
        self internalListHolder root children:#().
        ^ self.
    ].  
    root := self internalListHolder root.
    list := debugger breakpoints collect:[:b | VDBBreakpointPresenter new setBreakpoint: b; parent: root ].
    root children:list.
    root expand.
    self delayedInvalidateInternalList

    "Modified: / 26-03-2019 / 10:17:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

delayedUpdateSelection
    | breakpointP |

    breakpointP := self internalSelectionHolder value.    
    self selectedBreakpointHolder value: (breakpointP notNil ifTrue:[ breakpointP breakpoint ] ifFalse:[ nil ])

    "Modified: / 10-07-2017 / 16:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (comment): / 12-07-2017 / 10:37:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication methodsFor:'event handling'!

onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent
    self enqueueDelayedUpdateContents.

    "Created: / 10-07-2017 / 17:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 14-02-2019 / 16:32:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

onBreakpointDeletedEvent: aGDBBreakpointDeletedEvent
    self enqueueDelayedUpdateContents.

    "Created: / 10-07-2017 / 17:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 14-02-2019 / 16:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

onBreakpointModifiedEvent: aGDBBreakpointModifiedEvent
    self enqueueDelayedInvalidateInternalList

    "Created: / 10-07-2017 / 18:00:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 07-10-2018 / 22:09:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication methodsFor:'initialization & release'!

subscribe   
    super subscribe.

    debugger announcer  
        when: GDBBreakpointCreatedEvent  send: #onBreakpointCreatedEvent:  to: self;
        when: GDBBreakpointModifiedEvent send: #onBreakpointModifiedEvent: to: self;
        when: GDBBreakpointDeletedEvent  send: #onBreakpointDeletedEvent:  to: self.

    "Created: / 10-07-2017 / 17:59:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 17-11-2021 / 16:38:27 / Jan Vrany <jan.vrany@labware.com>"
    "Modified (comment): / 18-11-2021 / 16:24:25 / Jan Vrany <jan.vrany@labware.com>"
! !

!VDBBreakpointListApplication class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !