From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Brobecker To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix compilation failure in hpux-thread.c under HPUX 11.00 Date: Fri, 28 Sep 2001 14:31:00 -0000 Message-id: <20010928233120.A24896@act-europe.fr> References: <20010927155347.F21075@act-europe.fr> <1010927170437.ZM4452@ocotillo.lan> X-SW-Source: 2001-09/msg00439.html > Thanks for looking into this. Looking at your patch, my first > impulse was to declare your changes as obvious and tell you to > commit it. > > But now that I've taken a closer look at find_active_thread(), I > see the following: > > static int > find_active_thread (void) > { > ... > > return (cma_thread_get_unique (&tcb.prolog.client_thread) << 16) > | PIDGET (main_ptid); > } > > It appears to me that this code is still utilizing the old technique > of overloading a thread and a pid into the same 32-bit identifier. > > So, find_active_thread() should probably be rewritten as follows: > > static ptid_t > find_active_thread (void) > { > ... > > return (ptid_build (PIDGET (main_ptid), 0, > cma_thread_get_unique (&tcb.prolog.client_thread))); > } > > My guess is that making the above change will allow hpux-thread.c to > compile, but that it won't really work right (or even at all) until > find_tcb() is rewritten. I think that find_tcb should take a ptid_t > instead of an int as its thread argument. It needs to fetch the thread > by invoking ptid_get_tid() instead of right shifting by 16. > > Once this is done, hpux_pid_to_str() also needs to be revised to > call ptid_get_tid() instead of shifting the pid result right by 16. Kevin, thanks for your feedback. I have tried to implement your suggestions, but it is a bit hard for me, because I don't have the knowledge on how the data structures are organised. I tried to guess as best as I could and came up with the following patch. I made the changes in emergency mode because I'm off on a trip the entire next week. You'll have to excuse me if I don't respond to your comments. As a side note, I tried to run the GDB I obtained and did not have much luck. Setting breakpoints seems ok, although I haven't double checked the pc addresses. However, when I try to run, GDB prints "Starting program ..." and then just sits there. The inferior is never spawned but I get 2 gdb processes for the price of one. I haven't had time to investigate more, and I'm not sure if this is because of my changes or not. Anyway, I'm attaching the patch, awaiting your comments. There is one static variable that was probably intended to be used as a cache. It was never assigned a value, so I deleted it for now. I could submit this obvious change as a separate patch if necessary. 2001-09-28 J. Brobecker * hpux-thread.c: rewrite find_active_thread() and find_tcb() to use ptid_t, instead of overloading the thread and the pid into the same 32-bit value. Make associated necessary adaptations. Also remove unused variable cached_active_thread. Thanks, -- Joel >From brobecker@act-europe.fr Fri Sep 28 14:38:00 2001 From: Joel Brobecker To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix compilation failure in bfd/som.c under HPUX 11.00 Date: Fri, 28 Sep 2001 14:38:00 -0000 Message-id: <20010928233841.B24896@act-europe.fr> References: <20010927160703.G21075@act-europe.fr> <3BB370B3.3020904@cygnus.com> X-SW-Source: 2001-09/msg00440.html Content-length: 284 > > 2001-09-27 J. Brobecker * som.c (som_write_symbol_strings): Fix incorrect type of > > current_offset to match the function definition. Fixes a build > > failure on HPUX-11.00 > > > > > > Fine with me. Thanks, commited. -- Joel