This is a mini-tutorial of sorts for getting started with gdb on the Switch, with the target audience being people who want to mod and/or reverse games. The goal will be to walk you through some of the basic workflows needed to use a debugger on the Switch, while being brief enough for skimming for when you forget things. ## Installing GDB First off you'll need a version of GDB compatible with aarch64. This can be obtained via either a distribution of `aarch64-none-elf-gdb` or `gdb-multiarch`. I personally use `gdb-multiarch`, however users of devkitpro or Windows users may find it easier to aquire an aarch64-specific GDB.
`aarch64-none-else-gdb` Install (Click to expand) ### `aarch64-none-else-gdb` Install Install [devkitpro](https://devkitpro.org/wiki/Getting_Started) if you haven't already. 1. Install aarch64 gdb: ``` dkp-pacman -Syu devkitA64-gdb ``` 2. Ensure devkitA64 is added to path. The path should look something like this: * Linux - `/opt/devkitpro/devkitA64/bin` * Windows - `C:/devkitpro/devkitA64/bin`
`gdb-multiarch` Install (Click to expand) ### `gdb-multiarch` Install #### Ubuntu ``` sudo apt-get install -y gdb-multiarch ```
## Connecting GDB to a game TODO ``` ```