From: msarasa@fh-konstanz.de
To: gdb@sources.redhat.com
Cc: jingham@cygnus.com
Subject: targetselection.itb problem
Date: Wed, 30 Jul 2003 15:14:00 -0000 [thread overview]
Message-ID: <1059578120.3f27e108a3a2e@webmail.fh-konstanz.de> (raw)
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.
reply other threads:[~2003-07-30 15:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1059578120.3f27e108a3a2e@webmail.fh-konstanz.de \
--to=msarasa@fh-konstanz.de \
--cc=gdb@sources.redhat.com \
--cc=jingham@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).