* gdbstub beginnings

* gdbstub: finish gdb impl things, next up is integration with melonDS

* holy fuck the gdbstub works

* gdb breakpoints work, but there's a mysterious crash on continue

* fix memory corruption that sometimes happened, and make resetting the console thru gdb work

* remove some gdb debug printing

* fix things in gdbstub

* separate option for enabling gdbstub

* add mode-dependent CPU registers

* C++ize the GDBstub code

* add gdbstub config in emu settings dialog

* make sure gdb is disabled when jit is enabled

* Remove unnecessary compiler flags, mark ARMJIT assembly code as no-execute-stack

This hardens the binary a little bit against common exploitation methods

* add option to wait for debugger attach on startup

* only insert GNU stack notes on linux

* disable gdbstub enable checkbox when jit is enabled

* fix non-linux incompatibilities

* enable gdbstub by default

* fix issues with gdbstub settings disable stuff

* format stuff

* update gdb test code

* Fix segfault when calling StubCallbacks->GetCPU()

C++ overrides are hard. Please I'm just a lowly C programmer.

* fix packet size not being sent correctly

Thanks to @GlowingUmbreon on Github for troubleshooting this

* fix select(2) calls (i should read docs more properly)

* fix GDB command sequencing/parsing issue (hopefully)

* [GDB] implement no-ack mode

* fix sending ack on handshake

* get lldb to work
This commit is contained in:
PoroCYon
2023-10-22 15:35:31 +02:00
committed by GitHub
parent 3d58a338a1
commit 3ab752b8ca
29 changed files with 3210 additions and 49 deletions

View File

@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>5</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -568,6 +568,101 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Devtools</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>ARM9 port</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>ARM7 port</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="cbGdbEnabled">
<property name="text">
<string>Enable GDB stub</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="7">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Note: melonDS must be restarted in order for these changes to have effect</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="7">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Note: GDB stub cannot be used together with the JIT recompiler</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QCheckBox" name="cbGdbBOSA9">
<property name="text">
<string>Break on startup</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="5">
<widget class="QSpinBox" name="intGdbPortA9">
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>3333</number>
</property>
</widget>
</item>
<item row="2" column="1" colspan="5">
<widget class="QSpinBox" name="intGdbPortA7">
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>3334</number>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QCheckBox" name="cbGdbBOSA7">
<property name="text">
<string>Break on startup</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@ -590,7 +685,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>cbxConsoleType</tabstop>
<tabstop>chkDirectBoot</tabstop>
<tabstop>chkExternalBIOS</tabstop>
@ -639,8 +733,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>257</x>
<y>349</y>
<x>266</x>
<y>379</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@ -655,8 +749,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>325</x>
<y>349</y>
<x>334</x>
<y>379</y>
</hint>
<hint type="destinationlabel">
<x>286</x>