Thanks for linking your forum profile to your key. The GDB stub functionality has actually been greatly improved in the ESP8266 2.5.0 core (in the previous versions it was barely usable), however due to some changes to the internal layout, you would need to install VisualGDB 5.4R3 or later (we recommend the latest R4) and ensure you have the latest ESP8266 Arduino core and the latest ESP8266 debug package installed (you can install both via Tools->VisualGDB->Manage VisualGDB Packages).
Then try creating a new Arduino project and ensure you can build and debug it (VisualGDB will set the GDBSTUB_BREAK_ON_INIT=1 variable via VisualGDB Project Properties). Then, simply copy the gdb stub-related code from that project to your project and you should be able to use it.
If gdbstub.h file is empty, it might have been simply corrupted by something else. Deleting and reinstalling the component providing it (if you are not sure, please let us know the full path to that file) should normally resolve it.
If you are not using Arduino, please let us know the exact toolchain and project type you are using (MSBuild, Make, or the new RTOS SDK 3.0 that comes with its own build system) and we will help you get it to work.