This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 125773 - Attach to process does not show user's process
Summary: Attach to process does not show user's process
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Egor Ushakov
URL:
Keywords:
: 131968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-22 16:10 UTC by Alexander Pepin
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2008-01-22 16:10:05 UTC
Steps to reproduce:
- create Quote sample
- clean and build it
- run the qoute.exe from console outside the IDE
- call attach to process for Quote from IDE
Result: Process to Attach table contains only ne line
1006	1260	1260	1	19:10:23	/usr/bin/ps
Comment 1 _ gordonp 2008-02-29 23:50:23 UTC
I just tried this starting quote both Cygwin bash and from cmd.exe. In both cases
the process was displayed in the attach list and the attach was successful.

Was the program started with the same userid as netbeans? I gather processes for
the current user. If you still see this problem do a ps command from a bash shell
("ps" with no arguments on Windows). Does it show then? If it shows there but not
from the IDE then please reopen the issue.
Comment 2 thomas_krause 2008-03-14 08:43:58 UTC
The gdb attach feature still not works well (or almost not at all) on Linux and Windows.

The reason are wrong calls to "ps".

Windows:

"ps" (from Cygwin/Msys) is called without arguments. This will only show processes started with Cygwin/Msys. I have a
program (Webots) which starts some processes (robot controllers) after startup. I develop the executables for the new
processes, but they cannot be started alone. The new processes do not show up if you just call "ps" (maybe Webots uses a
Win32 call or something like this) even if Webots itself was started from Msys (which generally does not work well). The
process will be shown if you use "ps -W" (big capital letter "W") since this shows all processes and also the one from
Windows.

Linux (Ubuntu):

Netbeans calls "ps -a" (small capital letter "a"). But this only shows processes from the same terminal. If you start
Netbeans from GUI this means you see no processes at all. Couldn't you use "ps -A" or "ps -e" to see all processes?

Netbeans really needs the attach feature to become a good C/C++ IDE. I was glad when I heard that it will be part of 6.1
because I would love to replace Visual Studio in our project under Windows. But the "attach" feature now only works with
tricky workarounds and not "out of the box".

Since it is possible to filter the process list I really would like to see that all processes of the systems are shown.
This means full flexibility and this is important when you need to use "attach". Maybe it should be possible to enter
the PID directly as well.
Comment 3 _ gordonp 2008-03-14 13:56:40 UTC
The choice of restricted ps commands was by design. I considered adding a toggle
which would allow the user to choose a less restrictive ps option, but chose not
to implement it in 6.1.

I'm changing this issue from a defect to an enhancement. There is (at least) one
other change I'd like to make in the next NB release (allow the project to be a
dynamic/shared library) and I'll plan on implementing this feature then. Since UI
freeze is this weekend its too late to consider this for NB 6.1.
Comment 4 Alexander Pepin 2008-04-04 18:10:14 UTC
Very desirable feature.
see issue #131968
Comment 5 _ gordonp 2008-04-04 18:29:03 UTC
*** Issue 131968 has been marked as a duplicate of this issue. ***
Comment 6 _ gordonp 2008-11-19 00:50:02 UTC
Mostly fixed for Windows with http://hg.netbeans.org/main?cmd=changeset;node=3e580ba55ebf (which also
requires http://hg.netbeans.org/main?cmd=changeset;node=ce719a8ea94e).

I'm leaving this issue open because:

    1) I need to do a Linux equivalent
    2) I'd like a toggle letting the user choose all system processes vs just the user's processes

But the current changesets should fix the Windows issues and allow 151610 to be closed.
Comment 7 Egor Ushakov 2009-03-24 11:39:52 UTC
fixed in:
http://hg.netbeans.org/cnd-main/rev/e48c8a28a69c

now we have "show all processes" checkbox