From patchwork Sun Sep 30 16:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 29589 Received: (qmail 57231 invoked by alias); 30 Sep 2018 16:39:09 -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 57218 invoked by uid 89); 30 Sep 2018 16:39:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=5.3.0, 530, sk:current, inf X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Sep 2018 16:39:06 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5E223097026 for ; Sun, 30 Sep 2018 16:39:05 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1811E60BE5 for ; Sun, 30 Sep 2018 16:39:04 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [ob/pushed] Darwin: Remove unused variables [-Werror=unused-variable] Date: Sun, 30 Sep 2018 17:39:03 +0100 Message-Id: <20180930163903.19570-1-palves@redhat.com> Building GDB with --host=x86_64-apple-darwin15 using G++ 5.3.0 runs into a number of -Werror=unused-variable warnings/errors: ../../src/gdb/i386-darwin-nat.c: In function 'void i386_darwin_dr_set(int, CORE_ADDR)': ../../src/gdb/i386-darwin-nat.c:283:7: error: unused variable 'current_pid' [-Werror=unused-variable] int current_pid; ^ [etc, etc.] This commit fixes all such warnings. gdb/ChangeLog: 2018-09-30 Pedro Alves * darwin-nat-info.c (darwin_debug_regions_recurse) (info_mach_exceptions_command): Remove unused local variables. * darwin-nat.c (darwin_decode_notify_message) (darwin_nat_target::resume, darwin_nat_target::mourn_inferior) (darwin_stop_inferior, darwin_setup_exceptions) (darwin_nat_target::kill, darwin_attach_pid, darwin_ptrace_him) (darwin_nat_target::attach, darwin_nat_target::detach) (darwin_read_write_inferior, darwin_read_dyld_info): Remove unused local variables. * i386-darwin-nat.c (i386_darwin_dr_set): Remove unused local variables. --- gdb/ChangeLog | 14 ++++++++++++++ gdb/darwin-nat-info.c | 4 ---- gdb/darwin-nat.c | 32 -------------------------------- gdb/i386-darwin-nat.c | 1 - 4 files changed, 14 insertions(+), 37 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d5787816dc..31d06708e3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2018-09-30 Pedro Alves + + * darwin-nat-info.c (darwin_debug_regions_recurse) + (info_mach_exceptions_command): Remove unused local variables. + * darwin-nat.c (darwin_decode_notify_message) + (darwin_nat_target::resume, darwin_nat_target::mourn_inferior) + (darwin_stop_inferior, darwin_setup_exceptions) + (darwin_nat_target::kill, darwin_attach_pid, darwin_ptrace_him) + (darwin_nat_target::attach, darwin_nat_target::detach) + (darwin_read_write_inferior, darwin_read_dyld_info): Remove unused + local variables. + * i386-darwin-nat.c (i386_darwin_dr_set): Remove unused local + variables. + 2018-09-29 Tom Tromey * README: Remove some leftover text. diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c index f3c8de286a..8c814a91a6 100644 --- a/gdb/darwin-nat-info.c +++ b/gdb/darwin-nat-info.c @@ -607,14 +607,12 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max) static void darwin_debug_regions_recurse (task_t task) { - mach_vm_address_t r_addr; mach_vm_address_t r_start; mach_vm_size_t r_size; natural_t r_depth; mach_msg_type_number_t r_info_size; vm_region_submap_short_info_data_64_t r_info; kern_return_t kret; - int ret; struct ui_out *uiout = current_uiout; ui_out_emit_table table_emitter (uiout, 9, -1, "regions"); @@ -792,8 +790,6 @@ disp_exception (const darwin_exception_info *info) static void info_mach_exceptions_command (const char *args, int from_tty) { - int i; - task_t task; kern_return_t kret; darwin_exception_info info; diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index eee9380d65..ecc7635d04 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -746,11 +746,7 @@ darwin_decode_notify_message (mach_msg_header_t *hdr, struct inferior **pinf) NDR_record_t *ndr = (NDR_record_t *)(hdr + 1); integer_t *data = (integer_t *)(ndr + 1); struct inferior *inf; - darwin_thread_t *thread; task_t task_port; - thread_t thread_port; - kern_return_t kret; - int i; /* Check message header. */ if (hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX) @@ -939,12 +935,8 @@ void darwin_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal) { struct target_waitstatus status; - int pid; - kern_return_t kret; - int res; int nsignal; - struct inferior *inf; inferior_debug (2, _("darwin_resume: pid=%d, tid=0x%lx, step=%d, signal=%d\n"), @@ -1361,7 +1353,6 @@ darwin_nat_target::mourn_inferior () darwin_inferior *priv = get_darwin_inferior (inf); kern_return_t kret; mach_port_t prev; - int i; /* Deallocate threads. */ darwin_deallocate_threads (inf); @@ -1420,8 +1411,6 @@ darwin_stop_inferior (struct inferior *inf) { struct target_waitstatus wstatus; ptid_t ptid; - kern_return_t kret; - int status; int res; darwin_inferior *priv = get_darwin_inferior (inf); @@ -1502,7 +1491,6 @@ darwin_setup_exceptions (struct inferior *inf) { darwin_inferior *priv = get_darwin_inferior (inf); kern_return_t kret; - int traps_expected; exception_mask_t mask; kret = darwin_save_exception_ports (priv); @@ -1532,7 +1520,6 @@ darwin_nat_target::kill () struct target_waitstatus wstatus; ptid_t ptid; kern_return_t kret; - int status; int res; if (inferior_ptid == null_ptid) @@ -1611,10 +1598,6 @@ static void darwin_attach_pid (struct inferior *inf) { kern_return_t kret; - mach_port_t prev_port; - int traps_expected; - mach_port_t prev_not; - exception_mask_t mask; darwin_inferior *priv = new darwin_inferior; inf->priv.reset (priv); @@ -1800,10 +1783,6 @@ darwin_pre_ptrace (void) static void darwin_ptrace_him (int pid) { - task_t itask; - kern_return_t kret; - mach_port_t prev_port; - int traps_expected; struct inferior *inf = current_inferior (); darwin_attach_pid (inf); @@ -1927,11 +1906,7 @@ void darwin_nat_target::attach (const char *args, int from_tty) { pid_t pid; - pid_t pid2; - int wstatus; - int res; struct inferior *inf; - kern_return_t kret; pid = parse_pid_to_attach (args); @@ -1987,7 +1962,6 @@ darwin_nat_target::attach (const char *args, int from_tty) void darwin_nat_target::detach (inferior *inf, int from_tty) { - pid_t pid = inferior_ptid.pid (); darwin_inferior *priv = get_darwin_inferior (inf); kern_return_t kret; int res; @@ -2056,11 +2030,6 @@ darwin_read_write_inferior (task_t task, CORE_ADDR addr, { kern_return_t kret; mach_vm_size_t res_length = 0; - pointer_t copied; - mach_msg_type_number_t copy_count; - mach_vm_size_t remaining_length; - mach_vm_address_t region_address; - mach_vm_size_t region_length; inferior_debug (8, _("darwin_read_write_inferior(task=0x%x, %s, len=%s)\n"), task, core_addr_to_string (addr), pulongest (length)); @@ -2214,7 +2183,6 @@ darwin_read_dyld_info (task_t task, CORE_ADDR addr, gdb_byte *rdaddr, { struct task_dyld_info task_dyld_info; mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; - int sz = TASK_DYLD_INFO_COUNT * sizeof (natural_t); kern_return_t kret; if (addr != 0 || length > sizeof (mach_vm_address_t)) diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index 2304f4a6d3..820aff90cc 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -280,7 +280,6 @@ i386_darwin_nat_target::store_registers (struct regcache *regcache, static void i386_darwin_dr_set (int regnum, CORE_ADDR value) { - int current_pid; thread_t current_thread; x86_debug_state_t dr_regs; kern_return_t ret;