lidar | 8 Jun 2009 14:36
Picon

not able to debug threads - gcc configuration problem?

Hello,

I have been attempting to compile a cross-toolchain, to use over Cygwin, 
for a PowerPC target.

So far i have been able to compile and run a multi-threaded program on 
board.

The trouble is, i haven't been able to debug threads with GDB:

1. when i dont set breakpoints in the thread - the gdb breaks on 
_pthread_sigsuspend upon the pthread_create call, and the program 
continues to completion
when i say "c".

2. when i set a breakpoint in the thread, upon pthread_create the 
program exits (with exit value 0), and the gdb reports "program exited 
normally".

Luckily, i do have a fine installation of montavista, so i did a little 
test: i compiled the same basic program on the montavista, ran it on the 
board
and attempted debugging it with my cygwin gdb. THIS ONE WORKED!  my gdb 
reported threads and agreed to break upon thread breakpoints.

does this mean my gdb is fine?

i also took my Cygwin-compiled program, ran it on the board and tried 
debugging it from the montavista gdb - this one failed in pretty much 
the same way
(Continue reading)

arkkimede | 8 Jun 2009 15:46
Picon

Re: not able to debug threads - gcc configuration problem?

For your information, I can't debug in cygwin a mixed code with c and
assembly using like assembler nasm.
In linux (debian) yes.
Someone advice me to update cygwin I download last release of cygwin
but i doesn't work.
I'm non able to see the assembler code into the debugger
BR

On Mon, Jun 8, 2009 at 2:36 PM, lidar<lidar <at> trego.co.il> wrote:
> Hello,
>
> I have been attempting to compile a cross-toolchain, to use over Cygwin, for
> a PowerPC target.
>
> So far i have been able to compile and run a multi-threaded program on
> board.
>
> The trouble is, i haven't been able to debug threads with GDB:
>
> 1. when i dont set breakpoints in the thread - the gdb breaks on
> _pthread_sigsuspend upon the pthread_create call, and the program continues
> to completion
> when i say "c".
>
> 2. when i set a breakpoint in the thread, upon pthread_create the program
> exits (with exit value 0), and the gdb reports "program exited normally".
>
>
> Luckily, i do have a fine installation of montavista, so i did a little
> test: i compiled the same basic program on the montavista, ran it on the
(Continue reading)

Grant Edwards | 19 Jun 2009 22:54
Favicon

Docs on multi-threaded debugging using gdbserver?

Is there any documentation on how to set up for remote
multi-threaded debugging using gdb-server?

Single-threaded debugging works fine on all my targets, but I'm
trying to debug a multi-threaded app remotely using gdbserver
and I'm having zero luck.  I've tried on both a glibc/PPC
target and a uclibc/ARM9 target.

On the PPC target, gdb seem completely unaware of threads.  I
haven't spent much time beating my head agains that wall...

On the ARM target, gdb seems vaguely aware that there are
multiple threads, but can do nothing usable with/about them.

Here's a typical session:

    GNU gdb 6.8
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "--host=i386-pc-linux-gnu --target=arm-linux-uclibc".
    [New Thread 860]
    0x40000930 in _start () from /home/grante/processors/atmel/RM9200/buildroot-2009.05/project_build_arm/uclibc/root/lib/ld-uClibc.so.0
    (gdb) break main
    Breakpoint 1 at 0x8bf4: file hello.c, line 45.
    (gdb) c
    Continuing.

(Continue reading)

Grant Edwards | 20 Jun 2009 01:28
Favicon

Re: Docs on multi-threaded debugging using gdbserver?

On 2009-06-19, Grant Edwards <grante <at> visi.com> wrote:

> Is there any documentation on how to set up for remote
> multi-threaded debugging using gdb-server?

[...]

> Here's a typical session:
>
>     GNU gdb 6.8

[target remote ....]

[...]
>     0x40000930 in _start () from /home/grante/processors/atmel/RM9200/buildroot-2009.05/project_build_arm/uclibc/root/lib/ld-uClibc.so.0
>     (gdb) break main
>     Breakpoint 1 at 0x8bf4: file hello.c, line 45.
>     (gdb) c
>     Continuing.
>     
>     Breakpoint 1, main () at hello.c:45
>     45        pthread_attr_t attr, *attrp=NULL;
>     (gdb) next
[...]
>     62            s = pthread_create(tid+i, attrp, thread, (void*)i);  abort_if_error(s);
>     (gdb) next
>     
>     Program received signal SIG32, Real-time event 32.
>     0x400443d4 in ?? ()
>     (gdb) 
(Continue reading)

Raghavendra Rao Loka | 30 Jun 2009 20:12
Picon
Favicon

gdb and pstack

I am trying to build pstack for x86-64 elf64 executables. I could get reliable
stack information with debuggable executables, but since the frame pointer
isn't saved, I get trash for optimized executables. gdb, on the other hand,
does give reliable stack information. I was wondering if someone could point
me in the right direction as to what I need to do get the reliable stack information
(from what's available in the executable).
 
  - Thanks,
   - Rao.
 

Gmane