VDBStartup.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 10 Jun 2019 15:22:49 +0100
changeset 166 d55f55ac977b
parent 131 815f0bf03155
child 180 a47acd6d73ca
permissions -rw-r--r--
plugins/bee: add symbol filter to quickly search through (possibly long) list of symbols.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     1
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     2
jv:vdb - Visual / VM Debugger
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     4
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     5
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     6
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     7
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
     8
"
116
d0d6da74ead3 UI: add GDB executable configuration to settings dialog
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
     9
"{ Package: 'jv:vdb' }"
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
37
f417fe8685c5 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18
diff changeset
    11
"{ NameSpace: Smalltalk }"
f417fe8685c5 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18
diff changeset
    12
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
StandaloneStartup subclass:#VDBStartup
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
	instanceVariableNames:''
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
    15
	classVariableNames:'Standalone'
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
	poolDictionaries:''
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	category:'VDB-UI'
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
49
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    20
!VDBStartup class methodsFor:'documentation'!
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    21
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    22
copyright
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    23
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    24
jv:vdb - Visual / VM Debugger
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    25
Copyright (C) 2015-now Jan Vrany
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    26
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    27
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    28
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    29
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    30
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 47
diff changeset
    31
! !
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
!VDBStartup class methodsFor:'constants & defaults'!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
applicationRegistryPath
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
    "the key under which this application stores its process ID in the registry
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
     as a collection of path-components.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
     i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
     in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
     (would also be used as a relative path for a temporary lock file under unix).
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
     Used to detect if another instance of this application is already running."
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
    ^ #('vdb')
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
    "Modified: / 21-09-2014 / 01:29:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
applicationUUID
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
    "answer an application-specific unique uuid.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
     This is used as the name of some exclusive OS-resource, which is used to find out,
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
     if another instance of this application is already running.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
     Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
     If redefined, please return a real UUID (i.e. UUID fromString:'.....') and not a string or
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
     similar possibly conflicting identifier.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
     You can paste a fresh worldwide unique id via the editor's more-misc-paste UUID menuFunction."
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    ^ UUID fromString:'57b09330-4126-11e4-a80f-606720e43e2c'
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    "Modified: / 21-09-2014 / 01:29:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
! !
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
!VDBStartup class methodsFor:'defaults'!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
allowDebugOption
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
    "enable/disable the --debug startup option.
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
     Can be redefined in subclasses to enable it"
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    ^ true
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    "Created: / 08-09-2014 / 19:30:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
! !
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    73
!VDBStartup class methodsFor:'private'!
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    74
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    75
loadPreferenceFile: file
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    76
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    77
    "Created: / 07-06-2017 / 09:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    78
! !
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    79
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    80
!VDBStartup class methodsFor:'queries'!
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    81
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    82
applicationName
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    83
    ^ 'vdb'
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    84
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    85
    "Created: / 06-06-2017 / 22:50:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    86
! !
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    87
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
!VDBStartup class methodsFor:'startup'!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
main:argv
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    91
    "Application entry point. `argv` is the array of command arguments (as Array of Strings)"
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    92
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
    93
    | optparser positional settingsFile settingsSuppressed cmd noPTY replay
119
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
    94
      programExecutable programArgs programPid attach
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    95
      debugger debuggerApp |
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
    96
119
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
    97
    "/ This is awkward. We HAVE TO load prefetences when VDB is compiled standalone
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
    98
    "/ application or run from a command line (`--load jv:vdb` --run VDBStarup`.
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
    99
    "/ We MUST NOT load preferences when `VDBStarup main` is run from running IDE.
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   100
    "/ for example while developing.
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   101
    "/
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   102
    "/ The trick is that there's no good and easy way to check this, so we have to
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   103
    "/ check whether this method is called from `Smalltalk >> start`. Bleh.
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   104
    Standalone := Smalltalk isStandAloneApp
