diff --git a/home/dwarf/.gitignore b/home/dwarf/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eb314e07280ac499cf5f1ed878748ac7ac3b30d8 --- /dev/null +++ b/home/dwarf/.gitignore @@ -0,0 +1,2 @@ +prodconsum +prodconsum.dwarf diff --git a/home/dwarf/Makefile b/home/dwarf/Makefile index 56621af3a96e9f9fddd079417c0a807ef73e36a6..8cf776327d182092a741c91e4ac71fadea5516c3 100644 --- a/home/dwarf/Makefile +++ b/home/dwarf/Makefile @@ -1,9 +1,22 @@ CFLAGS := -g -all : prodconsum.dwarf +HAS_DWARFDUMP := $(shell command -v dwarfdump 2> /dev/null) + +TARGET := prodconsum + +ifdef HAS_DWARFDUMP + TARGET := ${TARGET} prodconsum.dwarf +endif + +ifndef HAS_DWARFDUMP + $(warning "dwarfdump not available, cannot generate prodconsum.dwarf") +endif + + +all : ${TARGET} @echo @echo "###" - @echo "### $< is ready." + @echo "### $^ ready." @echo "###" @echo diff --git a/home/dwarf/prodconsum.c b/home/dwarf/prodconsum.c index 2e9b894b94b4001b1d9d17037ebaa0bc910411b6..9873c04c59fab59219afe3a5b3eedbb24f38c39a 100644 --- a/home/dwarf/prodconsum.c +++ b/home/dwarf/prodconsum.c @@ -53,7 +53,7 @@ int main(){ pthread_t prod; pthread_t cons; - puts("createing first thread"); + puts("Creating first thread"); if(pthread_create(&prod, NULL, producer, (void*)&context) != 0){ puts("Could not create producer thread"); @@ -63,7 +63,7 @@ int main(){ return(EXIT_FAILURE); } - puts("createing second thread"); + puts("Creating second thread"); if(pthread_create(&cons, NULL, consumer, (void*)&context) != 0){ puts("Could not create consumer thread"); diff --git a/home/exercices.md b/home/exercices.md index d6d3a782010f5cf5f20885bedd1817377aafa1a0..97b21f24eb3669e90022e7b1c86692f990415fd9 100644 --- a/home/exercices.md +++ b/home/exercices.md @@ -6,9 +6,8 @@ Preliminary setup Prepare and launch the docker container: - HOST_DIR=/$HOME/gdb.py_data/ # absolute path required ; create it manually before - DOCKER_OPT="-v $HOST_DIR:/home/gdb.py/host -e GROUPID=$(id -g) -e USERID=$(id -u) --cap-add sys_ptrace" - docker run -it $DOCKER_OPT kpouget/tuto-gdb.py + HOST_DIR=/home/kevin/gdb.py_debug_data/ # absolute path required + docker run -it -v $HOST_DIR:/home/gdb.py/host -e GROUPID=$(id -g) -e USERID=$(id -u) --cap-add sys_ptrace kpouget/tuto-gdb.py Then if you want to share the data with your host, work from `~/host`, otherwise stay in `~`: @@ -220,4 +219,4 @@ Now you're know the basics of GDB scripting ! Get back to the slides *Part 2*, t 2. Return true breakpoint 3. Register watchpoint 4. Step into next call -5. Faking function execution +5. Faking function execution \ No newline at end of file diff --git a/home/python/.gitignore b/home/python/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eef3799fe6ebae7d840264ecf34c33cb0a7fe8ac --- /dev/null +++ b/home/python/.gitignore @@ -0,0 +1 @@ +section diff --git a/tuto-gdb-py.tgz b/tuto-gdb-py.tgz index 162f6770d60b66fad391e3b1ee463e47a203aa53..89548ef3f67b09caff158d7d283c9eee26fe46d3 100644 Binary files a/tuto-gdb-py.tgz and b/tuto-gdb-py.tgz differ