* Adding new target type
@ 2007-09-05 19:32 Robert S. Grimes
2007-09-05 19:39 ` Keith Seitz
0 siblings, 1 reply; 8+ messages in thread
From: Robert S. Grimes @ 2007-09-05 19:32 UTC (permalink / raw)
To: insight
Hi,
I'm trying to add a new target type to the Target Settings dialog.
Specifically, I've patched the underlying gdb with a new target that is
invoked like this from gdb:
target rtems-remote 192.168.1.55:2159
Where, of course, the 192.168.1.55 is replaced with the actual ip
address of the board to be debugged. However, Insight only as usual
four choices. How do I add one?
Seems like a real simple thing to do, but I don't have a clue -
searching didn't come up with anything, but that could well be that I
don't know how best to ask the question!
Thanks!
-Bob
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 19:32 Adding new target type Robert S. Grimes
@ 2007-09-05 19:39 ` Keith Seitz
2007-09-05 20:33 ` Robert S. Grimes
0 siblings, 1 reply; 8+ messages in thread
From: Keith Seitz @ 2007-09-05 19:39 UTC (permalink / raw)
To: Robert S. Grimes; +Cc: insight
Robert S. Grimes wrote:
> target rtems-remote 192.168.1.55:2159
>
This should be pretty easy. You're essentially trying to do just what
gdb's built-in Remote/TCP target does. Take a look at this target in the
target database in gdb/gdbtk/library/targetselection.itb.
Keith
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 19:39 ` Keith Seitz
@ 2007-09-05 20:33 ` Robert S. Grimes
2007-09-05 20:44 ` Keith Seitz
0 siblings, 1 reply; 8+ messages in thread
From: Robert S. Grimes @ 2007-09-05 20:33 UTC (permalink / raw)
To: Keith Seitz; +Cc: insight
Keith Seitz wrote:
> Robert S. Grimes wrote:
>> target rtems-remote 192.168.1.55:2159
>>
>
> This should be pretty easy. You're essentially trying to do just what
> gdb's built-in Remote/TCP target does. Take a look at this target in
> the target database in gdb/gdbtk/library/targetselection.itb.
>
Hi Keith,
Right, should be - that's what I was hoping for! I looked at the file
you referenced, and made these changes
<snip>
# Remote
<snip>
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) {}
# RTEMS Remote - NEW!
set gdb_target(rtemsremotetcp,pretty-name) "RTEMS Remote/TCP"
set gdb_target(rtemsremotetcp,defbaud) "TCP"
set gdb_target(rtemsremotetcp,baud-rates) {}
set gdb_target(rtemsremotetcp,cmd) "rtems-remote tcpX"
set gdb_target(rtemsremotetcp,runlist) {1 1 0 1}
set gdb_target(rtemsremotetcp,after_attaching) {}
Then I rebuilt and installed ("make && make install"). Didn't seem to
make any difference, so I did a "make clean" in the gdb/gdbtk directory,
and tried again. Make worked a bit harder, but the results are the same
- no new target.
Looking in the file you mentioned, there are a whole lot of targets!
Many more than I have ever seen. So, I must be missing the magic step
where I specify which targets to include in the build, right? How is
that done?
Thanks!
-Bob
> Keith
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 20:33 ` Robert S. Grimes
@ 2007-09-05 20:44 ` Keith Seitz
2007-09-05 20:56 ` Robert S. Grimes
0 siblings, 1 reply; 8+ messages in thread
From: Keith Seitz @ 2007-09-05 20:44 UTC (permalink / raw)
To: Robert S. Grimes; +Cc: insight
Robert S. Grimes wrote:
> <snip>
> # Remote
> <snip>
> 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) {}
>
> # RTEMS Remote - NEW!
> set gdb_target(rtemsremotetcp,pretty-name) "RTEMS Remote/TCP"
> set gdb_target(rtemsremotetcp,defbaud) "TCP"
> set gdb_target(rtemsremotetcp,baud-rates) {}
> set gdb_target(rtemsremotetcp,cmd) "rtems-remote tcpX"
> set gdb_target(rtemsremotetcp,runlist) {1 1 0 1}
> set gdb_target(rtemsremotetcp,after_attaching) {}
That looks correct.
> Then I rebuilt and installed ("make && make install"). Didn't seem to
> make any difference, so I did a "make clean" in the gdb/gdbtk directory,
> and tried again. Make worked a bit harder, but the results are the same
> - no new target.
Hmm... Odd... [BTW, it's tcl: just reinstall or copy the changed
targetselection.itb to the install directory.]
The only thing I can think of off the top of my head (other than an
installation error) is TargetSelection::valid_target, which will attempt
to do the cli command "help target rtems-remote".
Does this return something valid for your target? If it errors, your
target will not show up in the dialog.
Keith
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 20:44 ` Keith Seitz
@ 2007-09-05 20:56 ` Robert S. Grimes
2007-09-05 21:07 ` Keith Seitz
0 siblings, 1 reply; 8+ messages in thread
From: Robert S. Grimes @ 2007-09-05 20:56 UTC (permalink / raw)
To: Keith Seitz; +Cc: insight
Keith Seitz wrote:
>> # RTEMS Remote - NEW!
>> set gdb_target(rtemsremotetcp,pretty-name) "RTEMS Remote/TCP"
>> set gdb_target(rtemsremotetcp,defbaud) "TCP"
>> set gdb_target(rtemsremotetcp,baud-rates) {}
>> set gdb_target(rtemsremotetcp,cmd) "rtems-remote tcpX"
>> set gdb_target(rtemsremotetcp,runlist) {1 1 0 1}
>> set gdb_target(rtemsremotetcp,after_attaching) {}
>
> That looks correct.
Thanks for the confirmation.
>
> Hmm... Odd... [BTW, it's tcl: just reinstall or copy the changed
> targetselection.itb to the install directory.]
Oh!
>
> The only thing I can think of off the top of my head (other than an
> installation error) is TargetSelection::valid_target, which will
> attempt to do the cli command "help target rtems-remote".
>
> Does this return something valid for your target? If it errors, your
> target will not show up in the dialog.
Yes, here is what I get from the console window:
(gdb) help target rtems-remote
rtems target; specify link: <serial_dev> | <host>:<port>
I also tried this, just in case:
(gdb) help target rtems-remote tcpX
rtems target; specify link: <serial_dev> | <host>:<port>
And of course, this works:
(gdb) target rtems-remote 192.168.1.55:2159
at least with gdb only.
Any other ideas?
Thanks!
-Bob
>
> Keith
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 20:56 ` Robert S. Grimes
@ 2007-09-05 21:07 ` Keith Seitz
2007-09-05 21:46 ` Robert S. Grimes
0 siblings, 1 reply; 8+ messages in thread
From: Keith Seitz @ 2007-09-05 21:07 UTC (permalink / raw)
To: Robert S. Grimes; +Cc: insight
Robert S. Grimes wrote:
> And of course, this works:
>
> (gdb) target rtems-remote 192.168.1.55:2159
>
> at least with gdb only.
Fooey.
> Any other ideas?
Ah, I think I know what it could be... You wrote:
# RTEMS Remote - NEW!
set gdb_target(rtemsremotetcp,pretty-name) "RTEMS Remote/TCP"
set gdb_target(rtemsremotetcp,defbaud) "TCP"
set gdb_target(rtemsremotetcp,baud-rates) {}
set gdb_target(rtemsremotetcp,cmd) "rtems-remote tcpX"
set gdb_target(rtemsremotetcp,runlist) {1 1 0 1}
set gdb_target(rtemsremotetcp,after_attaching) {}
This isn't going to work. Take a look at TargetSelection::fill_targets
and TargetSelection::get_target_list. If you type "help target", you
should get your target in the output. I'm guessing a line that looks
like "target rtems-remote -- BLAH BLAH". The "rtems-remote" is the
actual name of the target, and the one you need to use as the lead index
in the target database instead of "rtemsremotetcp". The dummy "tcp"
targets are for targets which have multiple connection possibilities.
See if that fixes anything. [It might help to put a "dbug" statement in
TargetSelection::fill_targets so that you tell what it is doing.]
Keith
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 21:07 ` Keith Seitz
@ 2007-09-05 21:46 ` Robert S. Grimes
2007-09-05 22:15 ` Keith Seitz
0 siblings, 1 reply; 8+ messages in thread
From: Robert S. Grimes @ 2007-09-05 21:46 UTC (permalink / raw)
To: Keith Seitz; +Cc: insight
Keith Seitz wrote:
>
> This isn't going to work. Take a look at TargetSelection::fill_targets
> and TargetSelection::get_target_list. If you type "help target", you
> should get your target in the output. I'm guessing a line that looks
> like "target rtems-remote -- BLAH BLAH". The "rtems-remote" is the
> actual name of the target, and the one you need to use as the lead
> index in the target database instead of "rtemsremotetcp". The dummy
> "tcp" targets are for targets which have multiple connection
> possibilities.
Not really following you exactly, but... it works! Here's what I put there:
# RTEMS Remote
# set gdb_target(rtems-remote,pretty-name) "RTEMS Remote"
# set gdb_target(rtems-remote,defbaud) "38400"
# set gdb_target(rtems-remote,baud-rates) {9600 19200 38400 57600 115200}
# set gdb_target(rtems-remote,cmd) "rtems-remote com1"
# set gdb_target(rtems-remote,runlist) {1 1 0 1}
# set gdb_target(rtems-remote,after_attaching) {}
set gdb_target(rtems-remote,pretty-name) "RTEMS Remote/TCP"
set gdb_target(rtems-remote,defbaud) "TCP"
set gdb_target(rtems-remote,baud-rates) {}
set gdb_target(rtems-remote,cmd) "rtems-remote tcpX"
set gdb_target(rtems-remote,runlist) {1 1 0 1}
set gdb_target(rtems-remote,after_attaching) {}
When I open the Target Selection dialog now, I see "RTEMS Remote/TCP",
and when I select that, it gets pre-filled with 192.168.1.69, port 2159,
just like I want it to! Of course, I'm not sure where those host:port
values came from, but I'm guessing its some cache action on the part of
gdb, as that's the last target I attempted to - is that right?
Note from the above that I was also trying to get the serial setup to
work, but that presented one oddity - when I selected the serial RTEMS
target, the Baud value started out with "TCP" instead of 38400 - odd.
But don't worry, I don't want to use the serial port anyway, and even if
I did, I could live with that.
Thanks, Kevin!!!
-Bob
>
> See if that fixes anything. [It might help to put a "dbug" statement
> in TargetSelection::fill_targets so that you tell what it is doing.]
>
> Keith
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Adding new target type
2007-09-05 21:46 ` Robert S. Grimes
@ 2007-09-05 22:15 ` Keith Seitz
0 siblings, 0 replies; 8+ messages in thread
From: Keith Seitz @ 2007-09-05 22:15 UTC (permalink / raw)
To: Robert S. Grimes; +Cc: insight
Robert S. Grimes wrote:
>
> Not really following you exactly, but... it works! Here's what I put there:
I think you followed me exactly... :-)
> When I open the Target Selection dialog now, I see "RTEMS Remote/TCP",
> and when I select that, it gets pre-filled with 192.168.1.69, port 2159,
> just like I want it to! Of course, I'm not sure where those host:port
> values came from, but I'm guessing its some cache action on the part of
> gdb, as that's the last target I attempted to - is that right?
Hmm. I don't know where that would have come from. Insight's target
settings are pretty disjoint from gdb's... Nonetheless, Insight should
remember these numbers for you after you enter them the first time.
> Note from the above that I was also trying to get the serial setup to
> work, but that presented one oddity - when I selected the serial RTEMS
> target, the Baud value started out with "TCP" instead of 38400 - odd.
Yeah, that is odd. As long as you have the two database targets
"rtems-remote" and "rtems-remotetcp", you should be fine. Just
cut-n-paste the entries for Remote Serial/TCP.
> But don't worry, I don't want to use the serial port anyway, and even if
> I did, I could live with that.
Okay -- cool!
Happy hacking,
Keith
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-09-05 22:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-05 19:32 Adding new target type Robert S. Grimes
2007-09-05 19:39 ` Keith Seitz
2007-09-05 20:33 ` Robert S. Grimes
2007-09-05 20:44 ` Keith Seitz
2007-09-05 20:56 ` Robert S. Grimes
2007-09-05 21:07 ` Keith Seitz
2007-09-05 21:46 ` Robert S. Grimes
2007-09-05 22:15 ` 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).