A multiarch container with a sample that connects to Azure IoTHub in C
$ ./build.sh
$ docker run -it --rm multiarch-azure-iot-c:x86_64
Launch the docker container in a terminal with the following command
$ docker run -it --rm -v /Users/seank/Development/multiarch-azure-iot-c/sample:/src/sample2 -p 9090:9090 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined multiarch-azure-iot-c:dev /bin/bash
Edit CMakeLists.txt
to add the -ggdb
flag to the compiler
From the bash shell in the container build the project and launch the debug server
$ cd ../sample2/
$ mkdir bin
$ cd bin
$ cmake ../
$ make
$ gdbserver :9090 ./sample_app
Goto Debug tab in VS Code and select C++ Launch from the drop down and press Start Debugging
- Install gdb
$ brew install gdb --with-all-targets
- Open
Keychain Access
- In the menu, open Keychain Access > Certificate Assistant > Create a certificate
- Give it the name
gdbc
- Identity type: Self Signed Root
- Certificate type: Code Signing
- Check: let me override defaults
- Continue until it prompts you for: "Please specify a keychain where the certificate will be stored."
- Set Keychain: to
System
- Create a certificate and close assistant.
- Find the certificate in System keychains, right click it > get info (or just double click it)
- Expand Trust, set Code signing to
always trust
- Close and Update
- Finally, restart taskgated and sign from terminal:
$ sudo killall taskgated $ sudo codesign -fs gdbc /usr/local/bin/gdb