Newer GDB ported to QNXnto?

I saw last night that GDB 5.2 was released, with a number of bug fixes.

The GDB we have (ppc target, Solaris host) is around 5.0 (although it
doesn’t appear to be identical to the 5.0 tarballs I’ve found at the
FSF etc.–that is, there appear to be other changes besides the ones
needed for QNX support).

I’ve noticed a lot of “weird” behavior with the current QNX GDB,
especially when it comes to dealing with threaded applications.
Debugging these natively on Linux or Solaris with newer versions of GDB
works significantly better.

I wonder if anyone is working on a port of GDB 5.2 to QNX 6? I spent a
few hours last night trying to apply the diffs between native GDB 5.0
and QNX GDB 5.0, to the GDB 5.2 source tree. It seemed to go OK for a
long while; most of the tree compiled, anyway, but then I got to
remote-qnx.c and things got harder: SERIAL_WRITE() appears to be gone
in 5.2. I also ran into changes like pid → ptid, etc.

Anyone have a port already, or working on one?

Paul D. Smith <pausmith@nortelnetworks.com> HASMAT–HA Software Mthds & Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad Scientist

These are my opinions—Nortel Networks takes no responsibility for them.

We’re working on it internally but it’s sort of a back burner project with
some other higher priority stuff right now. Essentially the problem is that
our original port was to 4.17 and the patches were brought forward to 5.0,
still using some of the deprecated 4.17 stuff. So we pretty much have to
re-port our stuff to the gdb head branch to clean it up before we can submit
it to the FSF. It’s a pain but I hope to be able to get back to it within
the next few weeks, after our beta cycle is through.

cheers,

Kris

“Paul D. Smith” <pausmith@nortelnetworks.com> wrote in message
news:p5d6whxqk1.fsf@lemming.engeast.baynetworks.com

I saw last night that GDB 5.2 was released, with a number of bug fixes.

The GDB we have (ppc target, Solaris host) is around 5.0 (although it
doesn’t appear to be identical to the 5.0 tarballs I’ve found at the
FSF etc.–that is, there appear to be other changes besides the ones
needed for QNX support).

I’ve noticed a lot of “weird” behavior with the current QNX GDB,
especially when it comes to dealing with threaded applications.
Debugging these natively on Linux or Solaris with newer versions of GDB
works significantly better.

I wonder if anyone is working on a port of GDB 5.2 to QNX 6? I spent a
few hours last night trying to apply the diffs between native GDB 5.0
and QNX GDB 5.0, to the GDB 5.2 source tree. It seemed to go OK for a
long while; most of the tree compiled, anyway, but then I got to
remote-qnx.c and things got harder: SERIAL_WRITE() appears to be gone
in 5.2. I also ran into changes like pid → ptid, etc.

Anyone have a port already, or working on one?


Paul D. Smith <> pausmith@nortelnetworks.com> > HASMAT–HA Software Mthds &
Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad
Scientist


These are my opinions—Nortel Networks takes no responsibility for
them.

%% “Kris Warkentin” <kewarken@qnx.com> writes:

kw> We’re working on it internally but it’s sort of a back burner
kw> project with some other higher priority stuff right now.
kw> Essentially the problem is that our original port was to 4.17 and
kw> the patches were brought forward to 5.0, still using some of the
kw> deprecated 4.17 stuff. So we pretty much have to re-port our
kw> stuff to the gdb head branch to clean it up before we can submit
kw> it to the FSF. It’s a pain but I hope to be able to get back to
kw> it within the next few weeks, after our beta cycle is through.

OK, cool; if you need a beta tester let me know :slight_smile:.

I discovered the SERIAL_WRITE() thing was simple to fix: you just need
to downcase (apparently they’re functions not macros now?)

However, the pid_t → ptid_t is definitely the bugaboo here. It looks
like the older GDB 4.x didn’t support threads within a process, so QNX’s
GDB code faked it out by creating their own encoding of the pid/tid.

However, the newer GDB has solved this problem by creating a structure
themselves to store the pid/tid, so it seems like what has to happen is
QNX’s special support has to be ripped out and the code changed to use
the standard GDB stuff.

That seems like more intense work than I have time for at the moment,
unfortunately, unless our GDB problems get worse. But we’re very
interested in this as soon as you can get to it.

Thanks!

Paul D. Smith <pausmith@nortelnetworks.com> HASMAT–HA Software Mthds & Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad Scientist

These are my opinions—Nortel Networks takes no responsibility for them.

“Paul D. Smith” <pausmith@nortelnetworks.com> wrote in message
news:p5heltw3ic.fsf@lemming.engeast.baynetworks.com

%% “Kris Warkentin” <> kewarken@qnx.com> > writes:

kw> We’re working on it internally but it’s sort of a back burner
kw> project with some other higher priority stuff right now.
kw> Essentially the problem is that our original port was to 4.17 and
kw> the patches were brought forward to 5.0, still using some of the
kw> deprecated 4.17 stuff. So we pretty much have to re-port our
kw> stuff to the gdb head branch to clean it up before we can submit
kw> it to the FSF. It’s a pain but I hope to be able to get back to
kw> it within the next few weeks, after our beta cycle is through.

OK, cool; if you need a beta tester let me know > :slight_smile:> .

I discovered the SERIAL_WRITE() thing was simple to fix: you just need
to downcase (apparently they’re functions not macros now?)

Yeah, I found grepping through the changelog in general very helpful for
this type of stuff.

However, the pid_t → ptid_t is definitely the bugaboo here. It looks
like the older GDB 4.x didn’t support threads within a process, so QNX’s
GDB code faked it out by creating their own encoding of the pid/tid.

Yes, top bits tid, bottom pid or some such. Nasty as well because in one of
our files we were maintaining our own list of ptids rather than relying on
gdb’s list. I ripped most of that out and got it working with ptid but it’s
still not done

However, the newer GDB has solved this problem by creating a structure
themselves to store the pid/tid, so it seems like what has to happen is
QNX’s special support has to be ripped out and the code changed to use
the standard GDB stuff.

That seems like more intense work than I have time for at the moment,
unfortunately, unless our GDB problems get worse. But we’re very
interested in this as soon as you can get to it.

Like I said, hopefully soon. Most of the stuff was going well but then I
ran into the solib support and I’ve been having a really hard time seeing
what’s going on. I’m keeping my fingers crossed I’ll get back to it soon.
Right now I’m up to my eyebrows in Java with Eclipse.

cheers,

Kris

Thanks!


Paul D. Smith <> pausmith@nortelnetworks.com> > HASMAT–HA Software Mthds &
Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad
Scientist


These are my opinions—Nortel Networks takes no responsibility for
them.