GDB Beginner Masterclass

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • ►Find full courses on: courses.mshah.io/ *FULL DEBUGGING COURSE AVAILBLE*
    ►Playlist here: • C++ and Pybind11
    ►Join as Member to Support the channel: / @mikeshah
    ►Lesson Description: A quick introduction to GDB showing you the basics all GDB with some simple examples. The full course linked at courses.mshah.io provides another 70%+ more material broken down into smaller lessons and exercises.
    Some of the things that we learned:
    - gdb ./prog to start the program
    - gdb and the file ./prog to reload a program after changes
    - 'n' or 'next' to move to next line
    - 'l' or 'list' to list source code.
    - 'Ctrl+x 1' to enter the TUI mode.
    - 'Ctrl+x o' to shift between windows
    - 's' or 'step' to step into the source code.
    - 'br' or 'break' to set a breakpoint followed by a line number or function name
    - 'c' or 'continue' to continue from a breakpoint.
    - 'set var=value' to set a varaible value.
    - 'p' or 'print' followed by a variable. Note: You can also dereference a variable (e.g. print *px) to see the dereferenced value.
    - 'bt' or 'backtrace' to get the stack frame.
    - 'f' or 'finish' to execute a function to completion.
    - 'info args' to get information about the incoming function arguments'
    ►RUclips Channel: / mikeshah
    ►Please like and subscribe to help the channel!
    ►Join our free community: courses.mshah.io/communities/...
  • НаукаНаука

Комментарии • 8

  • @denismazurak2925
    @denismazurak2925 2 года назад +8

    This was very helpful, thanks a lot! I'm learning C at the moment, and I used a debugger only a couple times before, inside an IDE. The fact that it's possible to debug through a terminal without so much pain is mind-blowing!

    • @MikeShah
      @MikeShah  2 года назад +1

      Agreed, it's super powerful and my primary means of debugging now :D

  • @holyshit922
    @holyshit922 5 месяцев назад +1

    For windows gdb - help (I have 7.6 version approximately 10 years old)
    but -help just lists available options and it is not enough for me

    • @MikeShah
      @MikeShah  5 месяцев назад

      Hmm, are you able to run gdb ./executable_name ? From within gdb you can also do 'help' as well

  • @chinakohl2355
    @chinakohl2355 Год назад +1

    Thanks a lot for this intruduction

  • @fordprefect7779
    @fordprefect7779 Год назад

    Thanks for this good introduction!