Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Sync proc_service definition with GLIBC
Browse files Browse the repository at this point in the history
GLIBC BZ#20311 [1] proc_service.h install patch also remove 'const'
attributes from ps_get_thread_area and comment #15 discuss why to remove
the const attribute (basically since it a callback with the struct
ps_prochandle owned by the client it should be able to modify it if
it the case).

On default build this is not the issue and current g++ does not trigger
any issue with this mismatch declaration.  However, on some bootstrap
build configuration where gdbserver is build with gcc instead this
triggers:

error: conflicting types for 'ps_get_thread_area'

This patch fixes it by syncing the declaration with GLIBC.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=20311

gdb/ChangeLog:

2016-08-25  Adhemerval Zanella  <[email protected]>

	* aarch64-linux-nat.c (ps_get_thread_area): Remove const from
	struct ps_prochandle.
	* amd64-linux-nat.c (ps_get_thread_area): Likewise.
	* arm-linux-nat.c (ps_get_thread_area): Likewise.
	* gdb_proc_service.h (ps_get_thread_area): Likewise.
	* i386-linux-nat.c (ps_get_thread_area): Likewise.
	* m68klinux-nat.c (ps_get_thread_area): Likewise.
	* mips-linux-nat.c (ps_get_thread_area): Likewise.
	* nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise.
	* nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise.
	* xtensa-linux-nat.c (ps_get_thread_area): Likewise.

gdb/gdbserver/ChangeLog:

2016-08-25  Adhemerval Zanella  <[email protected]>

	PR server/20491
	* gdb_proc_service.h (ps_get_thread_area): Remove const from struct
	ps_prochandle.
	* linux-aarch64-low.c (ps_get_thread_area): Likewise.
	* linux-arm-low.c (ps_get_thread_area): Likewise.
	* linux-crisv32-low.c (ps_get_thread_area): Likewise.
	* linux-m68k-low.c (ps_get_thread_area): Likewise.
	* linux-mips-low.c (ps_get_thread_area): Likewise.
	* linux-nios2-low.c (ps_get_thread_area): Likewise.
	* linux-tic6x-low.c (ps_get_thread_area): Likewise.
	* linux-x86-low.c (ps_get_thread_area): Likewise.
	* linux-xtensa-low.c (ps_get_thread_area): Likewise.
  • Loading branch information
zatrazz authored and Yao Qi committed Aug 25, 2016
1 parent 4a64c29 commit 754653a
Show file tree
Hide file tree
Showing 22 changed files with 49 additions and 20 deletions.
14 changes: 14 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2016-08-25 Adhemerval Zanella <[email protected]>

* aarch64-linux-nat.c (ps_get_thread_area): Remove const from
struct ps_prochandle.
* amd64-linux-nat.c (ps_get_thread_area): Likewise.
* arm-linux-nat.c (ps_get_thread_area): Likewise.
* gdb_proc_service.h (ps_get_thread_area): Likewise.
* i386-linux-nat.c (ps_get_thread_area): Likewise.
* m68klinux-nat.c (ps_get_thread_area): Likewise.
* mips-linux-nat.c (ps_get_thread_area): Likewise.
* nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise.
* nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise.
* xtensa-linux-nat.c (ps_get_thread_area): Likewise.

2016-08-24 Simon Marchi <[email protected]>

* infcmd.c (set_inferior_io_terminal): Set inferior terminal to
Expand Down
2 changes: 1 addition & 1 deletion gdb/aarch64-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
storage (or its descriptor). */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
int is_64bit_p
Expand Down
2 changes: 1 addition & 1 deletion gdb/amd64-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
a request for a thread's local storage address. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32)
Expand Down
2 changes: 1 addition & 1 deletion gdb/arm-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdb_proc_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extern pid_t ps_getpid (struct ps_prochandle *);
/* Fetch the special per-thread address associated with the given LWP.
This call is only used on a few platforms (most use a normal register).
The meaning of the `int' parameter is machine-dependent. */
extern ps_err_e ps_get_thread_area (const struct ps_prochandle *,
extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
lwpid_t, int, psaddr_t *);


