Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

remote debugging (need to attach to running process)

539 views
Skip to first unread message

Rune Moberg

unread,
May 6, 1999, 3:00:00 AM5/6/99
to
(isn't there a debug newsgroup somewhere?)

Is there an easy way to attach to a running process on a different
machine? If I use the standard way everything works fine if the debugee
is running on Win9x or NT Workstation, but when the target is on a NT
Terminal Server, it won't pop up anywhere... (that I can see)

Hence, I need to start the executable, find the PID and tell Borland's
debugger where it needs to attach itself... Possible?

--
Rune (http://runesbike.com)

Stefan Hoffmeister (TeamB)

unread,
May 6, 1999, 3:00:00 AM5/6/99
to
: Rune Moberg <r...@runesbike.com> wrote:

>(isn't there a debug newsgroup somewhere?)

Nope. IDE is the group to use.

>Is there an easy way to attach to a running process on a different
>machine?

Well, the Remote Debugger (with Delphi 4 C/S) is all about this

>Hence, I need to start the executable, find the PID and tell Borland's
>debugger where it needs to attach itself... Possible?

You need to install the remote debugger distribution set on the other
machine, preferably running it as a service. Alternatively start the debug
server with

BORDBG41.EXE -listen

(note: this is for C++Builder 4.0; Delphi 4.0 should have BORDBG40.EXE)

from the command line.

Then on your local machine "Run | Attach to process...", enter the IP of
the remote machine, and click "Connect". Worked quite well for 127.0.0.1
right now ;-)

There is online help for this

1796: Remote Debugging
E:\D4\Help\delphi4.hlp

--
Stefan Hoffmeister (TeamB) http://www.econos.de/
Please do apply judgement when sending email.

Rune Moberg

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
"Stefan Hoffmeister (TeamB)" wrote:
> You need to install the remote debugger distribution set on the other
> machine, preferably running it as a service. Alternatively start the debug
> server with
>
> BORDBG41.EXE -listen

Please reread my question... ;-)

I.e. I've done all this and I'm able to debug my app, however my target
is a Terminal Server, hence I have _NO_ control over where the app pops
up (it might pop up on the console of the server, however I have no
monitor attached).

What I really would like to do is to launch the app on the server (in
this case using a terminal server client) use Task Manager to determine
the PID on the remote server, and then simply supply this PID to
Delphi's debugger.

(I thought this was possible, however my memory is probably wrong and
confuses this with when I was doing remote debugging under QNX which is
much more advanced compared to what Borland supplies right now)


--
Rune (http://runesbike.com)

Stefan Hoffmeister (TeamB)

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
: Rune Moberg <r...@runesbike.com> wrote:

>is a Terminal Server, hence I have _NO_ control over where the app pops
>up (it might pop up on the console of the server, however I have no
>monitor attached).

Please explain. You have lost me - I have zero experience with NT Terminal
Server.

Rune Moberg

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
"Stefan Hoffmeister (TeamB)" wrote:
> : Rune Moberg <r...@runesbike.com> wrote:
>
> >is a Terminal Server, hence I have _NO_ control over where the app pops
> >up (it might pop up on the console of the server, however I have no
> >monitor attached).
>
> Please explain. You have lost me - I have zero experience with NT Terminal
> Server.

Think X and multiple clients connected to the same server.

I.e. I have a server, and special client software (Citrix even delivers
clients that can run on a 286 and DOS) that lets me access the server as
if I was logged in alone at the console. However hundreds of clients can
be logged on like that, and they all get their own NT desktop. I can
disconnect and reconnect later, without missing a beat (apps continue to
run if I want them to).

However, all is done using NT technology. Citrix started modifying NT
3.51 and now MS is pushing this technology as "NT Terminal Server 4"
(and this is also part of the current Win2k server beta as far as I can
determine -- I haven't looked very hard).

Thus when I (through Borland's remote debugger) try to launch an app, I
have no control over where the GUI pops up (probably nowhere)! ;-)

I have (or rather had -- fixed now) a problem that happened to a user
running our server on NT Terminal Server, and I thus needed to debug our
app under similar conditions. Since our NT Terminal Server installation
is running on an old monitorless P5-90 (with 32MB RAM), I didn't want to
install the entire Delphi package to do this...

--
Rune (http://runesbike.com)

Stefan Hoffmeister (TeamB)

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
: Rune Moberg <r...@runesbike.com> wrote:

>Thus when I (through Borland's remote debugger) try to launch an app, I
>have no control over where the GUI pops up (probably nowhere)! ;-)

Ah! But you *don't* launch an app. You just attach to the already running
process.

What I just did is this:

* On my local machine choose "Run | Attach to process..."
* Enter the IP of the remote machine, and click "Connect".

You will see a listing of running processes with process IDs.

* Select a process
* Click "Attach"

I just did it with 127.0.0.1

If that does not work for you, please tell me which step does not work for
you.

Rune Moberg

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
"Stefan Hoffmeister (TeamB)" wrote:
> * On my local machine choose "Run | Attach to process..."
[snip]

>
> If that does not work for you, please tell me which step does not work for
> you.

Ah, well.

That's the one.

Is this in Delphi5? (I will go ballistic at the next conference if it is
[1])


[1] and probably if it isn't as well. [2]
[2] yeah, I'm not always an easy customer.

--
Rune, http://runesbike.com

Stefan Hoffmeister (TeamB)

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
: Rune Moberg <r...@runesbike.com> wrote:

>"Stefan Hoffmeister (TeamB)" wrote:
>> * On my local machine choose "Run | Attach to process..."
>[snip]
>>

...
>Is this in Delphi5?

What is "Delphi5"?

This really happens for me in Delphi 4.0 (and Borland C++Builder 4.0 - but
that does not help you). Try

HKEY_CURRENT_USER\Software\Borland\Delphi\4.0\Debugging

with the values

Enable Attach Menu = "1"
EnableAttachMenu = "1"

(I have both entries and cannot tell which one is the correct one)

My experience with the remote debugger is mostly in BCB4 - I am just
transferring knowledge from there to D4.

Erik Berry

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
In article <37335E4E...@runesbike.com>, r...@runesbike.com says...
> That's the one.

If your menu doesn't show the "Attach to Process" selection, try this:

HKCU\Software\Borland\Delphi\4.0\Debugging\Enable Attach Menu = "1"

Maybe Delphi 5 will make it easier to get to this menu item. It is
also a little unstable in D4, for example if you attach to Delphi itself.
<G>

Erik

Rune Moberg

unread,
May 8, 1999, 3:00:00 AM5/8/99
to
"Stefan Hoffmeister (TeamB)" wrote:
> HKEY_CURRENT_USER\Software\Borland\Delphi\4.0\Debugging
>
> with the values

>
> Enable Attach Menu = "1"
> EnableAttachMenu = "1"
>
> (I have both entries and cannot tell which one is the correct one)

The "Enable Attach Menu" value did it for me, thanks!

One word: Wow.

Hmm... There's a help button there, but it ain't linked to any existing
help topic. :-)
(makes sense; I did do a fulltext search for "attach" and similar words)

--
Rune, http://runesbike.com

Stefan Hoffmeister (TeamB)

unread,
May 8, 1999, 3:00:00 AM5/8/99
to
: ebe...@sync-link.com.I.Heart.Spam (Erik Berry) wrote:

>In article <37335E4E...@runesbike.com>, r...@runesbike.com says...
>> That's the one.
>

> Maybe Delphi 5 will make it easier to get to this menu item.

I would bet. Because it is already in C++Builder 4.0.

Rudy Velthuis

unread,
May 9, 1999, 3:00:00 AM5/9/99
to
In article <37335E4E...@runesbike.com>, Rune Moberg wrote...

>[1] and probably if it isn't as well. [2]
>[2] yeah, I'm not always an easy customer.

[3] and you love footnotes [4]
[4] on footnotes <g>

BTW, so do I, I'm already starting to copy this in my messages.
--
Rudy Velthuis
rvel...@gmx.net
http://members.xoom.com/RVelthuis

Rune Moberg

unread,
May 10, 1999, 3:00:00 AM5/10/99
to
Rudy Velthuis wrote:
> [3] and you love footnotes [4]
> [4] on footnotes <g>
>
> BTW, so do I, I'm already starting to copy this in my messages.

Yeah, I know, it's contagious. I picked it up from alt.fan.pratchett!
[1]


[1] A very nice newsgroup devoted to a very nice author (of the
Discworld novels and some other nice books)

--
Rune, "Nanny Ogg knew perfectly well how to spell bananana, but she
didn't know when to stop"

Rudy Velthuis

unread,
May 10, 1999, 3:00:00 AM5/10/99
to
In article <37371914...@runesbike.com>, Rune Moberg wrote...

>[1] A very nice newsgroup devoted to a very nice author (of the
>Discworld novels and some other nice books)
>

Hah! You don't have to tell me that, I've read them all (but I didn't
visit the NG yet - I more like to read than to discuss the books).
--
Rudy Velthuis

Rune Moberg

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
"Stefan Hoffmeister (TeamB)" wrote:
> This really happens for me in Delphi 4.0 (and Borland C++Builder 4.0 - but
> that does not help you). Try
>
> HKEY_CURRENT_USER\Software\Borland\Delphi\4.0\Debugging
>
> with the values
>
> Enable Attach Menu = "1"

I finally got around to actually trying it out against the remote
debugger. It doesn't work, atleast not here! When connecting the process
list remains blank (or rather, is blanked once you press the Connect
button).

Maybe it doesn't like NT Terminal Server 4?

--
Rune (http://runesbike.com)

Stefan Hoffmeister (TeamB)

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
: Rune Moberg <r...@runesbike.com> wrote:

>Maybe it doesn't like NT Terminal Server 4?

No idea. I have only ever tried it against 127.0.0.1

0 new messages