GNU Binutils with patches for OS216
Revision | 140bf80050b34f0947b34dba93b830ea2bfc5040 (tree) |
---|---|
Zeit | 2016-08-25 16:55:27 |
Autor | Adhemerval Zanella <adhemerval.zanella@lina...> |
Commiter | Yao Qi |
Sync proc_service definition with GLIBC
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.
@@ -1,3 +1,17 @@ | ||
1 | +2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org> | |
2 | + | |
3 | + * aarch64-linux-nat.c (ps_get_thread_area): Remove const from | |
4 | + struct ps_prochandle. | |
5 | + * amd64-linux-nat.c (ps_get_thread_area): Likewise. | |
6 | + * arm-linux-nat.c (ps_get_thread_area): Likewise. | |
7 | + * gdb_proc_service.h (ps_get_thread_area): Likewise. | |
8 | + * i386-linux-nat.c (ps_get_thread_area): Likewise. | |
9 | + * m68klinux-nat.c (ps_get_thread_area): Likewise. | |
10 | + * mips-linux-nat.c (ps_get_thread_area): Likewise. | |
11 | + * nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise. | |
12 | + * nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise. | |
13 | + * xtensa-linux-nat.c (ps_get_thread_area): Likewise. | |
14 | + | |
1 | 15 | 2016-06-01 Joel Brobecker <brobecker@adacore.com> |
2 | 16 | |
3 | 17 | * version.in: Set GDB version number to 7.11.1.DATE-git. |
@@ -457,7 +457,7 @@ aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid) | ||
457 | 457 | storage (or its descriptor). */ |
458 | 458 | |
459 | 459 | ps_err_e |
460 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
460 | +ps_get_thread_area (struct ps_prochandle *ph, | |
461 | 461 | lwpid_t lwpid, int idx, void **base) |
462 | 462 | { |
463 | 463 | int is_64bit_p |
@@ -245,7 +245,7 @@ amd64_linux_store_inferior_registers (struct target_ops *ops, | ||
245 | 245 | a request for a thread's local storage address. */ |
246 | 246 | |
247 | 247 | ps_err_e |
248 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
248 | +ps_get_thread_area (struct ps_prochandle *ph, | |
249 | 249 | lwpid_t lwpid, int idx, void **base) |
250 | 250 | { |
251 | 251 | if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32) |
@@ -477,7 +477,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) | ||
477 | 477 | /* Fetch the thread-local storage pointer for libthread_db. */ |
478 | 478 | |
479 | 479 | ps_err_e |
480 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
480 | +ps_get_thread_area (struct ps_prochandle *ph, | |
481 | 481 | lwpid_t lwpid, int idx, void **base) |
482 | 482 | { |
483 | 483 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -124,7 +124,7 @@ extern pid_t ps_getpid (struct ps_prochandle *); | ||
124 | 124 | /* Fetch the special per-thread address associated with the given LWP. |
125 | 125 | This call is only used on a few platforms (most use a normal register). |
126 | 126 | The meaning of the `int' parameter is machine-dependent. */ |
127 | -extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, | |
127 | +extern ps_err_e ps_get_thread_area (struct ps_prochandle *, | |
128 | 128 | lwpid_t, int, psaddr_t *); |
129 | 129 | |
130 | 130 |
@@ -1,3 +1,18 @@ | ||
1 | +2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org> | |
2 | + | |
3 | + PR server/20491 | |
4 | + * gdb_proc_service.h (ps_get_thread_area): Remove const from struct | |
5 | + ps_prochandle. | |
6 | + * linux-aarch64-low.c (ps_get_thread_area): Likewise. | |
7 | + * linux-arm-low.c (ps_get_thread_area): Likewise. | |
8 | + * linux-crisv32-low.c (ps_get_thread_area): Likewise. | |
9 | + * linux-m68k-low.c (ps_get_thread_area): Likewise. | |
10 | + * linux-mips-low.c (ps_get_thread_area): Likewise. | |
11 | + * linux-nios2-low.c (ps_get_thread_area): Likewise. | |
12 | + * linux-tic6x-low.c (ps_get_thread_area): Likewise. | |
13 | + * linux-x86-low.c (ps_get_thread_area): Likewise. | |
14 | + * linux-xtensa-low.c (ps_get_thread_area): Likewise. | |
15 | + | |
1 | 16 | 2016-04-15 Pedro Alves <palves@redhat.com> |
2 | 17 | |
3 | 18 | * linux-low.c (check_stopped_by_breakpoint): Rename to ... |
@@ -107,7 +107,7 @@ extern pid_t ps_getpid (struct ps_prochandle *); | ||
107 | 107 | /* Fetch the special per-thread address associated with the given LWP. |
108 | 108 | This call is only used on a few platforms (most use a normal register). |
109 | 109 | The meaning of the `int' parameter is machine-dependent. */ |
110 | -extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, | |
110 | +extern ps_err_e ps_get_thread_area (struct ps_prochandle *, | |
111 | 111 | lwpid_t, int, psaddr_t *); |
112 | 112 | |
113 | 113 |
@@ -421,7 +421,7 @@ aarch64_stopped_by_watchpoint (void) | ||
421 | 421 | /* Fetch the thread-local storage pointer for libthread_db. */ |
422 | 422 | |
423 | 423 | ps_err_e |
424 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
424 | +ps_get_thread_area (struct ps_prochandle *ph, | |
425 | 425 | lwpid_t lwpid, int idx, void **base) |
426 | 426 | { |
427 | 427 | return aarch64_ps_get_thread_area (ph, lwpid, idx, base, |
@@ -269,7 +269,7 @@ get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr, | ||
269 | 269 | /* Fetch the thread-local storage pointer for libthread_db. */ |
270 | 270 | |
271 | 271 | ps_err_e |
272 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
272 | +ps_get_thread_area (struct ps_prochandle *ph, | |
273 | 273 | lwpid_t lwpid, int idx, void **base) |
274 | 274 | { |
275 | 275 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -309,7 +309,7 @@ cris_stopped_data_address (void) | ||
309 | 309 | } |
310 | 310 | |
311 | 311 | ps_err_e |
312 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
312 | +ps_get_thread_area (struct ps_prochandle *ph, | |
313 | 313 | lwpid_t lwpid, int idx, void **base) |
314 | 314 | { |
315 | 315 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -152,7 +152,7 @@ m68k_breakpoint_at (CORE_ADDR pc) | ||
152 | 152 | /* Fetch the thread-local storage pointer for libthread_db. */ |
153 | 153 | |
154 | 154 | ps_err_e |
155 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
155 | +ps_get_thread_area (struct ps_prochandle *ph, | |
156 | 156 | lwpid_t lwpid, int idx, void **base) |
157 | 157 | { |
158 | 158 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -637,7 +637,7 @@ mips_stopped_data_address (void) | ||
637 | 637 | /* Fetch the thread-local storage pointer for libthread_db. */ |
638 | 638 | |
639 | 639 | ps_err_e |
640 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
640 | +ps_get_thread_area (struct ps_prochandle *ph, | |
641 | 641 | lwpid_t lwpid, int idx, void **base) |
642 | 642 | { |
643 | 643 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -145,7 +145,7 @@ nios2_breakpoint_at (CORE_ADDR where) | ||
145 | 145 | /* Fetch the thread-local storage pointer for libthread_db. */ |
146 | 146 | |
147 | 147 | ps_err_e |
148 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
148 | +ps_get_thread_area (struct ps_prochandle *ph, | |
149 | 149 | lwpid_t lwpid, int idx, void **base) |
150 | 150 | { |
151 | 151 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -274,7 +274,7 @@ tic6x_breakpoint_at (CORE_ADDR where) | ||
274 | 274 | /* Fetch the thread-local storage pointer for libthread_db. */ |
275 | 275 | |
276 | 276 | ps_err_e |
277 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
277 | +ps_get_thread_area (struct ps_prochandle *ph, | |
278 | 278 | lwpid_t lwpid, int idx, void **base) |
279 | 279 | { |
280 | 280 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -236,7 +236,7 @@ is_64bit_tdesc (void) | ||
236 | 236 | /* Called by libthread_db. */ |
237 | 237 | |
238 | 238 | ps_err_e |
239 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
239 | +ps_get_thread_area (struct ps_prochandle *ph, | |
240 | 240 | lwpid_t lwpid, int idx, void **base) |
241 | 241 | { |
242 | 242 | #ifdef __x86_64__ |
@@ -177,7 +177,7 @@ xtensa_breakpoint_at (CORE_ADDR where) | ||
177 | 177 | /* Called by libthread_db. */ |
178 | 178 | |
179 | 179 | ps_err_e |
180 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
180 | +ps_get_thread_area (struct ps_prochandle *ph, | |
181 | 181 | lwpid_t lwpid, int idx, void **base) |
182 | 182 | { |
183 | 183 | xtensa_elf_gregset_t regs; |
@@ -603,7 +603,7 @@ i386_linux_store_inferior_registers (struct target_ops *ops, | ||
603 | 603 | storage (or its descriptor). */ |
604 | 604 | |
605 | 605 | ps_err_e |
606 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
606 | +ps_get_thread_area (struct ps_prochandle *ph, | |
607 | 607 | lwpid_t lwpid, int idx, void **base) |
608 | 608 | { |
609 | 609 | unsigned int base_addr; |
@@ -508,7 +508,7 @@ m68k_linux_store_inferior_registers (struct target_ops *ops, | ||
508 | 508 | /* Fetch the thread-local storage pointer for libthread_db. */ |
509 | 509 | |
510 | 510 | ps_err_e |
511 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
511 | +ps_get_thread_area (struct ps_prochandle *ph, | |
512 | 512 | lwpid_t lwpid, int idx, void **base) |
513 | 513 | { |
514 | 514 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) < 0) |
@@ -152,7 +152,7 @@ mips64_linux_register_addr (struct gdbarch *gdbarch, int regno, int store) | ||
152 | 152 | /* Fetch the thread-local storage pointer for libthread_db. */ |
153 | 153 | |
154 | 154 | ps_err_e |
155 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
155 | +ps_get_thread_area (struct ps_prochandle *ph, | |
156 | 156 | lwpid_t lwpid, int idx, void **base) |
157 | 157 | { |
158 | 158 | if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) |
@@ -205,7 +205,7 @@ aarch64_siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from) | ||
205 | 205 | storage (or its descriptor). */ |
206 | 206 | |
207 | 207 | ps_err_e |
208 | -aarch64_ps_get_thread_area (const struct ps_prochandle *ph, | |
208 | +aarch64_ps_get_thread_area (struct ps_prochandle *ph, | |
209 | 209 | lwpid_t lwpid, int idx, void **base, |
210 | 210 | int is_64bit_p) |
211 | 211 | { |
@@ -122,7 +122,7 @@ void aarch64_linux_prepare_to_resume (struct lwp_info *lwp); | ||
122 | 122 | |
123 | 123 | void aarch64_linux_new_thread (struct lwp_info *lwp); |
124 | 124 | |
125 | -ps_err_e aarch64_ps_get_thread_area (const struct ps_prochandle *ph, | |
125 | +ps_err_e aarch64_ps_get_thread_area (struct ps_prochandle *ph, | |
126 | 126 | lwpid_t lwpid, int idx, void **base, |
127 | 127 | int is_64bit_p); |
128 | 128 |
@@ -286,7 +286,7 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops, | ||
286 | 286 | /* Called by libthread_db. */ |
287 | 287 | |
288 | 288 | ps_err_e |
289 | -ps_get_thread_area (const struct ps_prochandle *ph, | |
289 | +ps_get_thread_area (struct ps_prochandle *ph, | |
290 | 290 | lwpid_t lwpid, int idx, void **base) |
291 | 291 | { |
292 | 292 | xtensa_elf_gregset_t regs; |