This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
remote/1862: Can't remotely debug attached process
- From: tron dot thomas at verizon dot net
- To: gdb-gnats at sources dot redhat dot com
- Date: 7 Feb 2005 18:19:13 -0000
- Subject: remote/1862: Can't remotely debug attached process
- Reply-to: tron dot thomas at verizon dot net
>Number: 1862
>Category: remote
>Synopsis: Can't remotely debug attached process
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Feb 07 18:28:01 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator: Tron Thomas
>Release: 6.3
>Organization:
>Environment:
Fedora Core Linux
>Description:
The gdb debugger cannot establish a connection to the remote gdbserver if the server has attached to a running process.
>How-To-Repeat:
Build the following C++ code with debug information as program named "log2":
#include <iostream>
#include <math.h>
int main()
{
using std::cout;
cout << "Please enter a positive numeric value: ";
float fValue;
std::cin >> fValue;
float fResult = ::log(fValue ) / ::log(2.0f);
cout << "The base 2 logarithm for that value is " << fResult << ".\n";
return 0;
}
>From a terminal launch the log2 program in the background
Run "gdbserver host:1234 --attach <PID>" where PID is the process identifier for the log2 background program
>From another terminal on the same machine execute "gdb log2"
>From within gdb execute "target remote 127.0.0.1:1234"
Results:
Connect is refused from the server
Expected:
The connection should be accepted. The connection would have been accept if the log2 program had been run directly from the gdbserver with the command such as "gdbserver host:1234 log2"
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: