+2000-10-26 Mo DeJong <mdejong@redhat.com>
+
+ * attachdlg.itb (list_pids): Use "ps axw" to get pid list
+ when running under Linux. Use string match instead of
+ regexp match is ps filter entry.
+ * attachdlg.ith (list_pids): Change default argument to "*".
+
2000-10-23 Fernando Nasser <fnasser@cygnus.com>
* util.tcl (find_iwidgets_library): Use the directories that were
-command [code $this filter_pid_selection]
}
+ $itk_component(pid_filter) insert 0 *
+
itk_component add pid_sep {
frame [$itk_component(choose_pid) childsite].sep \
-height 2 -borderwidth 1 -relief sunken
# point we should steal some C code to do it by hand.
# ------------------------------------------------------------------
-body AttachDlg::list_pids {{expr {}}} {
- if {[catch {::open "|ps w" r} psH]} {
+body AttachDlg::list_pids {{pattern *}} {
+ global tcl_platform
+
+ switch $tcl_platform(os) {
+ Linux {
+ set ps_cmd "ps axw"
+ }
+ default {
+ set ps_cmd "ps w"
+ }
+ }
+ if {[catch {::open "|$ps_cmd" r} psH]} {
set errTxt "Could not exec ps: $psH
You will have to enter the PID by hand."
ManagedWin::open WarningDlg -message [list $errTxt]
gets $psH header
set nfields [llength $header]
- set nfields_m_1 [expr $nfields - 1]
+ set nfields_m_1 [expr {$nfields - 1}]
set regexp {^ *([^ ]*) +}
for {set i 1} {$i < $nfields_m_1} {incr i} {
append regexp {[^ ]* +}
while {[gets $psH line] >= 0} {
regexp $regexp $line dummy PID COMMAND
- if {$expr == "" || [regexp $expr $COMMAND dummy]} {
+ if {[string match $pattern $COMMAND]} {
lappend pid_list [list $PID $COMMAND]
$itk_component(choose_pid) insert end $COMMAND
}