[review v2] Fix crash with core + TUI + run

Simon Marchi (Code Review)
2019-11-09T00:05:59Z

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/483
......................................................................

Patch Set 2:

(1 comment)

| --- gdb/target.c
| +++ gdb/target.c
| @@ -569,14 +566,18 @@ target_stack::push (target_ops *t)
| - }
| + prev = m_stack[stratum];
|
| /* Now add the new one. */
| m_stack[stratum] = t;
|
| + /* And close the previous one, if it exists. */
| + if (prev != nullptr)
| + target_close (prev);
| +

PS1, Line 574:

> > Now with a quote.
>
> Quote^2.

Testing again.

| if (m_top < stratum)
| m_top = stratum;
| }
|
| /* See target.h. */
|
| void
| push_target (struct target_ops *t)
| {

--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I39e2f8b538c580c8ea5bf1d657ee877e47746c8f
Gerrit-Change-Number: 483
Gerrit-PatchSet: 2
Gerrit-Owner: Sergio Durigan Junior <sergiodj@redhat.com>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-Reviewer: Sergio Durigan Junior <sergiodj@redhat.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Sat, 09 Nov 2019 00:05:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Pedro Alves <palves@redhat.com>
Comment-In-Reply-To: Sergio Durigan Junior <sergiodj@redhat.com>