From patchwork Wed Aug 17 21:18:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 74131 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp36389qga; Wed, 17 Aug 2016 14:19:42 -0700 (PDT) X-Received: by 10.66.254.39 with SMTP id af7mr22267727pad.37.1471468782823; Wed, 17 Aug 2016 14:19:42 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id tr8si963695pab.170.2016.08.17.14.19.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 14:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-132982-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of gdb-patches-return-132982-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gdb-patches-return-132982-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=g7fmPaM6eXzuTuz7ejIVDJg4T0i2hlndReiIHg70qtxfWbKzQlt25 XRy32hKAYCdNkJzo1dO726oalC2usVtBy0/1apsvILSXZBRx9ElDzmyHhBenfevk Zy0p6eKYUORG28y4zzKRdpTangHjhq9s5WCAINWIQHOLLcgb+BNMSA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=bT9/SUiSr/eWnzNNQlg/JO86ia8=; b=N6jOra/GiBT1r/WXqI+F5u/TPPVt dAOnVI4eDtupBHi0VIDicIBrYPdCBmTY8YygzuNJVqGcbBNx0ccoe12uIqJnqPLI +eCDid/kX4sCobQAp9iy5UqhUv7CamZP+HiyU4pRz2i7X0w8ui4K+Bpyczthtp9d gl1sCtLvIKumQVQ= Received: (qmail 97134 invoked by alias); 17 Aug 2016 21:19:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 97123 invoked by uid 89); 17 Aug 2016 21:19:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=2057, 2747, 274, 7, *to X-HELO: mail-yw0-f175.google.com Received: from mail-yw0-f175.google.com (HELO mail-yw0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Aug 2016 21:19:21 +0000 Received: by mail-yw0-f175.google.com with SMTP id r9so129022ywg.0 for ; Wed, 17 Aug 2016 14:19:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=sBdnqjwUw+JVUGBwBNnSSuukHC5Yl2TzDQxelS+T+4I=; b=abrFpRlnoNeamfvRxzdjEWKqGXpZJp+7RhYJnPgQwcOAfGej4MT+1EoxE/P9pnD7Rv 5mKavVB0xLOKu3ZkjrRhSzWcVerS+Fo4fmq3dDqFIOc9m0ykiJaKm+VvlhMLA3Odqecd G4J7zEirj8wmKzkMZxFHcxkpadOahj4y3aw1KpKqSzR68ravyEbvRX7CSy1gx6sld8wl cSZ/25kDaIpRSVfx1XIh/jrlQeSsQnT7Z9ZPHNcYlKn9FXkt8DtL3kSLFyBh/P6rB3go yNs3TIQC0po53exa3f2GbI8UXXSFDMh3Lk4mhlyBUoVP/SEgvyE/PSqN0fx3+1GqYOLv DXlg== X-Gm-Message-State: AEkoouv+xrT3TnCpcIHQhILZcqfNYeHX/o1I8xJhR6e+RYDWng2/BjJ+UAtDOPaWDlH1ezyd X-Received: by 10.129.114.86 with SMTP id n83mr32471432ywc.100.1471468759376; Wed, 17 Aug 2016 14:19:19 -0700 (PDT) Received: from localhost.localdomain ([179.159.110.216]) by smtp.googlemail.com with ESMTPSA id y85sm16267841ywy.23.2016.08.17.14.19.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Aug 2016 14:19:18 -0700 (PDT) From: Adhemerval Zanella To: gdb-patches@sourceware.org Subject: [PATCH] Sync proc_service definition with GLIBC Date: Wed, 17 Aug 2016 18:18:57 -0300 Message-Id: <1471468737-10208-1-git-send-email-adhemerval.zanella@linaro.org> X-IsSubscribed: yes 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 2016-08-17 Adhemerval Zanella * gdb/aarch64-linux-nat.c (ps_get_thread_area): Remove const from struct ps_prochandle. * gdb/amd64-linux-nat.c (ps_get_thread_area): Likewise. * gdb/arm-linux-nat.c (ps_get_thread_area): Likewise. * gdb/gdb_proc_service.h (ps_get_thread_area): Likewise. * gdb/gdbserver/gdb_proc_service.h (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-aarch64-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-arm-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-crisv32-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-m68k-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-mips-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-nios2-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-tic6x-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-x86-low.c (ps_get_thread_area): Likewise. * gdb/gdbserver/linux-xtensa-low.c (ps_get_thread_area): Likewise. * gdb/i386-linux-nat.c (ps_get_thread_area): Likewise. * gdb/m68klinux-nat.c (ps_get_thread_area): Likewise. * gdb/mips-linux-nat.c (ps_get_thread_area): Likewise. * gdb/nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise. * gdb/nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise. * gdb/xtensa-linux-nat.c (ps_get_thread_area): Likewise. --- gdb/ChangeLog | 24 ++++++++++++++++++++++++ gdb/aarch64-linux-nat.c | 2 +- gdb/amd64-linux-nat.c | 2 +- gdb/arm-linux-nat.c | 2 +- gdb/gdb_proc_service.h | 2 +- gdb/gdbserver/gdb_proc_service.h | 2 +- gdb/gdbserver/linux-aarch64-low.c | 2 +- gdb/gdbserver/linux-arm-low.c | 2 +- gdb/gdbserver/linux-crisv32-low.c | 2 +- gdb/gdbserver/linux-m68k-low.c | 2 +- gdb/gdbserver/linux-mips-low.c | 2 +- gdb/gdbserver/linux-nios2-low.c | 2 +- gdb/gdbserver/linux-tic6x-low.c | 2 +- gdb/gdbserver/linux-x86-low.c | 2 +- gdb/gdbserver/linux-xtensa-low.c | 2 +- gdb/i386-linux-nat.c | 2 +- gdb/m68klinux-nat.c | 2 +- gdb/mips-linux-nat.c | 2 +- gdb/nat/aarch64-linux.c | 2 +- gdb/nat/aarch64-linux.h | 2 +- gdb/xtensa-linux-nat.c | 2 +- 21 files changed, 44 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index e431637..65ca8ff 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -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 diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index fea6ee2..5122b04 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -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) diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index d77ca93..d11bdc6 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -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) diff --git a/gdb/gdb_proc_service.h b/gdb/gdb_proc_service.h index 38b98fc..0a9f26d 100644 --- a/gdb/gdb_proc_service.h +++ b/gdb/gdb_proc_service.h @@ -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 *); diff --git a/gdb/gdbserver/gdb_proc_service.h b/gdb/gdbserver/gdb_proc_service.h index 99bf226..cec9231 100644 --- a/gdb/gdbserver/gdb_proc_service.h +++ b/gdb/gdbserver/gdb_proc_service.h @@ -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 *); diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 6efa035..e54a8ba 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -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, diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index e1261e5..ed9b356 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -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) diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c index 16c1f72..fea6d5b 100644 --- a/gdb/gdbserver/linux-crisv32-low.c +++ b/gdb/gdbserver/linux-crisv32-low.c @@ -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) diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c index df3d7c6..78a340f 100644 --- a/gdb/gdbserver/linux-m68k-low.c +++ b/gdb/gdbserver/linux-m68k-low.c @@ -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) diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c index 30a03d5..9356bb3 100644 --- a/gdb/gdbserver/linux-mips-low.c +++ b/gdb/gdbserver/linux-mips-low.c @@ -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) diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c index a32bc1a..02fe198 100644 --- a/gdb/gdbserver/linux-nios2-low.c +++ b/gdb/gdbserver/linux-nios2-low.c @@ -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) diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c index e40a3af..6b90560 100644 --- a/gdb/gdbserver/linux-tic6x-low.c +++ b/gdb/gdbserver/linux-tic6x-low.c @@ -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) diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index d6b67c1..fd87b23 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -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__ diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 6e945ea..431082c 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -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; diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index a41ee21..70d954f 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -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; diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index 24b6242..5b8684b 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -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) diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index bfe9fcb..0f20f16 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -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) diff --git a/gdb/nat/aarch64-linux.c b/gdb/nat/aarch64-linux.c index 5ae5aa8..1828977 100644 --- a/gdb/nat/aarch64-linux.c +++ b/gdb/nat/aarch64-linux.c @@ -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) { diff --git a/gdb/nat/aarch64-linux.h b/gdb/nat/aarch64-linux.h index 7221982..aac7c68 100644 --- a/gdb/nat/aarch64-linux.h +++ b/gdb/nat/aarch64-linux.h @@ -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); diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 54da837..836d3f8 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -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;