From patchwork Thu Mar 31 21:42:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marcin_Ko=C5=9Bcielnicki?= X-Patchwork-Id: 11589 Received: (qmail 25708 invoked by alias); 31 Mar 2016 21:42:13 -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 25691 invoked by uid 89); 31 Mar 2016 21:42:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2336 X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (159.100.250.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Mar 2016 21:42:08 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id E35651AA49; Thu, 31 Mar 2016 21:42:04 +0000 (UTC) Received: by hogfather.0x04.net (Postfix, from userid 1000) id D2F80580115; Thu, 31 Mar 2016 23:42:02 +0200 (CEST) From: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= To: sergiodj@redhat.com Cc: gdb-patches@sourceware.org, uweigand@de.ibm.com, =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= Subject: [PATCH obv] gdbserver: Fix C++ build errors in tracepoint.c Date: Thu, 31 Mar 2016 23:42:00 +0200 Message-Id: <1459460520-28899-1-git-send-email-koriakin@0x04.net> In-Reply-To: <877fgiqzhq.fsf@redhat.com> References: <877fgiqzhq.fsf@redhat.com> X-IsSubscribed: yes These were introduced by 1cda1512689aabb36588a01370002632a0c8e560 and a13c46966d308297a1273e35ccc807a3912d573d . One is a simple missing cast, the other is const usage on global function pointers exported from IPA: in C++, consts are static, and thus won't be exported from the DSO (the build error was because of non-applicable visibility("default")). gdb/gdbserver/ChangeLog: * tracepoint.c (gdb_collect_ptr): Remove const qualifier. (get_raw_reg_ptr): Likewise. (get_trace_state_variable_value_ptr): Likewise. (set_trace_state_variable_value_ptr): Likewise. (initialize_tracepoint): Cast alloc_jump_pad_buffer result to char *. --- Thanks for noticing that. Here's the fix, pushed as obvious. gdb/gdbserver/tracepoint.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 56b8e69..8f71325 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -5903,11 +5903,11 @@ typedef LONGEST (*get_trace_state_variable_value_ptr_type) (int); typedef void (*set_trace_state_variable_value_ptr_type) (int, LONGEST); EXTERN_C_PUSH -IP_AGENT_EXPORT_VAR const gdb_collect_ptr_type gdb_collect_ptr = gdb_collect; -IP_AGENT_EXPORT_VAR const get_raw_reg_ptr_type get_raw_reg_ptr = get_raw_reg; -IP_AGENT_EXPORT_VAR const get_trace_state_variable_value_ptr_type +IP_AGENT_EXPORT_VAR gdb_collect_ptr_type gdb_collect_ptr = gdb_collect; +IP_AGENT_EXPORT_VAR get_raw_reg_ptr_type get_raw_reg_ptr = get_raw_reg; +IP_AGENT_EXPORT_VAR get_trace_state_variable_value_ptr_type get_trace_state_variable_value_ptr = get_trace_state_variable_value; -IP_AGENT_EXPORT_VAR const set_trace_state_variable_value_ptr_type +IP_AGENT_EXPORT_VAR set_trace_state_variable_value_ptr_type set_trace_state_variable_value_ptr = set_trace_state_variable_value; EXTERN_C_POP @@ -7440,7 +7440,7 @@ initialize_tracepoint (void) jump_pad_size = pagesize * SCRATCH_BUFFER_NPAGES; gdb_tp_heap_buffer = (char *) xmalloc (5 * 1024 * 1024); - gdb_jump_pad_buffer = alloc_jump_pad_buffer (jump_pad_size); + gdb_jump_pad_buffer = (char *) alloc_jump_pad_buffer (jump_pad_size); if (gdb_jump_pad_buffer == NULL) perror_with_name ("mmap"); gdb_jump_pad_buffer_end = gdb_jump_pad_buffer + jump_pad_size;