From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28282 invoked by alias); 11 Sep 2008 16:13:42 -0000 Received: (qmail 28271 invoked by uid 22791); 11 Sep 2008 16:13:41 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Sep 2008 16:12:58 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id m8BGC24l277204 for ; Thu, 11 Sep 2008 16:12:02 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 v9.1) with ESMTP id m8BGC2jd3121384 for ; Thu, 11 Sep 2008 18:12:02 +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 m8BGBwpP004651 for ; Thu, 11 Sep 2008 18:11:59 +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 m8BGBwiF004648; Thu, 11 Sep 2008 18:11:58 +0200 Message-Id: <200809111611.m8BGBwiF004648@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 11 Sep 2008 18:11:58 +0200 Subject: Re: [patch, rfc] Re: target_find_description question To: gdb-patches@sourceware.org Date: Thu, 11 Sep 2008 16:13:00 -0000 From: "Ulrich Weigand" Cc: pedro@codesourcery.com (Pedro Alves), drow@false.org, brobecker@adacore.com In-Reply-To: <200809042359.m84NxTYO018519@d12av02.megacenter.de.ibm.com> from "Ulrich Weigand" at Sep 05, 2008 01:59:29 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: 2008-09/txt/msg00234.txt.bz2 > * fork-child.c (startup_inferior): Use target_wait and target_resume > directly instead of calling wait_for_inferior / resume. > > * infcmd.c (kill_if_already_running): Do not call no_shared_libraries > or init_wait_for_inferior. > (run_command_1): Call init_wait_for_inferior. I've checked this in now. Updated patch is appended below. Bye, Ulrich Index: gdb/fork-child.c =================================================================== RCS file: /cvs/src/src/gdb/fork-child.c,v retrieving revision 1.43 diff -c -p -r1.43 fork-child.c *** gdb/fork-child.c 8 Sep 2008 21:51:18 -0000 1.43 --- gdb/fork-child.c 11 Sep 2008 14:49:49 -0000 *************** startup_inferior (int ntraps) *** 428,451 **** if (exec_wrapper) pending_execs++; - clear_proceed_status (); - - init_wait_for_inferior (); - while (1) { ! struct thread_info *tp; ! /* Make wait_for_inferior be quiet. */ ! stop_soon = STOP_QUIETLY; ! wait_for_inferior (1); ! tp = inferior_thread (); ! if (tp->stop_signal != TARGET_SIGNAL_TRAP) { ! /* Let shell child handle its own signals in its own way. ! FIXME: what if child has exited? Must exit loop ! somehow. */ ! resume (0, tp->stop_signal); } else { --- 428,494 ---- if (exec_wrapper) pending_execs++; while (1) { ! int resume_signal = TARGET_SIGNAL_0; ! ptid_t resume_ptid; ! ! struct target_waitstatus ws; ! memset (&ws, 0, sizeof (ws)); ! resume_ptid = target_wait (pid_to_ptid (-1), &ws); ! ! /* Mark all threads non-executing. */ ! set_executing (pid_to_ptid (-1), 0); ! ! /* In all-stop mode, resume all threads. */ ! if (!non_stop) ! resume_ptid = pid_to_ptid (-1); ! ! switch (ws.kind) ! { ! case TARGET_WAITKIND_IGNORE: ! case TARGET_WAITKIND_SPURIOUS: ! case TARGET_WAITKIND_LOADED: ! case TARGET_WAITKIND_FORKED: ! case TARGET_WAITKIND_VFORKED: ! case TARGET_WAITKIND_SYSCALL_ENTRY: ! case TARGET_WAITKIND_SYSCALL_RETURN: ! /* Ignore gracefully during startup of the inferior. */ ! break; ! ! case TARGET_WAITKIND_SIGNALLED: ! target_terminal_ours (); ! target_mourn_inferior (); ! error (_("During startup program terminated with signal %s, %s."), ! target_signal_to_name (ws.value.sig), ! target_signal_to_string (ws.value.sig)); ! return; ! ! case TARGET_WAITKIND_EXITED: ! target_terminal_ours (); ! target_mourn_inferior (); ! if (ws.value.integer) ! error (_("During startup program exited with code %d."), ! ws.value.integer); ! else ! error (_("During startup program exited normally.")); ! return; ! ! case TARGET_WAITKIND_EXECD: ! /* Handle EXEC signals as if they were SIGTRAP signals. */ ! xfree (ws.value.execd_pathname); ! resume_signal = TARGET_SIGNAL_TRAP; ! break; ! ! case TARGET_WAITKIND_STOPPED: ! resume_signal = ws.value.sig; ! break; ! } ! if (resume_signal != TARGET_SIGNAL_TRAP) { ! /* Let shell child handle its own signals in its own way. */ ! target_resume (resume_ptid, 0, resume_signal); } else { *************** startup_inferior (int ntraps) *** 470,479 **** if (--pending_execs == 0) break; ! resume (0, TARGET_SIGNAL_0); /* Just make it go on. */ } } - stop_soon = NO_STOP_QUIETLY; } /* Implement the "unset exec-wrapper" command. */ --- 513,522 ---- if (--pending_execs == 0) break; ! /* Just make it go on. */ ! target_resume (resume_ptid, 0, TARGET_SIGNAL_0); } } } /* Implement the "unset exec-wrapper" command. */ Index: gdb/infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.210 diff -c -p -r1.210 infcmd.c *** gdb/infcmd.c 8 Sep 2008 22:10:20 -0000 1.210 --- gdb/infcmd.c 11 Sep 2008 14:49:49 -0000 *************** kill_if_already_running (int from_tty) *** 431,438 **** Start it from the beginning? ")) error (_("Program not restarted.")); target_kill (); - no_shared_libraries (NULL, from_tty); - init_wait_for_inferior (); } } --- 431,436 ---- *************** run_command_1 (char *args, int from_tty, *** 448,453 **** --- 446,453 ---- dont_repeat (); kill_if_already_running (from_tty); + + init_wait_for_inferior (); clear_breakpoint_hit_counts (); /* Clean up any leftovers from other runs. Some other things from -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com