debug linux daemon in remote server

Using GNU screen + gdb utility to debug daemon software in remote machine


# Launch the daemon service

/etc/init.d/dnsproxy start


# Create a screen session, say dns

screen -dmS dns


# Attach to the screen session

screen -r dns


# Launch gdb with in the session


attach xxxx



# Detach the screen session




# Debug code with gdb by Attaching to the screen session second time

screen -r dns