This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix remote.c incorrectly using pop_target (wrt btrace)


On 03/12/2013 01:28 AM, Jan Kratochvil wrote:
@@ -4348,7 +4344,7 @@ remote_open_1 (char *name, int from_tty,
  	/* Pop the partially set up target - unless something else did
  	   already before throwing the exception.  */
  	if (remote_desc != NULL)
-	  pop_target ();
+	  remote_unpush_target ();


Since it is in remote_open_1, the remote target or exteneded-remote target is just pushed and top most, so pop_target should be fine here. It is not necessary to change it to remote_unpush_target.

  	if (target_async_permitted)
  	  wait_forever_enabled_p = 1;
  	throw_exception (ex);
@@ -5096,7 +5092,7 @@ interrupt_query (void)
        if (query (_("Interrupted while waiting for the program.\n\
  Give up (and stop debugging it)? ")))
  	{
-	  pop_target ();
+	  remote_unpush_target ();
  	  deprecated_throw_reason (RETURN_QUIT);
  	}
      }
@@ -7051,11 +7047,11 @@ readchar (int timeout)
    switch ((enum serial_rc) ch)
      {
      case SERIAL_EOF:
-      pop_target ();
+      remote_unpush_target ();

Supposing we are in 'record-btrace' target and get a communication error, the current target stack looks like:


  record-btrace
  remote
  exec
  none

remote_unpush_target will unpush or remove the remote target in the stack. So the stack is changed to:

  record-btrace
  exec
  none

Is it what we want? When GDB is in record-btrace target, and get some errors in communication, both record-btrace and remote target should be popped from the stack.

--
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]