From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9479 invoked by alias); 24 Apr 2009 03:06:29 -0000 Received: (qmail 9468 invoked by uid 22791); 24 Apr 2009 03:06:28 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Apr 2009 03:06:22 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3O36Kt5030727 for ; Thu, 23 Apr 2009 23:06:20 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3O36JsS023240 for ; Thu, 23 Apr 2009 23:06:20 -0400 Received: from lindt.uglyboxes.com (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3O36B5D005397 for ; Thu, 23 Apr 2009 23:06:15 -0400 Message-ID: <49F12CA3.70102@redhat.com> Date: Fri, 24 Apr 2009 03:06:00 -0000 From: Keith Seitz User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: insight Subject: [PATCH] Fix default target selection arguments for "exec" targets Content-Type: multipart/mixed; boundary="------------020101080307020000070003" X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00022.txt.bz2 This is a multi-part message in MIME format. --------------020101080307020000070003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1014 Hi, I've committed the attached patch which fixes the two issues reported recently regarding 1) the exec target not being selected by default on non-cross versions of insight and 2) arguments not being synced between the console and the dialog. I did not check this on cross debuggers, but I don't think I touched anything that would affect those. But as always, if you find that I broke something, let me know and I will put it on my TODO list. I will do a snapshot of insight on Monday to reflect the updated code base. Keith ChangeLog 2009-04-23 Keith Seitz * library/targetselection.itb (init_target_db): Add comment about "arguments" vs "options" on native debuggers. (build_win): If the target is "default", choose "Exec" for native debuggers. For cross debuggers, let the user choose. (write_saved): For exec targets, save target options to gdb via gdb_set_inferior_args. (config_dialog): For "exec" targets, save gdb's stored arguments into the options preference. --------------020101080307020000070003 Content-Type: text/plain; name="exec-prefs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="exec-prefs.patch" Content-length: 2340 Index: library/targetselection.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/targetselection.itb,v retrieving revision 1.23 diff -u -p -r1.23 targetselection.itb --- library/targetselection.itb 14 Jul 2008 23:43:36 -0000 1.23 +++ library/targetselection.itb 24 Apr 2009 03:01:29 -0000 @@ -74,6 +74,8 @@ itcl::body TargetSelection::init_target_ set gdb_target(exec,baud-rates) {} set gdb_target(exec,cmd) "" set gdb_target(exec,runlist) {0 0 1 0} + # NOTE: for native "options", we use the sessions-stored preference + # which is really inferior arguments set gdb_target(exec,options) "" set gdb_target(exec,after_attaching) {} @@ -589,6 +591,12 @@ itcl::body TargetSelection::build_win {} pack $MoreFrame -fill x -expand yes pack $f $opts -side top -fill x + # If the target is set to "default", select an appropriate + # default: on native debuggers, choose "Exec"; otherwise, make + # the user choose. + if {[string compare $target "default"] == 0 && [native_debugging]} { + set target exec + } change_target $gdb_target($target,pretty-name) button $btns.ok -text [gettext OK] -width 7 -command [code $this save] \ @@ -657,6 +665,10 @@ itcl::body TargetSelection::write_saved pref setd gdb/load/$target-runlist [list $saved_attach $saved_load $saved_run $saved_cont] if {[info exists gdb_target($target,options)]} { pref setd gdb/load/$target-opts $saved_options + + # For the case of "exec" targets, also save the options + # so that the command line picks them up. + gdb_set_inferior_args $saved_options } if {[catch {$_after_entry get} saved_after_attaching]} { set saved_after_attaching "" @@ -785,6 +797,8 @@ itcl::body TargetSelection::config_dialo # FIXME: this is really overloaded!! if {$t == "exec"} { set text "Arguments:" + # Also set the target options to the session's saved arguments + pref set gdb/load/$t-opts [gdb_get_inferior_args] } else { set text "Options:" } @@ -808,7 +822,6 @@ itcl::body TargetSelection::change_targe $RunMethod.cont configure -state normal } - debug "$target" set defbaud $gdb_target($target,defbaud) pref define gdb/load/$target-baud $defbaud pref define gdb/load/$target-portname 1000 --------------020101080307020000070003--