Expand Down
15 changes: 15 additions & 0 deletions gdb/gdbserver/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2016-08-25 Adhemerval Zanella <[email protected]>

PR server/20491
* gdb_proc_service.h (ps_get_thread_area): Remove const from struct
ps_prochandle.
* linux-aarch64-low.c (ps_get_thread_area): Likewise.
* linux-arm-low.c (ps_get_thread_area): Likewise.
* linux-crisv32-low.c (ps_get_thread_area): Likewise.
* linux-m68k-low.c (ps_get_thread_area): Likewise.
* linux-mips-low.c (ps_get_thread_area): Likewise.
* linux-nios2-low.c (ps_get_thread_area): Likewise.
* linux-tic6x-low.c (ps_get_thread_area): Likewise.
* linux-x86-low.c (ps_get_thread_area): Likewise.
* linux-xtensa-low.c (ps_get_thread_area): Likewise.

2016-08-19 Pedro Alves <[email protected]>

* linux-x86-low.c (amd64_emit_call): Emit missing call opcode.
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/gdb_proc_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern pid_t ps_getpid (struct ps_prochandle *);
/* Fetch the special per-thread address associated with the given LWP.
This call is only used on a few platforms (most use a normal register).
The meaning of the `int' parameter is machine-dependent. */
extern ps_err_e ps_get_thread_area (const struct ps_prochandle *,
extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
lwpid_t, int, psaddr_t *);


Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-aarch64-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ aarch64_stopped_by_watchpoint (void)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
return aarch64_ps_get_thread_area (ph, lwpid, idx, base,
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-arm-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr,
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-crisv32-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ cris_stopped_data_address (void)
}

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-m68k-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ m68k_breakpoint_at (CORE_ADDR pc)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-mips-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ mips_stopped_data_address (void)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-nios2-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ nios2_breakpoint_at (CORE_ADDR where)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-tic6x-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ tic6x_breakpoint_at (CORE_ADDR where)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-x86-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ is_64bit_tdesc (void)
/* Called by libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
#ifdef __x86_64__
Expand Down
2 changes: 1 addition & 1 deletion gdb/gdbserver/linux-xtensa-low.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ xtensa_breakpoint_at (CORE_ADDR where)
/* Called by libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
xtensa_elf_gregset_t regs;
Expand Down
2 changes: 1 addition & 1 deletion gdb/i386-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ i386_linux_store_inferior_registers (struct target_ops *ops,
storage (or its descriptor). */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
unsigned int base_addr;
Expand Down
2 changes: 1 addition & 1 deletion gdb/m68klinux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ m68k_linux_store_inferior_registers (struct target_ops *ops,
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) < 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/mips-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ mips64_linux_register_addr (struct gdbarch *gdbarch, int regno, int store)
/* Fetch the thread-local storage pointer for libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
Expand Down
2 changes: 1 addition & 1 deletion gdb/nat/aarch64-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ aarch64_siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
storage (or its descriptor). */

ps_err_e
aarch64_ps_get_thread_area (const struct ps_prochandle *ph,
aarch64_ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base,
int is_64bit_p)
{
Expand Down
2 changes: 1 addition & 1 deletion gdb/nat/aarch64-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void aarch64_linux_prepare_to_resume (struct lwp_info *lwp);

void aarch64_linux_new_thread (struct lwp_info *lwp);

ps_err_e aarch64_ps_get_thread_area (const struct ps_prochandle *ph,
ps_err_e aarch64_ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base,
int is_64bit_p);

Expand Down
2 changes: 1 addition & 1 deletion gdb/xtensa-linux-nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops,
/* Called by libthread_db. */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
xtensa_elf_gregset_t regs;
Expand Down

0 comments on commit 754653a

Please sign in to comment.