|
|
|
@ -1,6 +1,7 @@ |
|
|
|
/* Native-dependent code for GNU/Linux on MIPS processors.
|
|
|
|
|
|
|
|
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
|
|
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 |
|
|
|
Free Software Foundation, Inc. |
|
|
|
|
|
|
|
This file is part of GDB. |
|
|
|
|
|
|
|
@ -24,6 +25,12 @@ |
|
|
|
#include "target.h" |
|
|
|
#include "linux-nat.h" |
|
|
|
|
|
|
|
#include "gdb_proc_service.h" |
|
|
|
|
|
|
|
#ifndef PTRACE_GET_THREAD_AREA |
|
|
|
#define PTRACE_GET_THREAD_AREA 25 |
|
|
|
#endif |
|
|
|
|
|
|
|
/* Pseudo registers can not be read. ptrace does not provide a way to
|
|
|
|
read (or set) MIPS_PS_REGNUM, and there's no point in reading or |
|
|
|
setting MIPS_ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or |
|
|
|
@ -65,6 +72,23 @@ mips_linux_cannot_store_register (int regno) |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
/* Fetch the thread-local storage pointer for libthread_db. */ |
|
|
|
|
|
|
|
ps_err_e |
|
|
|
ps_get_thread_area (const struct ps_prochandle *ph, |
|
|
|
lwpid_t lwpid, int idx, void **base) |
|
|
|
{ |
|
|
|
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
|
|
|
return PS_ERR; |
|
|
|
|
|
|
|
/* IDX is the bias from the thread pointer to the beginning of the
|
|
|
|
thread descriptor. It has to be subtracted due to implementation |
|
|
|
quirks in libthread_db. */ |
|
|
|
*base = (void *) ((char *)*base - idx); |
|
|
|
|
|
|
|
return PS_OK; |
|
|
|
} |
|
|
|
|
|
|
|
void _initialize_mips_linux_nat (void); |
|
|
|
|
|
|
|
void |
|
|
|
|