• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision9c421dc4db41c0d43df4868394aceddb5aa87520 (tree)
Time2008-12-19 07:16:16
AuthorPedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

* linux-nat.c (linux_child_follow_fork): If following the child,
and not detaching the parent, also add the child fork to the fork
list.
* linux-fork.c (linux_fork_context): Remove dead error call.
Assert that the incoming newfp argument is not null. Do not add a
new fork for inferior_ptid. Assert that there is one already.

Change Summary

Incremental Difference

--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -597,15 +597,14 @@ static void
597597 linux_fork_context (struct fork_info *newfp, int from_tty)
598598 {
599599 /* Now we attempt to switch processes. */
600- struct fork_info *oldfp = find_fork_ptid (inferior_ptid);
600+ struct fork_info *oldfp;
601601 ptid_t ptid;
602602 int id, i;
603603
604- if (!newfp)
605- error (_("No such fork/process"));
604+ gdb_assert (newfp != NULL);
606605
607- if (!oldfp)
608- oldfp = add_fork (ptid_get_pid (inferior_ptid));
606+ oldfp = find_fork_ptid (inferior_ptid);
607+ gdb_assert (oldfp != NULL);
609608
610609 fork_save_infrun_state (oldfp, 1);
611610 remove_breakpoints ();
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -863,6 +863,12 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child)
863863 if (!fp)
864864 fp = add_fork (parent_pid);
865865 fork_save_infrun_state (fp, 0);
866+
867+ /* Also add an entry for the child fork. */
868+ fp = find_fork_pid (child_pid);
869+ if (!fp)
870+ fp = add_fork (child_pid);
871+ fork_save_infrun_state (fp, 0);
866872 }
867873 else
868874 target_detach (NULL, 0);