From patchwork Thu Jan 28 19:04:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 10660 Received: (qmail 21595 invoked by alias); 28 Jan 2016 19:04:54 -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 21571 invoked by uid 89); 28 Jan 2016 19:04:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=(unknown), *context, 774, 7, 7747 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 28 Jan 2016 19:04:51 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 1A.1E.32102.E366AA65; Thu, 28 Jan 2016 20:04:30 +0100 (CET) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 28 Jan 2016 14:04:48 -0500 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] remote.c: Cleanup unused variables Date: Thu, 28 Jan 2016 14:04:45 -0500 Message-ID: <1454007885-13491-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes I built remote.c with -Wunused, to check a function I was working on, turns out there is a bunch of unused variables. gdb/ChangeLog: * remote.c (remote_register_number_and_offset): Remove unused variable(s). (remote_thread_always_alive): Likewise. (remote_update_thread_list): Likewise. (process_initial_stop_replies): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (discard_pending_stop_replies): Likewise. (process_stop_reply): Likewise. (putpkt_binary): Likewise. (getpkt): Likewise. (remote_add_target_side_condition): Likewise. (remote_insert_breakpoint): Likewise. (remote_supports_stopped_by_sw_breakpoint): Likewise. (remote_supports_stopped_by_hw_breakpoint): Likewise. (remote_xfer_partial): Likewise. (remote_read_btrace): Likewise. (remote_async_serial_handler): Likewise. (remote_thread_events): Likewise. (_initialize_remote): Likewise. --- gdb/remote.c | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 8831b50..c104ee0 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -766,7 +766,6 @@ int remote_register_number_and_offset (struct gdbarch *gdbarch, int regnum, int *pnum, int *poffset) { - int sizeof_g_packet; struct packet_reg *regs; struct cleanup *old_chain; @@ -775,7 +774,7 @@ remote_register_number_and_offset (struct gdbarch *gdbarch, int regnum, regs = XCNEWVEC (struct packet_reg, gdbarch_num_regs (gdbarch)); old_chain = make_cleanup (xfree, regs); - sizeof_g_packet = map_regcache_remote_table (gdbarch, regs); + map_regcache_remote_table (gdbarch, regs); *pnum = regs[regnum].pnum; *poffset = regs[regnum].offset; @@ -2202,9 +2201,6 @@ set_general_process (void) static int remote_thread_always_alive (struct target_ops *ops, ptid_t ptid) { - struct remote_state *rs = get_remote_state (); - char *p, *endp; - if (ptid_equal (ptid, magic_null_ptid)) /* The main thread is always alive. */ return 1; @@ -3197,7 +3193,6 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops, static void remote_update_thread_list (struct target_ops *ops) { - struct remote_state *rs = get_remote_state (); struct threads_listing_context context; struct cleanup *old_chain; int got_list = 0; @@ -3953,8 +3948,6 @@ process_initial_stop_replies (int from_tty) that as current. */ ALL_NON_EXITED_THREADS (thread) { - struct target_waitstatus *ws; - if (first == NULL) first = thread; @@ -3963,8 +3956,6 @@ process_initial_stop_replies (int from_tty) else if (thread->state != THREAD_STOPPED) continue; - ws = &thread->suspend.waitstatus; - if (selected == NULL && thread->suspend.waitstatus_pending_p) selected = thread; @@ -4118,10 +4109,6 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p) if (!target_is_non_stop_p ()) { - ptid_t ptid; - int fake_pid_p = 0; - struct inferior *inf; - if (rs->buf[0] == 'W' || rs->buf[0] == 'X') { if (!extended_p) @@ -4341,7 +4328,6 @@ remote_check_symbols (void) { struct remote_state *rs = get_remote_state (); char *msg, *reply, *tmp; - struct bound_minimal_symbol sym; int end; struct cleanup *old_chain; @@ -6224,7 +6210,6 @@ remove_stop_reply_for_inferior (QUEUE (stop_reply_p) *q, static void discard_pending_stop_replies (struct inferior *inf) { - int i; struct queue_iter_param param; struct stop_reply *reply; struct remote_state *rs = get_remote_state (); @@ -6811,7 +6796,6 @@ process_stop_reply (struct stop_reply *stop_reply, && status->kind != TARGET_WAITKIND_SIGNALLED && status->kind != TARGET_WAITKIND_NO_RESUMED) { - struct remote_state *rs = get_remote_state (); struct private_thread_info *remote_thr; /* Expedited registers. */ @@ -8281,7 +8265,6 @@ putpkt_binary (const char *buf, int cnt) int ch; int tcount = 0; char *p; - char *message; /* Catch cases like trying to read memory or listing threads while we're waiting for a stop reply. The remote server wouldn't be @@ -8661,9 +8644,7 @@ getpkt (char **buf, long *sizeof_buf, int forever) { - int timed_out; - - timed_out = getpkt_sane (buf, sizeof_buf, forever); + getpkt_sane (buf, sizeof_buf, forever); } @@ -9226,8 +9207,6 @@ remote_add_target_side_condition (struct gdbarch *gdbarch, { struct agent_expr *aexpr = NULL; int i, ix; - char *pkt; - char *buf_start = buf; if (VEC_empty (agent_expr_p, bp_tgt->conditions)) return 0; @@ -9299,7 +9278,6 @@ remote_insert_breakpoint (struct target_ops *ops, struct remote_state *rs; char *p, *endbuf; int bpsize; - struct condition_list *cond = NULL; /* Make sure the remote is pointing at the right process, if necessary. */ @@ -9554,8 +9532,6 @@ remote_stopped_by_sw_breakpoint (struct target_ops *ops) static int remote_supports_stopped_by_sw_breakpoint (struct target_ops *ops) { - struct remote_state *rs = get_remote_state (); - return (packet_support (PACKET_swbreak_feature) == PACKET_ENABLE); } @@ -9576,8 +9552,6 @@ remote_stopped_by_hw_breakpoint (struct target_ops *ops) static int remote_supports_stopped_by_hw_breakpoint (struct target_ops *ops) { - struct remote_state *rs = get_remote_state (); - return (packet_support (PACKET_hwbreak_feature) == PACKET_ENABLE); } @@ -10043,8 +10017,6 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object, /* Only handle flash writes. */ if (writebuf != NULL) { - LONGEST xfered; - switch (object) { case TARGET_OBJECT_FLASH: @@ -12912,7 +12884,6 @@ remote_read_btrace (struct target_ops *self, enum btrace_read_type type) { struct packet_config *packet = &remote_protocol_packets[PACKET_qXfer_btrace]; - struct remote_state *rs = get_remote_state (); struct cleanup *cleanup; const char *annex; char *xml; @@ -13239,8 +13210,6 @@ static serial_event_ftype remote_async_serial_handler; static void remote_async_serial_handler (struct serial *scb, void *context) { - struct remote_state *rs = (struct remote_state *) context; - /* Don't propogate error information up to the client. Instead let the client find out about the error by querying the target. */ inferior_event_handler (INF_REG_EVENT, NULL); @@ -13292,7 +13261,6 @@ remote_thread_events (struct target_ops *ops, int enable) { struct remote_state *rs = get_remote_state (); size_t size = get_remote_packet_size (); - char *p = rs->buf; if (packet_support (PACKET_QThreadEvents) == PACKET_DISABLE) return; @@ -13458,7 +13426,6 @@ set_range_stepping (char *ignore_args, int from_tty, void _initialize_remote (void) { - struct remote_state *rs; struct cmd_list_element *cmd; const char *cmd_name;