diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fa45ac..7b7b49c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ add_custom_target( # First, we need to generate a GDB file containing all the symbols of all our # executables. add_custom_target( - .gdbinit + gdbinit BYPRODUCTS ${CMAKE_BINARY_DIR}/.gdbinit COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/get_text_address.sh ${CMAKE_BINARY_DIR}/mentos/kernel.bin > ${CMAKE_BINARY_DIR}/.gdbinit COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/get_text_address.sh ${CMAKE_BINARY_DIR}/mentos/kernel-bootloader.bin >> ${CMAKE_BINARY_DIR}/.gdbinit diff --git a/README.md b/README.md index c383ccf..de3806b 100644 --- a/README.md +++ b/README.md @@ -264,15 +264,16 @@ cmake .. make ``` -Then, you need to generate a file called `.gdbinit` placed inside the `build` directory, which will tell **gdb** which *object* file he needs to read in order to allow proper debugging. +Then, you need to generate a file called `.gdbinit` placed inside the `build` directory, which will tell **gdb** which *object* file he needs to read in order to allow proper debugging. To generate the file, just execute: ```bash -make gdb_file +make gdbinit ``` Finally, you run qemu in debugging mode with: ```bash make qemu-gdb ``` + If you did everything correctly, you should see an empty QEMU window. Basically, QEMU is waiting for you to connect *remotely* with gdb. Anyway, running `make qemu-gdb` will make your current shell busy, you cannot call `gdb` in it. You need to open a new shell inside the `build` folder and do a: ```bash cgdb -q -iex 'add-auto-load-safe-path .'