Vasily Kolobkov <[email protected]> writes:

> I ran into a problem with ports version of gdb and feeling a tad shaky 
> would appreciate any hints on resolving it. Fresh current on amd64 and 
> gdb port.
>
> Considering a simple programm:
>
>      1        #include <stdio.h>
>      2        #include <pthread.h>
>      3        
>      4        void *offshot(void *arg)
>      5        {
>      6                pthread_exit(0);
>      7        }
>      8        
>      9        int main(void)
>     10        {
>     11                pthread_t c;
>     12                pthread_create(&c, 0, offshot, 0);
>     13                pthread_join(c, 0);
>     14                return 0;
>     15        }
>
> When setting breakpoints in the code ran by the spawn thread (e.g. 
> break 6), gdb seem to have trouble making out thread call stacks and 
> shows some garbage.
> Breaking on the main thread go just fine though.

It doesn't print garbage, it's just that the stack of the main thread is
printed no matter which thread you select.

> I'm oblivious of the lengths gdb goes in such cases, but the only hint 
> i managed to come upon (being for stripped libpthread) seems dubious as 
> the base version of gdb copes just fine on the same object.
>
> Would appreciate any ideas of clues on addressing this!

guenther@ reported this a while ago, with a fix for amd64:

  http://marc.info/?l=openbsd-ports&m=143129251112051&w=2

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to