This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding new target in Targetselection.itb


Quoting Keith Seitz <keiths@redhat.com>:

> > On Tue, 2003-07-01 at 04:38, msarasa@fh-konstanz.de wrote:
> > >   set gdb_target(remote,pretty-name) "Remote/Serial"
> > >   set gdb_target(remotetcp,pretty-name) "Remote/TCP"
> > >   set gdb_target(remote,pretty-name) "Remote/Simuart_e1"
> 
> > > But the problem is that this overwrites the Remote serial option. This
> way 
> > > just Simuart and TCP are displayed in the option box menu.
> 
> You've noticed by now that the target selection is a little primitive.
> It really doesn't do an adequate job of identifying debug protocols (ARM
> angel, gdb's remote protocol, etc) and tranports (tcp, serial).
> 
> What you have defined is a new transport layer. If you look carefully at
> the code snippet above, you'll notice that you've overwritten the
> database name of the remote protocol over a serial line. Both your
> entries and the Remote/Serial entires use the database identifier
> "remote". Notice how Remote/TCP uses "remotetcp". I think that if you
> simply change the name from "remote" to "remotesimuart" or something,
> you should get both.
> 
> If this doesn't work, I've a few other ideas about what might be causing
> trouble, but let's start with the simplest for now.
> 
> Keith
> 
> 

Thanx a lot for your answer!!

I tried what you told me , and of course you were right. The problem is:

This way:
# 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) {}
  # 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) {}

I don't overwrite the remote serial option. I have to modify the code for the 
valid_target function (in targetselection.itb too) and add:

if {[regexp "simuart$" $target]} {
    # Special case (hacked for e1)
    regsub simuart$ $target {} foo
    return [valid_target $foo]
  }

to do something likely to the tcp option.

This way i've got my remotesimuart choose in the menu box after the others 
(serial , cisco , tcp...) but , after i choose that and try to do
"connect to target" in the RUN menu, i get an error message.
Undefined target command: "remotesimuart".

When I did it the other way (overwriting) all worked properly , but now , I 
got the new option , but gdb don't execute "target remote simuart" like before 
but "remotesimuart".

I'm going crazy with this. Any ideas wellcomed.
Vielen Dank.

Miguel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]