119
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   105
                    or:[ thisContext sender method == (Smalltalk class compiledMethodAt: #start) ].
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   106
    settingsSuppressed := Standalone not.
119
be31a77e2d9c Fix (re)loading of preferences when calling `VDBStartup >> main:` from workspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   107
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   108
    noPTY := false.
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   109
    replay := false.
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   110
    attach := false.
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   111
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   112
    "/ Parse options...
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   113
    optparser := CmdLineParser new
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   114
                    ignoreUnknownOptions: true;
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   115
                    on: #('--help') do:[
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   116
                        self usage
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   117
                    ];
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   118
                    on: #('--preferences') do:[:filename |
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   119
                        | file |
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   120
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   121
                        file := filename asFilename.
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   122
                        file isReadable ifFalse:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   123
                            self error: 'preference file does not exists or not readable: ' , filename.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   124
                        ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   125
                        file isRegularFile ifFalse:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   126
                            self error: 'preference file is not a regular file: ' , filename.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   127
                        ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   128
                        settingsFile := file.
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   129
                    ];
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   130
                    on: #('--no-preferences') do:[
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   131
                        settingsSuppressed := true
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   132
                    ];
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   133
                    on: #('--replay') do:[
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   134
                        replay := true
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   135
                    ];
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   136
                    on: #('-d' '--gdb') do:[ :str |
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   137
                        cmd := str
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   138
                    ];
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   139
                    on: #('--no-pty') do:[
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   140
                        noPTY := true
