Debugging curl in Unix using ddd/gdb

The first thing that you have to do is download the curl sources

git clone https://github.com/curl/curl.git

Move into the directory & do a cmake & make

cd curl

mkdir build

cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j 4

Start ddd (Data Display Debugger)

ddd src/curl

In the ddd/gdb console type:

list curl/lib/http.c:1478
break Curl_http_connect


run http://ip.jsontest.com

ddd-debug-curl