Re: [patch] Add QNX remote protocol headers.

Daniel Jacobowitz
2005-09-10T03:51:49Z

On Tue, Sep 06, 2005 at 12:09:37PM -0400, Kris Warkentin wrote:
> Hi,
>
> I'm trying to break things up into smaller patches. The actual remote
> support is the biggest patch. These headers are nice and bite sized and
> most of our other targets are fairly discrete as well.
>
> The file dsmsgs.h describes the structures used by the remote protocol
> (pdebug). This is identical to what the pdebug server uses on the
> target side.
>
> The debug.h is a subset of our system header of the same name (and some
> others) and describes the structures returned by various debug interface
> system commands. Basically allows the same stuff as in our native
> 'nto-procfs.c' to work in the absence of system headers.
>
> ChangeLog:
>
> 2005-09-06 Kris Warkentin <kewarken@qnx.com>
>
> * nto-share/debug.h: New file.
> * nto-share/dsmsgs.h: New file.
>
> Look okay?

No...

First of all, what purpose do you intend for these interfaces to serve
in GDB? Are they going to be used only by new code to implement the
pdebug protocol, or shared between combined native/remote code?

Assuming remote only, then this:
> /* __DEBUG_H_INCLUDED is Neutrino's native debug.h header. We don't want
> these duplicate definitions if we're compiling natively and have already
> included it. */
> #ifndef __DEBUG_H_INCLUDED
> #define __DEBUG_H_INCLUDED

is pretty suspect - just give them different names from the system
version, or avoid including the system header, preferably the latter.

And basically everything else in the file is broken. You can't do
anything even vaguely complicated involving cross-debugging using host
system types. You're relying on the host's alignment and padding
rules, and system types like clock_t.

And whatever this does:

> #ifdef __QNX__
> __BEGIN_DECLS
> #include <_pack64.h>
> #endif

is similarly not OK. If it's intended to work cross, then it should
work from everywhere, not just from x86 and QNX.

I think I need a mile-high explanation of what you're trying to do,
first. By the way, is pdebug publically documented?