PCem is different from other emulators in that when it starts up, reboots it’ll tear itself apart, and re-kick all the components. Normally other emulators do this once, and as a result I never noticed that slirp_exit doesn’t actually purge the socket state. And calling the socket teardown call causes a mbuf explosion in the code. Sadly GDB is pretty useless trying to debug it, since it’s claiming all the structure members don’t exist. Very strange.
Luckily I could duplicate the debug feature to go though current socket redirects, and close the sockets on the Windows side with a simple closesocket.
In this version I’ve setup the following TCP port redirects:
ExternalPORT Internal Port
I still haven’t messed with the rc file, so there is no GUI config, instead you have to do it in the text files. I have some notes on the whole thing on the pcem forum here.
Download the executables and source here:
And for those interested, the diff against mainline 328 is here.