extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 21 Sep 2019 18:31:45 +0100
changeset 185 bb863cb24c1a
parent 177 fd154978bab5
child 186 8110a5e2c704
permissions -rw-r--r--
Do not try to raise transcript window if `Transcript` is not graphical ...but - for instance - a `StdOut` or `StdErr`.

"{ Package: 'jv:vdb' }"!

!GDBDebugger methodsFor:'event handling'!

onRRExitEvent:anRRExitEvent
    | status |

    anRRExitEvent rr announcer unsubscribe: self.
    status := anRRExitEvent status.
    (status success or:[ status status == #signal and:[status code == OperatingSystem sigTERM ]]) ifFalse:[ 
        Dialog warn: (self class classResources string: 'Replay server terminated with error')
    ].

    "Created: / 31-07-2018 / 09:37:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBDebugger methodsFor:'commands - API'!

pythonImportVDB
    "Import VDB support"

    | pythonDir |

    pythonDir := (Smalltalk getPackageDirectoryForPackage: #jv:vdb) / 'python'.
    self assert: pythonDir isDirectory.

    self pythonSysPathAppend: pythonDir.
    self pythonImport: 'vdb'

    "Created: / 08-07-2019 / 11:44:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBDebugger methodsFor:'commands - API'!

targetConnectRR: rr
    "Connect to rr replay server"

    "/ rr suggest to connect as follows:
    "/ 
    "/     gdb '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:9876' ...
    "/
    self send: (GDBMI_gdb_set arguments: #('sysroot' '/')).
    self targetConnect: 'extended-remote'  parameters: (Array with: '127.0.0.1:' with: rr port).
    rr announcer when: RRExitEvent send: #onRRExitEvent: to: self.

    "Created: / 26-07-2018 / 21:48:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 31-07-2018 / 09:38:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBVariableObject methodsFor:'inspecting'!

inspector2TabVariable
    <inspector2Tab>

    | varObjApp |

    varObjApp := Smalltalk at: #VDBVariableObjectListApplication ifAbsent:[ ^ nil ].
    ^ (self newInspector2Tab)
        label:'Variable';
        priority:95;
        "/ view: [ ... ];
        application: [ varObjApp new debugger: debugger; variableObjectList: (Array with: self); yourself ];
        "/ text: [ ... ];
        yourself

    "Modified: / 03-02-2018 / 09:58:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!jv_vdb class methodsFor:'documentation'!

extensionsVersion_HG

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