I am trying to launch an interactive gdb session from a makefile, but it does not work, and gdb ends right away.
I call this EDK2 command from the terminal and get an interactive gdb session
EmulatorPkg/build.sh run
I think I have to use this command to get a debuggable emulator since the shell file calls another and has a bunch of commands to add the emulator symbols.
If called from a makefile, I do not get an interactive gdb and it just ends right away. Why?
These are the makefile commands
all_debug: build compiledb run_debug
Application/BootLib
FourthFingerPkg.dec
FourthFingerPkg.dsc
build:
pwd && make VERBOSE=y _build &> $(MAKE_OUTPUT)
compiledb:
pwd && compiledb --parse $(MAKE_OUTPUT) && rm $(MAKE_OUTPUT)
run_debug: $(BUILD_DIR)/$(EFI_FILE)
cd .. && pwd &&
cp ./Build/FourthFingerPkg/DEBUG_GCC/X64/FourthFingerPkg.efi ./Build/EmulatorX64/DEBUG_GCC5/X64/FourthFingerPkg.efi &&
echo "add-symbol-file ../../../FourthFingerPkg/DEBUG_GCC/X64/FourthFingerPkg.debug" > $(GDB_COMMANDS) &&
EmulatorPkg/build.sh run < $(GDB_COMMANDS) &&
rm $(GDB_COMMANDS)
I imagine it is related to this message
(y or n) [answered Y; input not from terminal]
I want to be able to set up the gdb environment with the symbols from my module because the symbol files for my EFI are not loaded by EmulatorPkg/build.sh run, and loading them manually is just dumb.