GDBMI_break_watch.st
author Jan Vrany <jan.vrany@labware.com>
Mon, 04 Sep 2023 14:00:57 +0100
changeset 314 4a2ef5a087f0
parent 272 cdd1c9ad00de
permissions -rw-r--r--
Add MI parser test This commit add test to parse real-world frament which failed to Pharo properly at some point. It is encoded here as bytearray to make sure all the characters are preserved exactly as they were.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2022-2023 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:libgdbs' }"

"{ NameSpace: Smalltalk }"

GDBMICommand subclass:#GDBMI_break_watch
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'GDB-Commands-MI'
!

!GDBMI_break_watch class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2022-2023 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.
"
!

documentation
"
The `-break-watch' Command
--------------------------

Synopsis
........

      -break-watch [ -a | -r ]

   Create a watchpoint.  With the `-a' option it will create an
'access' watchpoint, i.e., a watchpoint that triggers either on a read
from or on a write to the memory location.  With the `-r' option, the
watchpoint created is a 'read' watchpoint, i.e., it will trigger only
when the memory location is accessed for reading.  Without either of
the options, the watchpoint created is a regular watchpoint, i.e., it
will trigger when the memory location is accessed for writing.  *Note
Setting Watchpoints: Set Watchpoints.

   Note that `-break-list' will report a single list of watchpoints and
breakpoints inserted.

{No value for `GDBN'} Command
.............................

The corresponding {No value for `GDBN'} commands are `watch', `awatch',
and `rwatch'.

Example
.......

Setting a watchpoint on a variable in the `main' function:

     (gdb)
     -break-watch x
     ^done,wpt={number='2',exp='x'}
     (gdb)
     -exec-continue
     ^running
     (gdb)
     *stopped,reason='watchpoint-trigger',wpt={number='2',exp='x'},
     value={old='-268439212',new='55'},
     frame={func='main',args=[],file='recursive2.c',
     fullname='/home/foo/bar/recursive2.c',line='5'}
     (gdb)

   Setting a watchpoint on a variable local to a function.  {No value
for `GDBN'} will stop the program execution twice: first for the
variable changing value, then for the watchpoint going out of scope.

     (gdb)
     -break-watch C
     ^done,wpt={number='5',exp='C'}
     (gdb)
     -exec-continue
     ^running
     (gdb)
     *stopped,reason='watchpoint-trigger',
     wpt={number='5',exp='C'},value={old='-276895068',new='3'},
     frame={func='callee4',args=[],
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c',line='13'}
     (gdb)
     -exec-continue
     ^running
     (gdb)
     *stopped,reason='watchpoint-scope',wpnum='5',
     frame={func='callee3',args=[{name='strarg',
     value='0x11940 \'A string argument.\''}],
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c',line='18'}
     (gdb)

   Listing breakpoints and watchpoints, at different points in the
program execution.  Note that once the watchpoint goes out of scope, it
is deleted.

     (gdb)
     -break-watch C
     ^done,wpt={number='2',exp='C'}
     (gdb)
     -break-list
     ^done,BreakpointTable={nr_rows='2',nr_cols='6',
     hdr=[{width='3',alignment='-1',col_name='number',colhdr='Num'},
     {width='14',alignment='-1',col_name='type',colhdr='Type'},
     {width='4',alignment='-1',col_name='disp',colhdr='Disp'},
     {width='3',alignment='-1',col_name='enabled',colhdr='Enb'},
     {width='10',alignment='-1',col_name='addr',colhdr='Address'},
     {width='40',alignment='2',col_name='what',colhdr='What'}],
     body=[bkpt={number='1',type='breakpoint',disp='keep',enabled='y',
     addr='0x00010734',func='callee4',
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/devo/gdb/testsuite/gdb.mi/basics.c'line='8',thread-groups=['i1'],
     times='1'},
     bkpt={number='2',type='watchpoint',disp='keep',
     enabled='y',addr='',what='C',thread-groups=['i1'],times='0'}]}
     (gdb)
     -exec-continue
     ^running
     (gdb)
     *stopped,reason='watchpoint-trigger',wpt={number='2',exp='C'},
     value={old='-276895068',new='3'},
     frame={func='callee4',args=[],
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c',line='13'}
     (gdb)
     -break-list
     ^done,BreakpointTable={nr_rows='2',nr_cols='6',
     hdr=[{width='3',alignment='-1',col_name='number',colhdr='Num'},
     {width='14',alignment='-1',col_name='type',colhdr='Type'},
     {width='4',alignment='-1',col_name='disp',colhdr='Disp'},
     {width='3',alignment='-1',col_name='enabled',colhdr='Enb'},
     {width='10',alignment='-1',col_name='addr',colhdr='Address'},
     {width='40',alignment='2',col_name='what',colhdr='What'}],
     body=[bkpt={number='1',type='breakpoint',disp='keep',enabled='y',
     addr='0x00010734',func='callee4',
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/devo/gdb/testsuite/gdb.mi/basics.c',line='8',thread-groups=['i1'],
     times='1'},
     bkpt={number='2',type='watchpoint',disp='keep',
     enabled='y',addr='',what='C',thread-groups=['i1'],times='-5'}]}
     (gdb)
     -exec-continue
     ^running
     ^done,reason='watchpoint-scope',wpnum='2',
     frame={func='callee3',args=[{name='strarg',
     value='0x11940 \'A string argument.\''}],
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c',line='18'}
     (gdb)
     -break-list
     ^done,BreakpointTable={nr_rows='1',nr_cols='6',
     hdr=[{width='3',alignment='-1',col_name='number',colhdr='Num'},
     {width='14',alignment='-1',col_name='type',colhdr='Type'},
     {width='4',alignment='-1',col_name='disp',colhdr='Disp'},
     {width='3',alignment='-1',col_name='enabled',colhdr='Enb'},
     {width='10',alignment='-1',col_name='addr',colhdr='Address'},
     {width='40',alignment='2',col_name='what',colhdr='What'}],
     body=[bkpt={number='1',type='breakpoint',disp='keep',enabled='y',
     addr='0x00010734',func='callee4',
     file='../../../devo/gdb/testsuite/gdb.mi/basics.c',
     fullname='/home/foo/devo/gdb/testsuite/gdb.mi/basics.c',line='8',
     thread-groups=['i1'],times='1'}]}
     (gdb)


"
! !

!GDBMI_break_watch methodsFor:'accessing'!

operation
	^ 'break-watch'
! !

!GDBMI_break_watch class methodsFor:'documentation'!

version_HG

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