This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: targetselection.itb problem
- From: Keith Seitz <keiths at redhat dot com>
- To: msarasa at fh-konstanz dot de
- Cc: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: 30 Jul 2003 08:33:21 -0700
- Subject: Re: targetselection.itb problem
- Organization:
- References: <1059578120.3f27e108a3a2e@webmail.fh-konstanz.de>
[Redirected to proper mailing list]
I'll top post on this one.
Please browse the mailing list. This EXACT discussion took place not
more than a month ago.
Keith
On Wed, 2003-07-30 at 08:15, msarasa@fh-konstanz.de wrote:
> 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.
>