This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: how to debug eCos apps using gdb over TCP?


Kevin Hilman wrote:
Jonathan Larmour <jifl@eCosCentric.com> writes:


Kevin Hilman wrote:

From what I can tell in eCos you can only use gdb over a non-blocking
getchar/putchar type interface and I don't see any of the HALs using
sockets for their implementations of HAL_STUB_PLATFORM_[PUT|GET]_CHAR.

Nope, what happens in all modern ports is that virtual vectors are used. That means the GDB stubs interface with a comms channel rather than directly to the HAL. For serial that comms channel will point to HAL functions, for ethernet, it points to special net functions.


Are there restrictions on what the HAL getchar/putchar interface can
be?  Are there any reasons the HAL functions couldn't be socket calls?
Or, in my case I have a platform-specific communication package that
I'd like to use for the gdb communication channel.

Obviously you have to prevent recursion - you can't call the HAL output functions directly or indirectly from within those calls.


Also you have to be careful where else it is called if it means the system may be in an inconsistent state for your socket calls. e.g. if you called from an interrupt handler.

Yep, you port RedBoot ;-). Seriously, the TCP debug support is only in
RedBoot.

I guess the question is: is there any reason TCP debug support (or any other homebrew communication) couldn't be added to the HAL-specific comm interface in eCos (without RedBoot).

It's all software, so of course not ;-). The net stack currently lives in RedBoot of course.


My platform is a PCI add-in card without a serial port or a network
port.  But, we have a communication library that do IP over PCI to the
host PCs network.  And it is this communication library that I'd like
to use as gdb's debug channel.

Yes it's possible. You "just" have to do what RedBoot does to get the channel going. Note that the stack is polled not interrupt driven though.


Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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