I'm trying to reconstruct How can I debug functions in shared object libraries with GDB? answer https://stackoverflow.com/a/59690953/6197439 in MINGW64 gdb - and I cannot:
$ cat add.c
long add(long x, long y) {
return x + y;
}
$ gcc -shared -o libadd.so -fPIC add.c
$ gdb
GNU gdb (GDB) 13.2
...
(gdb) file libadd.so
Reading symbols from libadd.so...
(gdb) starti
Starting program: C:\msys64\tmp\libadd.so
Error creating process C:\msys64\tmp\libadd.so, (error 193: unknown win32 error (193))
So, how would I go about calling a function in MINGW64 gdb, in an .so file like this one, compiled with MINGW64 gcc?
.sorather than.dll? Not sure if it matters. Or perhaps this trick doesn't work on Windows in the first place, and you need amain().