Skip to content

Instantly share code, notes, and snippets.

@cemtopkaya
Created August 13, 2025 17:07
Show Gist options
  • Select an option

  • Save cemtopkaya/d20c11dfd9b2d27e0ec41c7ed3407cd4 to your computer and use it in GitHub Desktop.

Select an option

Save cemtopkaya/d20c11dfd9b2d27e0ec41c7ed3407cd4 to your computer and use it in GitHub Desktop.
Uygulamaların hata ayıklama modu

“hangi program, hangi dil, hangi debugger” ?

Mesela: • Java ise: Başlatma parametrelerine -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 gibi bir ek yaparsın, sonra IDE’den (IntelliJ, VS Code) remote debug ile 5005’e bağlanırsın. • Node.js ise: Komutu node --inspect=0.0.0.0:9229 app.js şeklinde değiştirirsin, sonra Chrome DevTools ya da VS Code ile bağlanabilirsin. • Python ise: debugpy gibi bir modül ekleyip debugpy.listen(("0.0.0.0", 5678)) çağırırsın, ardından IDE bağlanır. • C/C++ ise: gdbserver :1234 ./program tarzı başlatırsın, sonra gdb ile attach olursun.

Docker veya benzeri bir konteyner ortamındaysa config dosyasına ek olarak: 1. Debug portunu container dışına açman lazım (ports: veya -p 5005:5005 gibi). 2. Programın debug modunda çalıştırılması için entrypoint/command kısmını değiştirmelisin. 3. Debugger’ın bağlanacağı portun firewall tarafından engellenmemesi lazım.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to Docker Node",
            "address": "a3gw",
            "port": 9229,
            "restart": true,
            "protocol": "inspector",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "localRoot": "${workspaceFolder}/.devcontainer/services/a3gw/build/a3gw-vfghana/src",
            "remoteRoot": "/a3gw"
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment