Sync proc_service definition with GLIBC
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 25 Aug 2016 07:42:03 +0000 (08:42 +0100)
committerYao Qi <yao.qi@linaro.org>
Thu, 25 Aug 2016 07:42:03 +0000 (08:42 +0100)
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  <adhemerval.zanella@linaro.org>

* 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  <adhemerval.zanella@linaro.org>

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.

22 files changed:
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/amd64-linux-nat.c
gdb/arm-linux-nat.c
gdb/gdb_proc_service.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/gdb_proc_service.h
gdb/gdbserver/linux-aarch64-low.c
gdb/gdbserver/linux-arm-low.c
gdb/gdbserver/linux-crisv32-low.c
gdb/gdbserver/linux-m68k-low.c
gdb/gdbserver/linux-mips-low.c
gdb/gdbserver/linux-nios2-low.c
gdb/gdbserver/linux-tic6x-low.c
gdb/gdbserver/linux-x86-low.c
gdb/gdbserver/linux-xtensa-low.c
gdb/i386-linux-nat.c
gdb/m68klinux-nat.c
gdb/mips-linux-nat.c
gdb/nat/aarch64-linux.c
gdb/nat/aarch64-linux.h
gdb/xtensa-linux-nat.c

index 0d875c84eab7011e132b9a042d163a141fd9a710..677ed7dfd085064334465e784962d657db8d9776 100644 (file)
@@ -1,3 +1,17 @@
+2016-08-25  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * 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  <simon.marchi@ericsson.com>
 
        * infcmd.c (set_inferior_io_terminal): Set inferior terminal to
index e4316376c525644d52894aa40bbd1ec1a3cff9c3..65ca8ff2a7ff25b16e31135f4a8b11b6b013dae3 100644 (file)
@@ -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
index fea6ee2fbdc5caa70b37d01ddd4c4b4085fa85e3..5122b045eacf93baa5fbae420f1ff3e4ed5fe71a 100644 (file)
@@ -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)
index d77ca9349849a07c8b18ab13f4a87fbb1f7412c0..d11bdc6e225ad6041aec3248002fb6c9fe9a47d1 100644 (file)
@@ -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)
index 38b98fc980a43f51c61e10a59eff5d7110959961..0a9f26d47e6654f8816b8432f9c7f727a8be0adc 100644 (file)
@@ -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 *);
 
 
index c28c2cb42461a8a7224efa4e01ec628ded84cec6..af0140f0ed469a2835fbd06f8039e71c976cbbce 100644 (file)
@@ -1,3 +1,18 @@
+2016-08-25  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       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  <palves@redhat.com>
 
        * linux-x86-low.c (amd64_emit_call): Emit missing call opcode.
index 99bf226b01b90c4c349656caaac747baad2d80be..cec9231ee5b3b1ace0e4509dd2c3ac26acd2ac2f 100644 (file)
@@ -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 *);
 
 
index 6efa03585b1423860eb0cf60fc1a9962e67be831..e54a8ba9a8041853b6204a9781e7fa5ffb96a802 100644 (file)
@@ -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,
index e1261e54530e3a10b622fe0e53fc1083f46d8fd2..ed9b3562a85f6050a3c98874a7463dde1c5e787f 100644 (file)
@@ -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)
index 16c1f72015136371e38017b7467fafcda5c5282a..fea6d5bf9b343531984cf4774f1753c3a8a67080 100644 (file)
@@ -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)
index df3d7c6d9c7522986b033888f64946a8d96f663e..78a340fa8fa68af375b5f8e77ead37d235899ceb 100644 (file)
@@ -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)
index 30a03d5f438816e1a189cfd7fb10ca24b1de67cc..9356bb3d9969fd711514e0d3ea03b7cf1954e336 100644 (file)
@@ -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)
index a32bc1af1ce9e7f920c9c975623a8a1f2c477ff6..02fe198012757bda0f3714fddca8740cf8804665 100644 (file)
@@ -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)
index e40a3aff5129452834380df003b8f6536cf2bf4d..6b90560dc4de6249f8c48099d4c3ce518421c68c 100644 (file)
@@ -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)
index d847b935214017ef18f1a643a403ae1924aa513d..acded1ab32d7675b354cae0bb3b009db46b40172 100644 (file)
@@ -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__
index 6e945eac173c768d3af766bb7fb66c98c19847f8..431082c01f1cdd67a2eed54d499065421b9c0f07 100644 (file)
@@ -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;
index a41ee2108152f63ea9560f5a3f847766f06158f3..70d954fdc00bc03b1d7053bbe26d13aeaad398d3 100644 (file)
@@ -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;
index 24b6242ba39cf71bf31b573617a660add00b23cc..5b8684b719765caaa6d5597085618827513804c0 100644 (file)
@@ -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)
index bfe9fcbe687724349f19ad4ea0267df9d1c0c6a7..0f20f16814fa0415ab7135149736a78491c1d6d5 100644 (file)
@@ -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)
index 5ae5aa860285e564e7668a8988f3772632983a10..1828977e28f505ff60648df397a198fc9ec581e2 100644 (file)
@@ -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)
 {
index 7221982b784ba958005c25c5bea93cb1707f000f..aac7c68c0660049c55c3e1f1eb3a47604f9926dc 100644 (file)
@@ -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);
 
index 54da83791ae793ef75f388764c77741316a86b23..836d3f80ee481602fdb6aff0763c72ef63fbeff4 100644 (file)
@@ -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;
This page took 0.043049 seconds and 4 git commands to generate.