Skip to content

Instantly share code, notes, and snippets.

View cyanlink's full-sized avatar
😅
Bon bu jour.

linkfting cyanlink

😅
Bon bu jour.
  • Göteborg, Sverige
View GitHub Profile
@cyanlink
cyanlink / 01.windows-ghidra-remote-gdb.md
Last active February 15, 2026 15:36
How to use GDB on Windows to debug a Linux target remotely

Foreword

GDB debugging is complicated, sometimes you don't have a good enough computer to run everything within the virtual machine (all sorts of IDE, webpages, Ghidra...). You want to do boot up your Linux VM in headless mode, no GUI, and SSH/remote everything. But there is a problem: you need a GNU/Linux gdb, not the ones that has MinGW as ABI build targets...

Solution 1 (really naive that nobody talked about)

Even ChatGPT or Gemini failed to notice me, even if I explicitly stated what I wanted. The trick is simple, and if you are familiar with MinGW and GDB stuff you should already know: in MSYS2, there is a package called gdb-multiarch, install it with this command:

pacman -S mingw-w64-x86_64-gdb-multiarch
# Then, inside MinGW terminal
gdb-multiarch --config 
import 'package:flutter/material.dart';
main() {
runApp(MaterialApp(home: TimelineCompositedPoc()));
}
///See (StackOverflow Question)[https://stackoverflow.com/questions/71933645]
class TimelineCompositedPoc extends StatefulWidget {
@override
State<TimelineCompositedPoc> createState() => _TimelineCompositedPocState();
/// 生产者消费者
import "dart:collection";
var queue = Queue<String>();
bool fin = false;
void main() {
var pro = Producer();
var tak = Taker();
pro.make();