Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tile: fix DWARF bug in clone() for created thread
Previously, we would see a bad frame in the gdb backtrace output, e.g.:

  (gdb) bt
  #0  foo () at foo.c:5
  #1  0x000000aaaab68ee8 in start_thread () from /lib/libpthread.so.0
  #2  0x000000aaaad01c88 in clone () from /lib/libc.so.6
  #3  0x0000000000000000 in ?? ()

With this change the bogus frame #3 is gone and we have the
same output as x86 does for the same program.
  • Loading branch information
Chris Metcalf committed Dec 21, 2012
1 parent 147d03b commit 2bc2d8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ports/ChangeLog.tile
@@ -1,3 +1,7 @@
2012-12-14 Chris Metcalf <cmetcalf@tilera.com>

* sysdeps/unix/sysv/linux/tile/nptl/clone.S: Fix DWARF info.

2012-11-29 Chris Metcalf <cmetcalf@tilera.com>

* sysdeps/tile/s_fmaf.c: Remove redundant #defines now provided
Expand Down
3 changes: 2 additions & 1 deletion ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S
Expand Up @@ -160,14 +160,15 @@ ENTRY (__clone)
r32: the user function pointer */

.Lthread_start:
cfi_def_cfa_offset (FRAME_SIZE)
cfi_undefined (lr)
/* Check and see if we need to reset the PID, which we do if
CLONE_THREAD isn't set, i.e. we're not staying in the thread group.
If CLONE_VM is set, we're doing some kind of thread-like clone,
so we set the tid/pid to -1 to disable using the cached values
in getpid(). Otherwise (if CLONE_VM isn't set), it's a
fork-like clone, and we go ahead and write the cached values
from the true system pid (retrieved via __NR_getpid syscall). */
cfi_def_cfa_offset (FRAME_SIZE)
#ifdef __tilegx__
{
moveli r0, hw1_last(CLONE_VM)
Expand Down

0 comments on commit 2bc2d8e

Please sign in to comment.