From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56652 invoked by alias); 12 Jul 2018 20:52:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 56516 invoked by uid 89); 12 Jul 2018 20:52:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:referen X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 20:52:33 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway31.websitewelcome.com (Postfix) with ESMTP id E77151018 for ; Thu, 12 Jul 2018 15:52:30 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id diZQfRGVSaSeydiZaf4Dye; Thu, 12 Jul 2018 15:52:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7LlBQo0ONN6teyqnZYJ59CNIfnVLQLvL2qsVcA5MqUg=; b=o7wAS5unA9UzR15LT+2OPqdrHQ Nzbgj9TgW43NAXcAahc6JiOA2bzL4G9o34MFqRCkMdkDCjpI1gVa3TrJ824AE006wBY5TTaQsc/58 IB4ndrMjoCXP7eE9jmcswBwcD; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:49432 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fdiZQ-001ZuD-4d; Thu, 12 Jul 2018 15:52:12 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 05/13] Make a few calls in *-tdep.c for effect Date: Thu, 12 Jul 2018 20:52:00 -0000 Message-Id: <20180712205208.32646-6-tom@tromey.com> In-Reply-To: <20180712205208.32646-1-tom@tromey.com> References: <20180712205208.32646-1-tom@tromey.com> X-SW-Source: 2018-07/txt/msg00353.txt.bz2 In a few cases, there were calls in *-tdep.c that I did not want to remove because I was not certain that it was safe -- perhaps the side effect of the function (generally throwing an error) was desired. 2018-07-12 Tom Tromey * tic6x-tdep.c (tic6x_push_dummy_call): Call find_function_addr for effect. * sparc64-tdep.c (adi_examine_command): Call get_adi_info_proc for effect. * rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Call find_function_addr for effect. * nios2-tdep.c (nios2_push_dummy_call): Call find_function_addr for effect. * mep-tdep.c (mep_push_dummy_call): Call find_function_addr for effect. --- gdb/ChangeLog | 13 +++++++++++++ gdb/mep-tdep.c | 4 +++- gdb/nios2-tdep.c | 4 +++- gdb/rs6000-lynx178-tdep.c | 4 +++- gdb/sparc64-tdep.c | 3 ++- gdb/tic6x-tdep.c | 4 +++- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index c8a5ecfbe07..0a6fe7de663 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2264,9 +2264,11 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR *copy = (CORE_ADDR *) alloca (argc * sizeof (copy[0])); - CORE_ADDR func_addr = find_function_addr (function, NULL); int i; + /* Call for side effects. */ + find_function_addr (function, NULL); + /* The number of the next register available to hold an argument. */ int arg_reg; diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index 91b4381f0b7..230e39d6671 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1820,9 +1820,11 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argnum; int len = 0; int stack_offset = 0; - CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + /* Call for side effects. */ + find_function_addr (function, NULL); + /* Set the return address register to point to the entry point of the program, where a breakpoint lies in wait. */ regcache_cooked_write_signed (regcache, NIOS2_RA_REGNUM, bp_addr); diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c index 13eed3aeaea..cbd235791ea 100644 --- a/gdb/rs6000-lynx178-tdep.c +++ b/gdb/rs6000-lynx178-tdep.c @@ -44,7 +44,9 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch, gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; - CORE_ADDR func_addr = find_function_addr (function, NULL); + + /* Call for side effects. */ + find_function_addr (function, NULL); struct value *arg = 0; struct type *type; diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 8d96cfc0969..e8befaed6ec 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -462,7 +462,8 @@ adi_examine_command (const char *args, int from_tty) error (_("No ADI information")); pid_t pid = inferior_ptid.pid (); - sparc64_adi_info *proc = get_adi_info_proc (pid); + /* Call for side effects. */ + get_adi_info_proc (pid); int cnt = 1; const char *p = args; if (p && *p == '/') diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c index efb8b0561b4..6a143422dca 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c @@ -882,13 +882,15 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argnum; int stack_offset = 4; int references_offset = 4; - CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); /* The first arg passed on stack. Mostly the first 10 args are passed by registers. */ int first_arg_on_stack = 10; + /* Call for side effects. */ + find_function_addr (function, NULL); + /* Set the return address register to point to the entry point of the program, where a breakpoint lies in wait. */ regcache_cooked_write_unsigned (regcache, TIC6X_RA_REGNUM, bp_addr); -- 2.13.6