From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12142 invoked by alias); 30 Jul 2003 15:14:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12135 invoked from network); 30 Jul 2003 15:14:28 -0000 Received: from unknown (HELO suntana.fh-konstanz.de) (141.37.9.230) by sources.redhat.com with SMTP; 30 Jul 2003 15:14:28 -0000 Received: from localhost (s4502.fh-konstanz.de [141.37.9.242]) by suntana.fh-konstanz.de (8.9.3+Sun/8.9.3) with ESMTP id RAA15065; Wed, 30 Jul 2003 17:14:26 +0200 (MEST) Received: from 212.62.199.50 ( [212.62.199.50]) as user msarasa@localhost by webmail.fh-konstanz.de with HTTP; Wed, 30 Jul 2003 17:15:20 +0200 Message-ID: <1059578120.3f27e108a3a2e@webmail.fh-konstanz.de> Date: Wed, 30 Jul 2003 15:14:00 -0000 From: msarasa@fh-konstanz.de To: gdb@sources.redhat.com Cc: jingham@cygnus.com Subject: targetselection.itb problem MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15;q=1.0 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 212.62.199.50 X-SW-Source: 2003-07/txt/msg00345.txt.bz2 I'm finishing my Final Project for Computer Science, but I'm not able to get the solution for a little detail. HAcking the remote serial protocol , I've added a new file ser-simuart.c like ser-unix.c or ser-pipe.c. This allows gdb to communicate with a software simulated device through a software sim Uart. from the console , we write (gdb) target remote simuart and it connects to the simulator. But in the target selection dialog , I find some problems: In the file targetselection.itb located in gdbtk/library to the existant code: # Remote set gdb_target(remote,pretty-name) "Remote/Serial" set gdb_target(remote,defbaud) "9600" set gdb_target(remote,baud-rates) {9600 19200 38400 57600 115200} set gdb_target(remote,cmd) "remote com1" set gdb_target(remote,runlist) {1 1 0 1} set gdb_target(remote,after_attaching) {} set gdb_target(remotetcp,pretty-name) "Remote/TCP" set gdb_target(remotetcp,defbaud) "TCP" set gdb_target(remotetcp,baud-rates) {} set gdb_target(remotetcp,cmd) "remote tcpX" set gdb_target(remotetcp,runlist) {1 1 0 1} set gdb_target(remotetcp,after_attaching) {} I've added: # Simuart E1 overwriting remote serial target set gdb_target(remote,pretty-name) "Remote/Simuart_e1" set gdb_target(remote,defbaud) "" set gdb_target(remote,baud-rates) {} set gdb_target(remote,cmd) "remote simuart" set gdb_target(remote,runlist) {1 1 0 1} set gdb_target(remote,after_attaching) {} This works properly , but overwrites the remote serial option. So , just the remote simuart is displayed in the roll-down menu. If I do: # Simuart E1 set gdb_target(remotesimuart,pretty-name) "Remote/Simuart_e1" set gdb_target(remotesimuart,defbaud) "" set gdb_target(remotesimuart,baud-rates) {} set gdb_target(remotesimuart,cmd) "remote simuart" set gdb_target(remotesimuart,runlist) {1 1 0 1} set gdb_target(remotesimuart,after_attaching) {} And also modify : # Returns 1 if TARGET is a _runnable_ target for this gdb. body TargetSelection::valid_target {target} { set err [catch {gdb_cmd "help target $target"}] if {$target == "exec" && ![native_debugging]} { set err 1 } if {[regexp "tcp$" $target]} { # Special case (of course) regsub tcp$ $target {} foo return [valid_target $foo] } #modificado if {[regexp "simuart$" $target]} { # Special case (hacked for e1) regsub simuart$ $target {} foo return [valid_target $foo] } return [expr {$err == 0}] } to make the new target a possible one, both remote serial and remote simuart are displayed in the menu, but as i choose simuart one and try to connect , an error window tells me that "remotesimuart" is not a valid command. This doesn't happens with the first option , gdb executes "remote simuart" as said in the cmd option. I also modified: # ------------------------------------------------------------------ # METHOD: fill_targets - fill target combobox # ------------------------------------------------------------------ body TargetSelection::fill_targets {} { #[$fr.tar subwidget listbox] delete 0 end $fr.tar list delete 0 end foreach val $target_list { if {[info exists gdb_target($val,pretty-name)]} { $fr.tar list insert end $gdb_target($val,pretty-name) # Insert TCP target, if it exists if {[info exists gdb_target(${val}tcp,pretty-name)]} { $fr.tar list insert end $gdb_target(${val}tcp,pretty-name) } #modificado simuart # Insert SIMUART target, if it exists if {[info exists gdb_target(${val}simuart,pretty-name)]} { $fr.tar list insert end $gdb_target(${val}simuart,pretty-name) } } } } What am I doing wrong? I want to display both remote/serial and remote simuart as valid target (they are) and to execute "target remote simuart" if this option is the chosen one. Thanks a lot for the help! miguel.