116
d0d6da74ead3 UI: add GDB executable configuration to settings dialog
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   141
                    ];
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   142
                    yourself.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   143
    [
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   144
        positional := optparser parse:argv.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   145
    ] on: CmdLineOptionError do:[:ex |
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   146
        self error: ex description.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   147
    ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   148
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   149
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   150
    "/ Now validate and process options
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   151
    settingsSuppressed ifFalse:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   152
        | settings |
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   153
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   154
        settingsFile notNil ifTrue:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   155
            settingsFile exists ifFalse:[
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   156
                self error: 'preference file does not exist: ', settingsFile pathName
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   157
            ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   158
            settingsFile isDirectory ifTrue:[
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   159
                self error: 'preference file is not a regular file: ', settingsFile pathName
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   160
            ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   161
            settingsFile isReadable ifFalse:[
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   162
                self error: 'preference file is not a readable (check permissions): ', settingsFile pathName
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   163
            ].
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   164
            settings := UserPreferences loadSettingsFrom: settingsFile.
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   165
        ] ifFalse:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   166
            settings := UserPreferences loadSettings.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   167
        ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   168
        UserPreferences setCurrent: settings.
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   169
    ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   170
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   171
    replay ifTrue:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   172
        OperatingSystem isLinuxLike ifFalse:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   173
            self error: 'replay not supported on this platform'.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   174
        ].
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   175
        RR available ifFalse:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   176
            self error: 'cannot replay because rr not available'
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   177
        ].
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   178
    ].
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   179
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   180
    "/ Parse positional arguments - there are two forms:
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   181
    "/
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   182
    "/   vdb [OPTIONS] [PROGRAM [ARGS]]
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   183
    "/   vdb [OPTIONS] [PID]
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   184
    "/
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   185
    "/ [OPTIONS] have already been processed, the rest is in `positional`
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   186
    "/ variable
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   187
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   188
    positional notEmpty ifTrue:[
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   189
        programExecutable := positional first.
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   190
        programExecutable asFilename exists ifFalse:[
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   191
            "Try to find the executable in PATH..."
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   192
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   193
            | path |
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   194
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   195
            path := OperatingSystem pathOfCommand: programExecutable.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   196
            path notNil ifTrue:[
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   197
                programExecutable := path.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   198
            ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   199
        ].
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   200
        programPid := Integer fromString: positional first onError: [ nil ].
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   201
        programArgs := positional copyFrom: 2.
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   202
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   203
        replay ifTrue:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   204
            programArgs notEmptyOrNil ifTrue:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   205
                self error: 'cannot specify program args when replaying'.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   206
            ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   207
        ] ifFalse:[
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   208
            "/ If * programExecutable does not exists
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   209
            "/    * AND programPid is not nil (i.e., first positional argument can be converted to an integer)
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   210
            "/    * AND programArguments are empty
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   211
            "/ then interpret positional argument as PID and attach to it.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   212
            "/ Otherwise, interpret positional arguments
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   213
            (programExecutable asFilename exists not and: [ programPid notNil and: [ programArgs isEmpty ]]) ifTrue:[
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   214
                attach := true.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   215
            ] ifFalse:[
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   216
                programExecutable asFilename exists ifFalse:[
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   217
                    self error: 'cannot find program executable: ', programExecutable.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   218
                ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   219
            ].
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   220
        ].
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   221
    ].
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   222
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   223
    Debugger := DebugView ? MiniDebugger.
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   224
    Inspector := InspectorView ? MiniInspector.
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   225
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   226
    noPTY ifTrue:[ 
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   227
        debugger := GDBDebugger newWithProcess: (GDBStXSimpleProcess newWithCommand: cmd).
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   228
    ] ifFalse:[ 
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   229
        debugger := GDBDebugger newWithProcess: (GDBLocalProcess newWithCommand: cmd).
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   230
    ].
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   231
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   232
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   233
    attach ifTrue:[
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   234
        debugger attach: programPid
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   235
    ] ifFalse:[
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   236
        programExecutable notNil ifTrue:[
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   237
            debugger executable: programExecutable arguments: programArgs.
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   238
        ].
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   239
    ].
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
    Smalltalk openDisplay.
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   241
    debuggerApp := VDBDebuggerApplication new.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   242
    debuggerApp debugger: debugger.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   243
    debuggerApp open.
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   244
    replay ifTrue:[ 
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   245
        debuggerApp doAttachToRR
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   246
    ]. 
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   247
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   248
    "
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   249
        VDBStartup main: #()
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   250
        VDBStartup main: #('ls')
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   251
        VDBStartup main: #('/bin/ls' '/tmp')
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   252
    "
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   253
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   254
    "Modified: / 13-12-2018 / 15:32:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   256
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
usage
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   258
    Transcript nextPutAll:'usage: '; nextPutAll: self applicationName; nextPutAll: ' [OPTIONS] [PROGRAM [ARGS]] '; cr.
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   259
    Transcript nextPutAll:'       '; nextPutAll: self applicationName; nextPutAll: ' [OPTIONS] [PID]'; cr.
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   260
                                                                          "|"
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   261
    Transcript nextPutLine:'
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   262
options:
83
101ff2210613 Initial support for Mozilla rr
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
   263
 --replay ..................... replay last rr record
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   264
 --no-pty ..................... do not use PTY-based GDB console even if current
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   265
                                platform supports it. 
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   266
 -d | --gdb CMD ............... use CMD to launch GDB (instead of platform
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   267
                                default).    
47
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   268
 --preference FILE ............ read user settings from FILE
25d82943a3cf Allow VDB to be launched without PID or program to debug
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
   269
 --no-preferences ............. do not read user settings at all
43
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   270
 --help ....................... output this message
c98aa29401f7 Initia support for running debugger as standalone application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 37
diff changeset
   271
'.
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   272
    Standalone ifTrue:[
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   273
        Smalltalk exit: 0.
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   274
    ].
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   275
131
815f0bf03155 Improve `--gdb` command line option handling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 119
diff changeset
   276
    "Modified: / 13-12-2018 / 15:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
! !
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   278
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
!VDBStartup class methodsFor:'documentation'!
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
version_HG
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
    ^ '$Changeset: <not expanded> $'
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
! !
0f44fe9848a0 Added standalone startup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285