From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5929 invoked by alias); 22 Jun 2007 12:53:47 -0000 Received: (qmail 5917 invoked by uid 22791); 22 Jun 2007 12:53:46 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Jun 2007 12:53:43 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5MCreCu620016 for ; Fri, 22 Jun 2007 12:53:40 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5MCresi733330 for ; Fri, 22 Jun 2007 14:53:40 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5MCreg2026450 for ; Fri, 22 Jun 2007 14:53:40 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l5MCrelA026447; Fri, 22 Jun 2007 14:53:40 +0200 Message-Id: <200706221253.l5MCrelA026447@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 22 Jun 2007 14:53:40 +0200 Subject: Re: [2/3] Remove gdbarch-swapping of stop_registers To: uweigand@de.ibm.com (Ulrich Weigand) Date: Fri, 22 Jun 2007 12:53:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200706082323.l58NN0Nq019591@d12av02.megacenter.de.ibm.com> from "Ulrich Weigand" at Jun 09, 2007 01:23:00 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2007-06/txt/msg00421.txt.bz2 > * infrun.c (clear_proceed_status): Clean up stop_registers. > (normal_stop): Allocate regcache for stop_registers. > (struct inferior_status): Remove stop_registers member. > (save_inferior_status): Do not save stop_registers. > (restore_inferior_status): Do not restore stop_registers. > (discard_inferior_status): Do not discard stop_registers. > (build_infrun): Remove. > (_initialize_infrun): Do not swap stop_registers. I've now committed the following version of this patch. Bye, Ulrich diff -urNp gdb-orig/gdb/infrun.c gdb-head/gdb/infrun.c --- gdb-orig/gdb/infrun.c 2007-06-16 18:35:52.602950000 +0200 +++ gdb-head/gdb/infrun.c 2007-06-16 22:28:22.564874628 +0200 @@ -632,6 +632,12 @@ clear_proceed_status (void) proceed_to_finish = 0; breakpoint_proceeded = 1; /* We're about to proceed... */ + if (stop_registers) + { + regcache_xfree (stop_registers); + stop_registers = NULL; + } + /* Discard any remaining commands or status from previous stop. */ bpstat_clear (&stop_bpstat); } @@ -3217,9 +3223,15 @@ Further execution is probably impossible /* Save the function value return registers, if we care. We might be about to restore their previous contents. */ if (proceed_to_finish) - /* NB: The copy goes through to the target picking up the value of - all the registers. */ - regcache_cpy (stop_registers, get_current_regcache ()); + { + /* This should not be necessary. */ + if (stop_registers) + regcache_xfree (stop_registers); + + /* NB: The copy goes through to the target picking up the value of + all the registers. */ + stop_registers = regcache_dup (get_current_regcache ()); + } if (stop_stack_dummy) { @@ -3618,7 +3630,6 @@ struct inferior_status CORE_ADDR step_resume_break_address; int stop_after_trap; int stop_soon; - struct regcache *stop_registers; /* These are here because if call_function_by_hand has written some registers and then decides to call error(), we better not have changed @@ -3674,8 +3685,6 @@ save_inferior_status (int restore_stack_ inf_status->restore_stack_info = restore_stack_info; inf_status->proceed_to_finish = proceed_to_finish; - inf_status->stop_registers = regcache_dup_no_passthrough (stop_registers); - inf_status->registers = regcache_dup (get_current_regcache ()); inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL)); @@ -3723,10 +3732,6 @@ restore_inferior_status (struct inferior breakpoint_proceeded = inf_status->breakpoint_proceeded; proceed_to_finish = inf_status->proceed_to_finish; - /* FIXME: Is the restore of stop_registers always needed. */ - regcache_xfree (stop_registers); - stop_registers = inf_status->stop_registers; - /* The inferior can be gone if the user types "print exit(0)" (and perhaps other times). */ if (target_has_execution) @@ -3777,7 +3782,6 @@ discard_inferior_status (struct inferior /* See save_inferior_status for info on stop_bpstat. */ bpstat_clear (&inf_status->stop_bpstat); regcache_xfree (inf_status->registers); - regcache_xfree (inf_status->stop_registers); xfree (inf_status); } @@ -3920,12 +3924,6 @@ save_inferior_ptid (void) } -static void -build_infrun (void) -{ - stop_registers = regcache_xmalloc (current_gdbarch); -} - void _initialize_infrun (void) { @@ -3933,9 +3931,6 @@ _initialize_infrun (void) int numsigs; struct cmd_list_element *c; - DEPRECATED_REGISTER_GDBARCH_SWAP (stop_registers); - deprecated_register_gdbarch_swap (NULL, 0, build_infrun); - add_info ("signals", signals_info, _("\ What debugger does when program gets various signals.\n\ Specify a signal as argument to print info on that signal only.")); -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com