Debugger connecting to wrong IP

Topics for the Eclipse Environment
Post Reply
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Debugger connecting to wrong IP

Post by sulliwk06 »

I'll start by saying I've never used the debugger before. I'm trying to get the debugger to connect to my application, but it its trying to connect to the wrong IP. Previously the project IP was set to 192.168.1.3, but I changed the IP on the device to 192.168.1.5, so I had to change the project settings to match. I changed the IP in Project->Properties->Netburner Options, and I also changed it in the Debug Configurations window. But when I try to connect, the error shows it trying to connect to the previous IP:

"Target selection failed.
192.168.1.3:2159: No connection could be made because the target machine actively refused it."

The IP shows up correctly everywhere. How do I get the debugger to connect on the new IP?
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: Debugger connecting to wrong IP

Post by Ridgeglider »

For some reason, there are 2 places in the Properties tabs where IP must be specified. Sometimes, if you copy settings from one project to another, (rather than define a new project from scratch) the copied settings get mixed up and retain the settings of the parent project.

Select your project in the Project Explorer. Right Click. Select Properties. In the left hand Properties column, select NetBurner Options, then in the right hand pane set the IP, click APPLY. Next, go back to the left hand Properties pane, select Run/Debug Settings. You should see a launc configuration for your project. Select it, the click EDIT and make sure the project and the target IP are properly spec'd. Click OK, then APPLY, then OK.
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Debugger connecting to wrong IP

Post by sulliwk06 »

Apparently, there is a third place you have to change it as well. I already had the 2 you mentioned set up correctly. But under the specific Debug Configuration you have selected, there is a Debugger tab, which has a Connection tab, which has an IP field that was still set to the old one.

It seems like an awful lot of work just to change the target IP for debugging. Anyways, it works now.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Debugger connecting to wrong IP

Post by rnixon »

I think there are really just 2 that count: the ones in the release and debug tabs of the run and debug configuration. The 3rd one, in the netburner project properties, seems to be there to try and make things easier, but I have had to go directly to the release and debug tabs most of the time.
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Debugger connecting to wrong IP

Post by sulliwk06 »

So I solved the original problem I had, but now I have a new IP related problem with the debugger.

My application runs on a MOD5282 and uses Multihome so that I can DHCP an address and use a static address at the same time. I have the call to InitializeNetworkGDB_and_Wait(); after the section where I DHCP and add my static address.

In the process of getting the debugger to connect, I noticed that it would only connect to the address that is stored in the config record on the device. It won't connect to any address that is added at runtime. I noticed this because when I changed my IP at runtime, if I use the search button in the debug configuration it finds the address that was in the config record, even though that address doesn't match any of the current interfaces on the device.

If I try to connect to the static address I assign at runtime, I get errors like
"Target selection failed.
192.168.1.3:2159: No connection could be made because the target machine actively refused it."

When I have successfully DHCP'd an address and try to connect to the DHCP'd address or the address in the config record, I get errors like
"Target selection failed.
192.168.1.2:2159: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
and
"Target request failed: Failed to interrupt."


The only situation where I can connect is if I failed to DHCP an address, I can connect to the address in the config record. Is there any way I can use the debugger and DHCP an address at the same time?
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: Debugger connecting to wrong IP

Post by pbreed »

If you look in NetworkDebug.h

You will find a macro called...

DebugIP(x)


This allows you to set a specific static Debug IP address.
This forces the debugger to use an IP that is different than the DHCP or configured IP.

So usage would be....

DebugIP("!0.1.1.123");
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Debugger connecting to wrong IP

Post by sulliwk06 »

Excellent, this worked perfectly, thank you.
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Debugger connecting to wrong IP

Post by tod »

That little gem from Paul seems worth putting in a FAQ or a wiki or a manual or something!
Post Reply