public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Adding new target in Targetselection.itb
       [not found] <1057059523.3f0172c3446d1@webmail.fh-konstanz.de>
@ 2003-07-01 19:25 ` Keith Seitz
  2003-07-02 14:17   ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2003-07-01 19:25 UTC (permalink / raw)
  To: msarasa; +Cc: insight

[forwarded to proper mailing list -- reply in follow-up]

On Tue, 2003-07-01 at 04:38, msarasa@fh-konstanz.de wrote:
> I've added a new target type succesfully , it's a software-simulated uart, 
> that can be called among the remote protocol. It means that now I'm allowed to 
> connect a target not only using a real serial line , but with a software 
> serial line. Useful to connect software-sim boards.
> But , I want to include an option in the dialog-box "target selection" I've 
> modified the "targetselection.itb" file and appended a new target 
> It looks like:
> # 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(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) {}
> 
> 
> But the problem is that this overwrites the Remote serial option. This way 
> just Simuart and TCP are displayed in the option box menu.
> 
> What should I modify in order to maintain the other options and add mine 
> without overwriting?
> 
> Thanks a lot!!
> Miguel
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding new target in Targetselection.itb
  2003-07-01 19:25 ` Adding new target in Targetselection.itb Keith Seitz
@ 2003-07-02 14:17   ` Keith Seitz
  2003-07-03 15:30     ` msarasa
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2003-07-02 14:17 UTC (permalink / raw)
  To: msarasa; +Cc: insight

> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding new target in Targetselection.itb
  2003-07-02 14:17   ` Keith Seitz
@ 2003-07-03 15:30     ` msarasa
  2003-07-03 15:38       ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: msarasa @ 2003-07-03 15:30 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding new target in Targetselection.itb
  2003-07-03 15:30     ` msarasa
@ 2003-07-03 15:38       ` Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2003-07-03 15:38 UTC (permalink / raw)
  To: msarasa; +Cc: insight

On Thu, 2003-07-03 at 08:31, msarasa@fh-konstanz.de wrote:
> 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]
>   }
> 

When you have your version of gdb, what does "help target remote
simuart" say? If it does NOT cause an error (which I suspect it
doesn't), then you don't need to modify valid_target.

If "help target remote simuart" DOES return an error, then gdb doesn't
think that "remote simuart" is a valid target. Fix gdb. Or hack around
it in valid_target. Say that simuart is always valid.

Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-03 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1057059523.3f0172c3446d1@webmail.fh-konstanz.de>
2003-07-01 19:25 ` Adding new target in Targetselection.itb Keith Seitz
2003-07-02 14:17   ` Keith Seitz
2003-07-03 15:30     ` msarasa
2003-07-03 15:38       ` Keith Seitz

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).