Skip to content

Instantly share code, notes, and snippets.

View TuxSH's full-sized avatar
😼

TuxSH

😼
View GitHub Profile
@TuxSH
TuxSH / Message.md
Last active December 7, 2017 07:01
Git diff: GDB: Allow for single-stepping on bare-metal ARM

This commit adds proper support for single-stepping on arm-none-eabi.

arm_software_single_step is now always registered in arm_gdbarch_init (arm-tdep.c) before calling gdbarch_osabi_init. Additionally, arm_software_single_step now checks whether or not the target supports single-stepping itself (which is the case for most simulators, emulators, etc.).

Following this change, we need to assume, without the knowledge the OS (if there is one) that SVC instructions return to the next user-mode instruction by default (arm_get_next_pcs_syscall_next_pc currently returns 0 which is virtually guaranteed to fail).

gdb/Changelog:

  • arm-tdep.c (arm_software_single_step): Check whether the target actually has declared single-step support. Declare this function static. (arm_get_next_pcs_syscall_next_pc): Assume that SVC instructions return to the next user-mode instruction by default.
@TuxSH
TuxSH / colosseum.txt
Last active April 24, 2017 19:31
Taux de capture Pokémon Colosseum/XD
A comparer avec http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_(Generation_III)
#0 0
#1 45
#2 45
#3 45
#4 45
#5 45
#6 45
#7 45
@TuxSH
TuxSH / c_cpp_properties.json
Created May 6, 2017 20:55
3ds vscode config, goes under ./.vscode
{
"configurations": [
{
"name": "3DS",
"includePath": [
"~/devkitPro/devkitARM/arm-none-eabi/include",
"~/devkitPro/libctru/include",
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
@TuxSH
TuxSH / arm-none-eabi-3ds-patch.diff
Last active June 26, 2018 16:45
GDB patch for the 3DS to apply on gdb 7.11
diff -rupN a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in 2017-05-30 02:55:35.000000000 +0200
+++ b/gdb/Makefile.in 2017-05-30 02:56:48.000000000 +0200
@@ -658,6 +658,7 @@ ALL_64_TARGET_OBS = \
# All other target-dependent objects files (used with --enable-targets=all).
ALL_TARGET_OBS = \
armbsd-tdep.o arm.o arm-linux.o arm-linux-tdep.o \
+ arm-3ds-tdep.o \
arm-get-next-pcs.o arm-symbian-tdep.o \
armnbsd-tdep.o armobsd-tdep.o \
@TuxSH
TuxSH / client.cpp
Created May 14, 2017 22:18
shitty qt inputredirection client
#include <QWidget>
#include <QApplication>
#include <QDebug>
#include <QGamepadManager>
#include <QGamepad>
#include <QtEndian>
#include <QUdpSocket>
#include <QTimer>
typedef uint32_t u32;
May 29 23:03:04 <Mrrraou> just because you have access to tools (which are incomplete, unconvenient to use and/or buggy) doesn't mean you have to use them
May 29 23:03:24 <TuxSH> which tools?
May 29 23:03:32 <Mrrraou> qlutoo: why not (they're quite rethorical questions actually)
May 29 23:03:47 * PistonMin has quit (Read error: Operation timed out)
May 29 23:03:55 <Mrrraou> the ones talked about earlier? lol
May 29 23:04:23 <TuxSH> Rosalina "incomplete, unconvenient to use and/or buggy"?
May 29 23:04:28 <TuxSH> hahahahahahahahahahahahahahahahahahahahahahahaha
May 29 23:05:01 <Yami> I don't think this bickering is going to help anyone
May 29 23:05:13 <Mrrraou> it's not
May 29 23:05:16 <Mrrraou> my point was
@TuxSH
TuxSH / gdb80.diff
Created June 8, 2017 13:42
GDB 3DS 8.0 patch (1f1c02597cc199227226251a2ea51fe5f44b4d6d (tag: gdb-8.0-release))
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 1d2dbaf3f7..2d24f09c1b 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -779,6 +779,7 @@ ALL_64_TARGET_OBS = \
ALL_TARGET_OBS = \
arc-tdep.o \
arm.o \
+ arm-3ds-tdep.o \
arm-bsd-tdep.o \
@TuxSH
TuxSH / common_xd_script.txt
Created July 1, 2017 21:16
Pokémon XD common script (its functions can be invoked by other scripts)
.section "FTBL":
.function modify_floor, "modify_floor"
.function preprocess, "preprocess"
.function postprocess, "postprocess"
.function hero_main, "hero_main"
.function floor_link, "floor_link"
.function door_open, "door_open"
.function elevator, "elevator"
.function elevator_out, "elevator_out"
.function fade_in, "fade_in"
@TuxSH
TuxSH / test_script.txt
Created July 1, 2017 21:30
Pokémon XD test script
.section "FTBL":
.function preprocess, "preprocess"
.function postprocess, "postprocess"
.function modify_floor, "modify_floor"
.function sound, "sound"
.function hero_main, "hero_main"
.function talk_100_hunter_f, "talk_100_hunter_f"
.function talk_101_hunter_f, "talk_101_hunter_f"
.function talk_102_hunter_f, "talk_102_hunter_f"
.function talk_103_hunter_f, "talk_103_hunter_f"
@TuxSH
TuxSH / 3dstypes.h
Last active January 7, 2023 17:34
u32 def
typedef u32 Handle;
typedef s32 Result;
typedef s32 LightLock;
struct RecursiveLock
{
LightLock lock;
u32 threadId;
u32 count;
};