Skip to content

Bash script that launches an interactive docker container loaded with gdb and valgrind. Great when stuck on Mac OS.

License

Notifications You must be signed in to change notification settings

Le-Technologue/debug-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

debug-tools

Bash script that builds and launches an interactive Debian Docker container running gdb, lldb and Valgrind, with the proper parameters to make those usable (seccomp=unconfined) and the convenient Fish shell.

  • For your basic debugging needs when stranded on a machine missing those tools.
  • Crucial to the 42 School student I currently am when using the school's Mac OS machines.

Usage

  • Launch Docker on your machine.
  • / ! \ If you are at 42 School, you should set your Docker cache into your "goinfre" folder to prevent session overflows. / ! \
    • (Settings > Resources > Disk Image Location in the Docker Desktop application)
  • Clone this repo wherever you like.
  • Choose between the main branch and the branches specific to the 42 school project you wish to debug.
  • Use the script inside the repo like this :

macOS
./dbg-tools -h
./dbg-tools [-b] [work directory]

Linux
./dbg-tools -h|--help
./dbg-tools [-b|--build] [work directory]

  • Drink a coffee while the image builds.

  • When your container's prompt appears it is done !

  • Recompile your project for Linux through the container.

  • enjoy debugging in your GNU enclave (ノ◕ヮ◕)ノ*:・゚✧

    • If you don't specify a work directory, your host machine $HOME folder will seamlessly mount to /home in your container.
    • If your image is already built, building will be skipped. If you wish to rebuild your image, use the '-b' option.

Interest

  • Using Valgrind and gdb on macOS.
  • Debugging with the latest version of lldb on macOS.
    • No need to retype the arguments of your program after each "r" command in lldb. You can type them ordinarily after your program path when you launch lldb and use a single "r" instruction in lldb to keep using those.
    • Lifesaving for projects like push_swap that might need long lists of numbers as parameters, and/or need those generated by another program that can't be called within lldb, like shuf().

About

Bash script that launches an interactive docker container loaded with gdb and valgrind. Great when stuck on Mac OS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published