Re: [PATCH 3/4] Explicit fixed-width integral File I/O protocol types

Julio Guerra
2018-05-02T16:31:34Z

Le 02/05/2018 à 18:14, Joel Brobecker a écrit :
>> Since I am talking a lot of embedded software, I CC'd Joel Brobecker
>> from AdaCore to maybe give the final direction for a v2.
> I'm not really sure what is expected of me, can you clarify? If you
> are thinking of my experience with baremetal targets, that's no problem.
> But, although I do work with C code on baremetal targets, it tends
> to be in situations where we have a C library (based on newlib, for
> the most part).
Yes, this is why I thought of you.
> Are we talking about the remote File-IO extension? I should say up front
> that my knowledge of this extension was nearly null until I read the
> documentation in the manual. I think Pedro is the expert on that.
Yes, we are talking about the File IO extension.
> If I understand correctly, you are arguing that we should be providing
> fileio.h so that programs being debugged can use it? I don't understand
> how this would integrate with GDB, though. If I understand correctly,
> this file is used for the definition of some structures used within
> the remote protocol, so the information exchanged between GDB and
> GDBserver. How would you exploit that? (what this tells me is that
> your patch series deserves a documentation update)
No, these structures in fileio.h are passed from GDB to the target
program being debugged through its GDBserver.

When encapsulated in the newlib, it requires to stub the available
syscalls using this extension (that's what we do) . The situation is the
same at the stub level (redefining File IO structures, changing the
endianness if necessary, and copying them into standard structures (for
struct stat and struct timeval).

Ok, so let's wait Pedro's answer ;)

Thank you,

--
Julio Guerra