{"id":32,"date":"2006-07-25T12:45:57","date_gmt":"2006-07-25T17:45:57","guid":{"rendered":"http:\/\/www.nynaeve.net\/?p=32"},"modified":"2019-12-13T17:41:41","modified_gmt":"2019-12-13T22:41:41","slug":"reverse-debugging-server-and-remote","status":"publish","type":"post","link":"http:\/\/www.nynaeve.net\/?p=32","title":{"rendered":"Reverse debugging -server and -remote"},"content":{"rendered":"<p>Last time, I provided a basic overview of some of the options available for remote debugging using -server and -remote.\u00c2\u00a0 There are still a couple of interesting things to consider about this particular debugging facility which I did not mention last time, though.<\/p>\n<p>One of the more important extra features of -server and -remote is the ability to do reverse connections when using the TCP transport.\u00c2\u00a0 You are probably already familiar with this concept if you have used VNC (or similar tools) to assist with resolving a problem at a customer site.\u00c2\u00a0 Reverse connections allow you to remotely debug a computer that is firewalled off, provided you have an open port for your computer.\u00c2\u00a0 To perform reverse connection debugging, there are a couple of changes that need to be made to how I previously talked about using -server and -remote.<\/p>\n<p>First, you should start the debugger client <em>before<\/em> the debugger server.\u00c2\u00a0 This is because the debugger client will be the program that actually performs a <em>listen<\/em> call on a socket, not the debugger server.<\/p>\n<p>To start a reverse connection debugger client, use the connection string &#8220;tcp:port=<em>port<\/em>,clicon=0.0.0.0&#8243;.\u00c2\u00a0 (The IP address you supply to &#8220;clicon&#8221; is apparently ignored, and the debugger always listens on the wildcard address).\u00c2\u00a0 For example, you could use:<\/p>\n<pre>debugger -remote tcp:port=1234,clicon=0.0.0.0<\/pre>\n<p>Additionally, if you are using WinDbg, you can use the Ctrl-R \/ Connect to Remote Debugger Session UI to accomplish this task if you are not already in a debugging session.<\/p>\n<p>After starting the reverse connection client, it will appear to be frozen.\u00c2\u00a0 In the case of WinDbg, the UI will appear to be unresponsive; this is the normal and expected behavior and not indicative of a problem!<\/p>\n<p>After the reverse connection debugger is started, then the next step is to start the debugger server on the target computer.\u00c2\u00a0 Use a connection string in the form of &#8220;tcp:port=<em>port<\/em>,clicon=<em>client-ip-address<\/em>&#8220;.\u00c2\u00a0 For example:<\/p>\n<pre>debugger -server tcp:port=1234,clicon=127.0.0.1<\/pre>\n<p>After you start the debugger server, it will attempt to connect out to client debugger.\u00c2\u00a0 If all goes well, then you should be able to interact with the remote target the same as if you were using conventional -server and -remote.<\/p>\n<p>As with conventional -server and -remote, you can use the &#8220;.server&#8221; command instead of the &#8220;-server&#8221; command line parameter to start a debugger session on an already active debugger target.<\/p>\n<p>Next time: Additional connection string options that you can use for securing your -server\/-remote remote debugger connections on an untrusted network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last time, I provided a basic overview of some of the options available for remote debugging using -server and -remote.\u00c2\u00a0 There are still a couple of interesting things to consider about this particular debugging facility which I did not mention last time, though. One of the more important extra features of -server and -remote is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,5],"tags":[],"_links":{"self":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/32"}],"collection":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32"}],"version-history":[{"count":1,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":667,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions\/667"}],"wp:attachment":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}