Skip to content

Commit

Permalink
Hook up GDB options
Browse files Browse the repository at this point in the history
  • Loading branch information
thrimbor authored and mborgerson committed Oct 26, 2018
1 parent 336c4dc commit 7623a05
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def reset(self):
'short_anim': False,
'sys_memory': '64 MiB',
'use_accelerator': False,
'gdb_enabled': False,
'gdb_wait': False,
'gdb_port': '1234',
'extra_args': '',
}

Expand Down Expand Up @@ -98,6 +101,9 @@ def bindDropdownWidget(widget, var):
bindCheckWidget(self.hddLocked, 'hdd_locked')
bindDropdownWidget(self.systemMemory, 'sys_memory')
bindCheckWidget(self.useAccelerator, 'use_accelerator')
bindCheckWidget(self.gdbEnabled, 'gdb_enabled')
bindCheckWidget(self.waitForGdb, 'gdb_wait')
bindTextWidget(self.gdbPort, 'gdb_port')
bindTextWidget(self.additionalArgs, 'extra_args')
updateLaunchCmd()

Expand Down Expand Up @@ -169,7 +175,15 @@ def escape_path(path):
'-drive','file=%(hdd_path_arg)s,index=0,media=disk%(hdd_lock_arg)s' % locals(),
'-drive','index=1,media=cdrom%(dvd_path_arg)s' % locals(),
'-qmp','tcp:localhost:4444,server,nowait',
'-display','sdl'] + extra_args
'-display','sdl']

if settings.settings['gdb_enabled']:
cmd.append('-gdb')
cmd.append('tcp::' + settings.settings['gdb_port'])
if settings.settings['gdb_wait']:
cmd.append('-S')

cmd += extra_args

return cmd

Expand Down
6 changes: 3 additions & 3 deletions settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,14 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QCheckBox" name="checkBox_4">
<widget class="QCheckBox" name="gdbEnabled">
<property name="text">
<string>Enable GDB Server</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_5">
<widget class="QCheckBox" name="waitForGdb">
<property name="text">
<string>Wait for connection at startup</string>
</property>
Expand All @@ -434,7 +434,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_3">
<widget class="QLineEdit" name="gdbPort">
<property name="maximumSize">
<size>
<width>100</width>
Expand Down

0 comments on commit 7623a05

Please sign in to comment.