Tools__BreakpointBrowser.st
branchjv
changeset 12626 7ae48abfedac
parent 12571 b2e5fdb702cb
parent 12585 add379de2916
child 13173 e9da2324940d
equal deleted inserted replaced
12625:482496b7e155 12626:7ae48abfedac
    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:''
   291                (MenuItem
   291                (MenuItem
   292                   enabled: hasSelectionHolder
   292                   enabled: hasSelectionHolder
   293                   label: 'Browse'
   293                   label: 'Browse'
   294                   itemValue: browseSelectedItem
   294                   itemValue: browseSelectedItem
   295                 )
   295                 )
       
   296                (MenuItem
       
   297                   label: '-'
       
   298                 )
       
   299                (MenuItem
       
   300                   enabled: selectedItemIsIgnoredHalt
       
   301                   label: 'Stop Ignoring this Halt'
       
   302                   itemValue: reenableHalt
       
   303                 )
       
   304                (MenuItem
       
   305                   enabled: selectedItemIsEnabledLineBreak
       
   306                   label: 'Disable this Breakpoint'
       
   307                   itemValue: disableLineBreak
       
   308                 )
   296                )
   309                )
   297               nil
   310               nil
   298               nil
   311               nil
   299             )
   312             )
   300           )
   313           )
   408               nil
   421               nil
   409               nil
   422               nil
   410             )
   423             )
   411           )
   424           )
   412          (MenuItem
   425          (MenuItem
       
   426             label: 'Filter'
       
   427             submenu: 
       
   428            (Menu
       
   429               (
       
   430                (MenuItem
       
   431                   label: 'Package Filter...'
       
   432                   itemValue: openPackageFilterDialog
       
   433                 )
       
   434                (MenuItem
       
   435                   label: 'Class Filter...'
       
   436                   itemValue: openClassFilterDialog
       
   437                 )
       
   438                )
       
   439               nil
       
   440               nil
       
   441             )
       
   442           )
       
   443          (MenuItem
   413             label: 'Enable'
   444             label: 'Enable'
   414             submenu: 
   445             submenu: 
   415            (Menu
   446            (Menu
   416               (
   447               (
   417                (MenuItem
   448                (MenuItem
   529          activeHelpKeyForLabel: ''
   560          activeHelpKeyForLabel: ''
   530          labelButtonType: Button
   561          labelButtonType: Button
   531          labelActionSelector: sortBy:
   562          labelActionSelector: sortBy:
   532          labelActionArgument: 'type'
   563          labelActionArgument: 'type'
   533          width: 70
   564          width: 70
   534          model: type
   565          model: typeString
       
   566          menuFromApplication: false
       
   567          writeSelector: type:
   535          canSelect: false
   568          canSelect: false
   536        )
   569        )
   537       (DataSetColumnSpec
   570       (DataSetColumnSpec
   538          label: 'Arg'
   571          label: 'Arg'
   539          activeHelpKey: ''
   572          activeHelpKey: ''
   566          labelActionArgument: 'selector'
   599          labelActionArgument: 'selector'
   567          width: 200
   600          width: 200
   568          model: selector
   601          model: selector
   569          canSelect: false
   602          canSelect: false
   570        )
   603        )
   571 "/      (DataSetColumnSpec
   604       (DataSetColumnSpec
   572 "/         label: 'Line'
   605          label: 'Ign'
   573 "/         labelAlignment: left
   606          labelButtonType: Button
   574 "/         activeHelpKey: ''
   607          columnAlignment: center
   575 "/         activeHelpKeyForLabel: ''
   608          width: 50
   576 "/         labelButtonType: Button
   609          model: isIgnoredString
   577 "/         labelActionSelector: sortBy:
   610          menuFromApplication: false
   578 "/         labelActionArgument: 'lineNumber'
   611          writeSelector: isIgnored:
   579 "/         width: 35
   612        )
   580 "/         model: lineNumber
       
   581 "/         canSelect: false
       
   582 "/       )
       
   583       (DataSetColumnSpec
   613       (DataSetColumnSpec
   584          label: 'Info'
   614          label: 'Info'
   585          labelAlignment: left
   615          labelAlignment: left
   586          activeHelpKey: ''
   616          activeHelpKey: ''
   587          activeHelpKeyForLabel: ''
   617          activeHelpKeyForLabel: ''
   590          labelActionArgument: 'info'
   620          labelActionArgument: 'info'
   591          model: info
   621          model: info
   592          canSelect: false
   622          canSelect: false
   593        )
   623        )
   594       )
   624       )
       
   625     
   595 !
   626 !
   596 
   627 
   597 tableColumns_v1
   628 tableColumns_v1
   598     "This resource specification was automatically generated
   629     "This resource specification was automatically generated
   599      by the DataSetBuilder of ST/X."
   630      by the DataSetBuilder of ST/X."
   862 
   893 
   863     "Created: / 22-10-2006 / 02:00:41 / cg"
   894     "Created: / 22-10-2006 / 02:00:41 / cg"
   864 !
   895 !
   865 
   896 
   866 selectedItemIsEnabledLineBreak
   897 selectedItemIsEnabledLineBreak
   867     |entry|
   898     |selIndex entry|
   868 
   899 
   869     entry := (self breakpointListEntryAtIndex:self selectionIndexHolder value).
   900     (selIndex := self selectionIndexHolder value) isNil ifTrue:[^ false].
       
   901     entry := self breakpointListEntryAtIndex:selIndex.
   870     ^ entry isLineBreakpoint and:[entry breakPoint isEnabled]
   902     ^ entry isLineBreakpoint and:[entry breakPoint isEnabled]
   871 !
   903 !
   872 
   904 
   873 selectedItemIsIgnoredHalt
   905 selectedItemIsIgnoredHalt
   874     |entry info|
   906     |selIndex entry info|
   875 
   907 
   876     entry := (self breakpointListEntryAtIndex:self selectionIndexHolder value).
   908     (selIndex := self selectionIndexHolder value) isNil ifTrue:[^ false].
       
   909     entry := self breakpointListEntryAtIndex:selIndex.
   877     info := Debugger haltIgnoreInformationFor:(entry method) atLineNr:(entry lineNumber).
   910     info := Debugger haltIgnoreInformationFor:(entry method) atLineNr:(entry lineNumber).
   878     ^ info notNil and:[ info isHaltIgnored ].
   911     ^ info notNil and:[ info isHaltIgnored ].
   879 !
   912 !
   880 
   913 
   881 selectionIndexHolder
   914 selectionIndexHolder
   992     "filter those items which are to be shown from the complete list"
  1025     "filter those items which are to be shown from the complete list"
   993 
  1026 
   994     |newList showWhichHalt|
  1027     |newList showWhichHalt|
   995 
  1028 
   996     newList := breakpointList.
  1029     newList := breakpointList.
       
  1030 
       
  1031     classNameFilter notEmptyOrNil ifTrue:[
       
  1032         newList := newList select:[:entry | entry relatedToClass:classNameFilter].
       
  1033     ].
       
  1034     packageFilter notEmptyOrNil ifTrue:[
       
  1035         newList := newList select:[:entry | entry relatedToPackage:packageFilter].
       
  1036     ].
   997 
  1037 
   998     self showOthers ifFalse:[
  1038     self showOthers ifFalse:[
   999         newList := newList reject:[:entry | entry isOther].
  1039         newList := newList reject:[:entry | entry isOther].
  1000     ].
  1040     ].
  1001     self showDebugCode ifFalse:[
  1041     self showDebugCode ifFalse:[
  1535 
  1575 
  1536     self assert:(3 > 4)
  1576     self assert:(3 > 4)
  1537 !
  1577 !
  1538 
  1578 
  1539 aMethodWith_assert2
  1579 aMethodWith_assert2
  1540     "only here for demonstration purposes - should be found in the list"
  1580     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1541 
  1581 
  1542     self assert:(3 > 4) message:'well - that ought to work'
  1582     self assert:(3 > 4) message:'well - that ought to work'
  1543 !
  1583 !
  1544 
  1584 
  1545 aMethodWith_breakPoint
  1585 aMethodWith_breakPoint
  1546     "only here for demonstration purposes - should be found in the list"
  1586     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1547 
  1587 
  1548     self breakPoint:#cg
  1588     self breakPoint:#cg
  1549 !
  1589 !
  1550 
  1590 
  1551 aMethodWith_breakPoint2
  1591 aMethodWith_breakPoint2
  1552     "only here for demonstration purposes - should be found in the list"
  1592     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1553 
  1593 
  1554     self breakPoint:#cg info:'hello there'
  1594     self breakPoint:#cg info:'hello there'
  1555 !
  1595 !
  1556 
  1596 
  1557 aMethodWith_debugCode
  1597 aMethodWith_debugCode
  1558     "only here for demonstration purposes - should be found in the list"
  1598     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1559 
  1599 
  1560     self 
  1600     self 
  1561         debuggingCodeFor:#cg
  1601         debuggingCodeFor:#cg
  1562         is:[
  1602         is:[
  1563             self bla.
  1603             self bla.
  1564             Transcript show:'some debug prints here'
  1604             Transcript show:'some debug prints here'
  1565         ].
  1605         ].
  1566 !
  1606 !
  1567 
  1607 
  1568 aMethodWith_halt
  1608 aMethodWith_halt
  1569     "only here for demonstration purposes - should be found in the list"
  1609     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1570 
  1610 
  1571     self halt
  1611     self halt
  1572 
  1612 
  1573     "after the first halt, in the debugger, ignore this halt for some time and see what
  1613     "after the first halt, in the debugger, ignore this halt for some time and see what
  1574      the breakpoint browser shows...
  1614      the breakpoint browser shows...
  1578      ].
  1618      ].
  1579     "
  1619     "
  1580 !
  1620 !
  1581 
  1621 
  1582 aMethodWith_halt2
  1622 aMethodWith_halt2
  1583     "only here for demonstration purposes - should be found in the list"
  1623     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1584 
  1624 
  1585     self halt:'some message'
  1625     self halt:'some message'
  1586 !
  1626 !
  1587 
  1627 
  1588 aMethodWith_todo
  1628 aMethodWith_todo
  1589     "only here for demonstration purposes - should be found in the list"
  1629     "only here for demonstration purposes - should be found in the breakpoint browser''s list"
  1590 
  1630 
  1591     self todo
  1631     self todo
  1592 ! !
  1632 ! !
  1593 
  1633 
  1594 
  1634 
  1612 
  1652 
  1613     "Created: / 22-10-2006 / 01:49:13 / cg"
  1653     "Created: / 22-10-2006 / 01:49:13 / cg"
  1614     "Modified: / 18-02-2007 / 12:56:30 / cg"
  1654     "Modified: / 18-02-2007 / 12:56:30 / cg"
  1615 !
  1655 !
  1616 
  1656 
       
  1657 openClassFilterDialog
       
  1658     |nameOrPattern|
       
  1659 
       
  1660     nameOrPattern := Dialog 
       
  1661                         requestClassName:'Only show breakpoints for class(es) matching (empty to show all):'
       
  1662                         initialAnswer:(classNameFilter ? '*').
       
  1663     nameOrPattern isNil ifTrue:[^ self].    "/ cancel
       
  1664     (nameOrPattern isEmpty or:[nameOrPattern = '*']) ifTrue:[
       
  1665         classNameFilter := nil.
       
  1666     ] ifFalse:[    
       
  1667         classNameFilter := nameOrPattern.
       
  1668     ].
       
  1669     self updateShownBreakpointList
       
  1670 !
       
  1671 
  1617 openDocumentation
  1672 openDocumentation
  1618     HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#BREAKPOINTLIST'.
  1673     HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#BREAKPOINTLIST'.
       
  1674 !
       
  1675 
       
  1676 openPackageFilterDialog
       
  1677     |nameOrPattern|
       
  1678 
       
  1679     nameOrPattern := Dialog 
       
  1680                         request:'Only show breakpoints for code in package(s) matching (empty to show all):'
       
  1681                         list:(Smalltalk allProjectIDs)
       
  1682                         initialAnswer:(packageFilter ? '*').
       
  1683     nameOrPattern isNil ifTrue:[^ self].    "/ cancel
       
  1684     (nameOrPattern isEmpty or:[nameOrPattern = '*']) ifTrue:[
       
  1685         packageFilter := nil.
       
  1686     ] ifFalse:[    
       
  1687         packageFilter := nameOrPattern.
       
  1688     ].
       
  1689     self updateShownBreakpointList
  1619 !
  1690 !
  1620 
  1691 
  1621 resort
  1692 resort
  1622     |sortBlock sortBlock1|
  1693     |sortBlock sortBlock1|
  1623 
  1694 
  1725 
  1796 
  1726 info
  1797 info
  1727     ^ ignoredInfo ? info
  1798     ^ ignoredInfo ? info
  1728 !
  1799 !
  1729 
  1800 
       
  1801 isIgnored
       
  1802     type == #halt ifTrue:[
       
  1803         ^ (Debugger haltIgnoreInformationFor:self method atLineNr:lineNumber) notNil
       
  1804     ].
       
  1805     ^ false
       
  1806 !
       
  1807 
       
  1808 isIgnoredString
       
  1809     self isIgnored ifTrue:[^ 'Yes'].
       
  1810     ^ ''
       
  1811 !
       
  1812 
  1730 lineNumber
  1813 lineNumber
  1731     ^ lineNumber
  1814     ^ lineNumber
  1732 !
  1815 !
  1733 
  1816 
  1734 selector
  1817 selector
  1745     className := classNameArg.
  1828     className := classNameArg.
  1746     selector := selectorArg.
  1829     selector := selectorArg.
  1747     lineNumber := lineNumberArg.
  1830     lineNumber := lineNumberArg.
  1748     info := infoArg.
  1831     info := infoArg.
  1749     enabled := enabledArg.
  1832     enabled := enabledArg.
       
  1833 !
       
  1834 
       
  1835 typeString
       
  1836 "/ loks ugly
       
  1837 "/    self isIgnored ifTrue:[
       
  1838 "/        ^ type asText allStrikedOut
       
  1839 "/    ].
       
  1840     ^ type
  1750 ! !
  1841 ! !
  1751 
  1842 
  1752 
  1843 
  1753 !BreakpointBrowser::BreakpointListEntry methodsFor:'actions'!
  1844 !BreakpointBrowser::BreakpointListEntry methodsFor:'actions'!
  1754 
  1845 
  1765 
  1856 
  1766 !
  1857 !
  1767 
  1858 
  1768 method
  1859 method
  1769     ^ (Smalltalk classNamed:className) compiledMethodAt:selector.
  1860     ^ (Smalltalk classNamed:className) compiledMethodAt:selector.
       
  1861 ! !
       
  1862 
       
  1863 
       
  1864 !BreakpointBrowser::BreakpointListEntry methodsFor:'queries'!
       
  1865 
       
  1866 relatedToClass:aClassNamePattern
       
  1867     className isNil ifTrue:[^ true].
       
  1868     (aClassNamePattern includesMatchCharacters) ifTrue:[
       
  1869          ^ aClassNamePattern match: className
       
  1870     ].
       
  1871     ^ className startsWith:aClassNamePattern
       
  1872 !
       
  1873 
       
  1874 relatedToPackage:aPackagePattern
       
  1875     |mthd package|
       
  1876 
       
  1877     (mthd := self method) isNil ifTrue:[^ false].
       
  1878     package := mthd package.
       
  1879     (aPackagePattern includesMatchCharacters) ifTrue:[
       
  1880          ^ aPackagePattern match: package
       
  1881     ].
       
  1882     ^ package startsWith:aPackagePattern
  1770 ! !
  1883 ! !
  1771 
  1884 
  1772 
  1885 
  1773 !BreakpointBrowser::BreakpointListEntry methodsFor:'testing'!
  1886 !BreakpointBrowser::BreakpointListEntry methodsFor:'testing'!
  1774 
  1887 
  1878 
  1991 
  1879 
  1992 
  1880 !BreakpointBrowser class methodsFor:'documentation'!
  1993 !BreakpointBrowser class methodsFor:'documentation'!
  1881 
  1994 
  1882 version
  1995 version
  1883     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.40 2013-03-26 00:43:36 cg Exp $'
  1996     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.44 2013-03-30 15:57:52 cg Exp $'
  1884 !
  1997 !
  1885 
  1998 
  1886 version_CVS
  1999 version_CVS
  1887     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.40 2013-03-26 00:43:36 cg Exp $'
  2000     ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointBrowser.st,v 1.44 2013-03-30 15:57:52 cg Exp $'
  1888 !
  2001 !
  1889 
  2002 
  1890 version_HG
  2003 version_HG
  1891 
  2004 
  1892     ^ '$Changeset: <not expanded> $'
  2005     ^ '$Changeset: <not expanded> $'