Tools__BreakpointBrowser.st
changeset 12561 0766dc3e8079
parent 12526 dc89c5a91cfc
child 12563 a59337482755
equal deleted inserted replaced
12560:27c2f7b1baa4 12561:0766dc3e8079
    17 	instanceVariableNames:'updatingLabelShown breakpointList shownCopyOfBreakpointList
    17 	instanceVariableNames:'updatingLabelShown breakpointList shownCopyOfBreakpointList
    18 		selectionIndexHolder currentSortColumn currentSortIsReverse
    18 		selectionIndexHolder currentSortColumn currentSortIsReverse
    19 		showHalts showOthers showAssertions showAssertionsInTests
    19 		showHalts showOthers showAssertions showAssertionsInTests
    20 		showCodeBreakpoints showCodeBreakpointsFor showMethodBreakpoints
    20 		showCodeBreakpoints showCodeBreakpointsFor showMethodBreakpoints
    21 		showLineBreakpoints showDebugCode codeView infoHolder
    21 		showLineBreakpoints showDebugCode codeView infoHolder
    22 		updateProcess showWhichHaltsHolder'
    22 		updateProcess showWhichHaltsHolder packageFilter classNameFilter'
    23 	classVariableNames:'MessagesAndTypes'
    23 	classVariableNames:'MessagesAndTypes'
    24 	poolDictionaries:''
    24 	poolDictionaries:''
    25 	category:'Interface-Smalltalk-Breakpoints'
    25 	category:'Interface-Debugger'
    26 !
    26 !
    27 
    27 
    28 Object subclass:#BreakpointListEntry
    28 Object subclass:#BreakpointListEntry
    29 	instanceVariableNames:'type ignoredInfo arg className selector lineNumber info enabled'
    29 	instanceVariableNames:'type ignoredInfo arg className selector lineNumber info enabled'
    30 	classVariableNames:''
    30 	classVariableNames:''
   404               nil
   404               nil
   405               nil
   405               nil
   406             )
   406             )
   407           )
   407           )
   408          (MenuItem
   408          (MenuItem
       
   409             label: 'Filter'
       
   410             submenu: 
       
   411            (Menu
       
   412               (
       
   413                (MenuItem
       
   414                   label: 'Package Filter...'
       
   415                   itemValue: openPackageFilterDialog
       
   416                 )
       
   417                (MenuItem
       
   418                   label: 'Class Filter...'
       
   419                   itemValue: openClassFilterDialog
       
   420                 )
       
   421                )
       
   422               nil
       
   423               nil
       
   424             )
       
   425           )
       
   426          (MenuItem
   409             label: 'Enable'
   427             label: 'Enable'
   410             submenu: 
   428             submenu: 
   411            (Menu
   429            (Menu
   412               (
   430               (
   413                (MenuItem
   431                (MenuItem
   561          labelActionArgument: 'selector'
   579          labelActionArgument: 'selector'
   562          width: 200
   580          width: 200
   563          model: selector
   581          model: selector
   564          canSelect: false
   582          canSelect: false
   565        )
   583        )
   566 "/      (DataSetColumnSpec
   584       (DataSetColumnSpec
   567 "/         label: 'Line'
   585          label: 'Ign'
   568 "/         labelAlignment: left
   586          labelButtonType: Button
   569 "/         activeHelpKey: ''
   587          columnAlignment: center
   570 "/         activeHelpKeyForLabel: ''
   588          width: 50
   571 "/         labelButtonType: Button
   589          model: isIgnored
   572 "/         labelActionSelector: sortBy:
   590          menuFromApplication: false
   573 "/         labelActionArgument: 'lineNumber'
   591        )
   574 "/         width: 35
       
   575 "/         model: lineNumber
       
   576 "/         canSelect: false
       
   577 "/       )
       
   578       (DataSetColumnSpec
   592       (DataSetColumnSpec
   579          label: 'Info'
   593          label: 'Info'
   580          labelAlignment: left
   594          labelAlignment: left
   581          activeHelpKey: ''
   595          activeHelpKey: ''
   582          activeHelpKeyForLabel: ''
   596          activeHelpKeyForLabel: ''
   585          labelActionArgument: 'info'
   599          labelActionArgument: 'info'
   586          model: info
   600          model: info
   587          canSelect: false
   601          canSelect: false
   588        )
   602        )
   589       )
   603       )
       
   604     
   590 !
   605 !
   591 
   606 
   592 tableColumns_v1
   607 tableColumns_v1
   593     "This resource specification was automatically generated
   608     "This resource specification was automatically generated
   594      by the DataSetBuilder of ST/X."
   609      by the DataSetBuilder of ST/X."
   985 
  1000 
   986     |newList showWhichHalt|
  1001     |newList showWhichHalt|
   987 
  1002 
   988     newList := breakpointList.
  1003     newList := breakpointList.
   989 
  1004 
       
  1005     classNameFilter notEmptyOrNil ifTrue:[
       
  1006         newList := newList select:[:entry | entry relatedToClass:classNameFilter].
       
  1007     ].
       
  1008     packageFilter notEmptyOrNil ifTrue:[
       
  1009         newList := newList select:[:entry | entry relatedToPackage:packageFilter].
       
  1010     ].
       
  1011 
   990     self showOthers ifFalse:[
  1012     self showOthers ifFalse:[
   991         newList := newList reject:[:entry | entry isOther].
  1013         newList := newList reject:[:entry | entry isOther].
   992     ].
  1014     ].
   993     self showDebugCode ifFalse:[
  1015     self showDebugCode ifFalse:[
   994         newList := newList reject:[:entry | entry isDebugCode].
  1016         newList := newList reject:[:entry | entry isDebugCode].
  1523 
  1545 
  1524     self assert:(3 > 4)
  1546     self assert:(3 > 4)
  1525 !
  1547 !
  1526 
  1548 
  1527 aMethodWith_assert2
  1549 aMethodWith_assert2
  1528     "only here for demonstration purposes - should be found in the list"
  1550     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1529 
  1551 
  1530     self assert:(3 > 4) message:'well - that ought to work'
  1552     self assert:(3 > 4) message:'well - that ought to work'
  1531 !
  1553 !
  1532 
  1554 
  1533 aMethodWith_breakPoint
  1555 aMethodWith_breakPoint
  1534     "only here for demonstration purposes - should be found in the list"
  1556     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1535 
  1557 
  1536     self breakPoint:#cg
  1558     self breakPoint:#cg
  1537 !
  1559 !
  1538 
  1560 
  1539 aMethodWith_breakPoint2
  1561 aMethodWith_breakPoint2
  1540     "only here for demonstration purposes - should be found in the list"
  1562     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1541 
  1563 
  1542     self breakPoint:#cg info:'hello there'
  1564     self breakPoint:#cg info:'hello there'
  1543 !
  1565 !
  1544 
  1566 
  1545 aMethodWith_debugCode
  1567 aMethodWith_debugCode
  1546     "only here for demonstration purposes - should be found in the list"
  1568     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1547 
  1569 
  1548     self 
  1570     self 
  1549         debuggingCodeFor:#cg
  1571         debuggingCodeFor:#cg
  1550         is:[
  1572         is:[
  1551             self bla.
  1573             self bla.
  1552             Transcript show:'some debug prints here'
  1574             Transcript show:'some debug prints here'
  1553         ].
  1575         ].
  1554 !
  1576 !
  1555 
  1577 
  1556 aMethodWith_halt
  1578 aMethodWith_halt
  1557     "only here for demonstration purposes - should be found in the list"
  1579     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1558 
  1580 
  1559     self halt
  1581     self halt
  1560 
  1582 
  1561     "after the first halt, in the debugger, ignore this halt for some time and see what
  1583     "after the first halt, in the debugger, ignore this halt for some time and see what
  1562      the breakpoint browser shows...
  1584      the breakpoint browser shows...
  1566      ].
  1588      ].
  1567     "
  1589     "
  1568 !
  1590 !
  1569 
  1591 
  1570 aMethodWith_halt2
  1592 aMethodWith_halt2
  1571     "only here for demonstration purposes - should be found in the list"
  1593     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1572 
  1594 
  1573     self halt:'some message'
  1595     self halt:'some message'
  1574 !
  1596 !
  1575 
  1597 
  1576 aMethodWith_todo
  1598 aMethodWith_todo
  1577     "only here for demonstration purposes - should be found in the list"
  1599     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1578 
  1600 
  1579     self todo
  1601     self todo
  1580 ! !
  1602 ! !
  1581 
  1603 
  1582 !BreakpointBrowser methodsFor:'user actions'!
  1604 !BreakpointBrowser methodsFor:'user actions'!
  1599 
  1621 
  1600     "Created: / 22-10-2006 / 01:49:13 / cg"
  1622     "Created: / 22-10-2006 / 01:49:13 / cg"
  1601     "Modified: / 18-02-2007 / 12:56:30 / cg"
  1623     "Modified: / 18-02-2007 / 12:56:30 / cg"
  1602 !
  1624 !
  1603 
  1625 
       
  1626 openClassFilterDialog
       
  1627     |nameOrPattern|
       
  1628 
       
  1629     nameOrPattern := Dialog 
       
  1630                         requestClassName:'Only show breakpoints for class(es) matching (empty to show all):'
       
  1631                         initialAnswer:(classNameFilter ? '*').
       
  1632     nameOrPattern isNil ifTrue:[^ self].    "/ cancel
       
  1633     (nameOrPattern isEmpty or:[nameOrPattern = '*']) ifTrue:[
       
  1634         classNameFilter := nil.
       
  1635     ] ifFalse:[    
       
  1636         classNameFilter := nameOrPattern.
       
  1637     ].
       
  1638     self updateShownBreakpointList
       
  1639 !
       
  1640 
  1604 openDocumentation
  1641 openDocumentation
  1605     HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#BREAKPOINTLIST'.
  1642     HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#BREAKPOINTLIST'.
       
  1643 !
       
  1644 
       
  1645 openPackageFilterDialog
       
  1646     |nameOrPattern|
       
  1647 
       
  1648     nameOrPattern := Dialog 
       
  1649                         request:'Only show breakpoints for code in package(s) matching (empty to show all):'
       
  1650                         list:(Smalltalk allProjectIDs)
       
  1651                         initialAnswer:(packageFilter ? '*').
       
  1652     nameOrPattern isNil ifTrue:[^ self].    "/ cancel
       
  1653     (nameOrPattern isEmpty or:[nameOrPattern = '*']) ifTrue:[
       
  1654         packageFilter := nil.
       
  1655     ] ifFalse:[    
       
  1656         packageFilter := nameOrPattern.
       
  1657     ].
       
  1658     self updateShownBreakpointList
  1606 !
  1659 !
  1607 
  1660 
  1608 resort
  1661 resort
  1609     |sortBlock sortBlock1|
  1662     |sortBlock sortBlock1|
  1610 
  1663 
  1711 
  1764 
  1712 info
  1765 info
  1713     ^ ignoredInfo ? info
  1766     ^ ignoredInfo ? info
  1714 !
  1767 !
  1715 
  1768 
       
  1769 isIgnored
       
  1770     type == #halt ifTrue:[
       
  1771         (Debugger haltIgnoreInformationFor:self method atLineNr:lineNumber)
       
  1772             notNil ifTrue:[^ 'Yes'].
       
  1773     ].
       
  1774     ^ ''
       
  1775 !
       
  1776 
  1716 lineNumber
  1777 lineNumber
  1717     ^ lineNumber
  1778     ^ lineNumber
  1718 !
  1779 !
  1719 
  1780 
  1720 selector
  1781 selector
  1750 
  1811 
  1751 !
  1812 !
  1752 
  1813 
  1753 method
  1814 method
  1754     ^ (Smalltalk classNamed:className) compiledMethodAt:selector.
  1815     ^ (Smalltalk classNamed:className) compiledMethodAt:selector.
       
  1816 ! !
       
  1817 
       
  1818 !BreakpointBrowser::BreakpointListEntry methodsFor:'queries'!
       
  1819 
       
  1820 relatedToClass:aClassNamePattern
       
  1821     className isNil ifTrue:[^ true].
       
  1822     (aClassNamePattern includesMatchCharacters) ifTrue:[
       
  1823          ^ aClassNamePattern match: className
       
  1824     ].
       
  1825     ^ className startsWith:aClassNamePattern
       
  1826 !
       
  1827 
       
  1828 relatedToPackage:aPackagePattern
       
  1829     |package|
       
  1830 
       
  1831     package := self method package.
       
  1832     (aPackagePattern includesMatchCharacters) ifTrue:[
       
  1833          ^ aPackagePattern match: package
       
  1834     ].
       
  1835     ^ package startsWith:aPackagePattern
  1755 ! !
  1836 ! !
  1756 
  1837 
  1757 !BreakpointBrowser::BreakpointListEntry methodsFor:'testing'!
  1838 !BreakpointBrowser::BreakpointListEntry methodsFor:'testing'!
  1758 
  1839 
  1759 isAssertion
  1840 isAssertion
  1858 ! !
  1939 ! !
  1859 
  1940 
  1860 !BreakpointBrowser class methodsFor:'documentation'!
  1941 !BreakpointBrowser class methodsFor:'documentation'!
  1861 
  1942 
  1862 version
  1943 version
  1863     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.40 2013-03-26 00:43:36 cg Exp $'
  1944     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.41 2013-03-28 15:00:28 cg Exp $'
  1864 !
  1945 !
  1865 
  1946 
  1866 version_CVS
  1947 version_CVS
  1867     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.40 2013-03-26 00:43:36 cg Exp $'
  1948     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.41 2013-03-28 15:00:28 cg Exp $'
  1868 ! !
  1949 ! !
  1869 
  1950 
  1870 
  1951 
  1871 BreakpointBrowser initialize!
  1952 BreakpointBrowser initialize!