Q:
I have a simple two machine network for doing two-machine
debugging with GDB on Mac OS X. I try to attach to the target
machine using its IP address such as:
But I always get these errors back:
kdp_bind_remote: unable to resolve host "111.22.33.44"
unable to create connection for host "111.22.33.44":RR_LOOKUP
|
Why can't I attach to the target machine?
A:
You are probably running a version of Mac OS X older than 10.1.
Prior to 10.1, GDB's attach command expects a hostname; an IP address won't
work (r. 2499453). The remainder of this Q&A assumes you can't upgrade your
system to Mac OS X 10.1 or later.
If your network has a domain name server, make sure
that the target machine's hostname and IP address are defined
in the DNS.
If you don't have a DNS on the network, such as the case
where you've just hooked two machines together with a crossover
cable or a standalone hub, you'll need to define hostnames
on both systems in their local NetInfo databases. (This is
equivalent to setting up a hosts file on Mac OS 9 or UNIX.)
Here are the steps to do this:
- Launch
/Applications/Utilities/NetInfo Manager.
- To allow editing the NetInfo database, click the lock
button in the lower left corner of the window.
- Enter your admin password and click OK.
- In the second column of the browser view, select the node
named "machines". You'll see entries for -DHCP-,
broadcasthost, and localhost in the third column.
- The quickest way to create a new entry is to duplicate
an existing one. So select the "localhost" item
in the third column.
- Select Duplicate from the Edit menu.
- A confirmation alert will appear. Click "Duplicate".
- A new entry called "localhost copy" will appear,
and its properties will be shown below the browser view.
Double click the value of the "ip_address" property and enter
the IP address of the other machine.
- Double click the value of the "name" property and enter
the hostname you want for the other machine. (This is the
name you'll use in the GDB
attach command.)
- Single click the "serves" property and select Delete from
the Edit menu.
- Choose Save from the File menu.
- A confirmation alert will appear. Click "Update
this copy".
- Repeat steps 6-12 for each additional host entry you
wish to add, otherwise choose Quit from the NetInfo Manager
menu. You do not need to reboot.
[Jun 02, 2003]
|