mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-25 11:16:56 +08:00
gdb: Improve scoped_switch_fork_info class
After committing this patch I got this feedback: https://sourceware.org/ml/gdb-patches/2019-01/msg00181.html This patch makes the constructor of scoped_switch_fork_info explicit, and wraps the core of the destructor in a TRY/CATCH block. I've run this through the testsuite on X86-64/GNU Linux, however, this code is not exercised, so this patch is untested. gdb/ChangeLog: * linux-fork.c (scoped_switch_fork_info) <scoped_switch_fork_info>: Make explicit. <~scoped_switch_fork_info>: Wrap core in TRY/CATCH.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2019-01-10 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* linux-fork.c (scoped_switch_fork_info)
|
||||||
|
<scoped_switch_fork_info>: Make explicit.
|
||||||
|
<~scoped_switch_fork_info>: Wrap core in TRY/CATCH.
|
||||||
|
|
||||||
2019-01-10 Tom Tromey <tom@tromey.com>
|
2019-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* objfiles.h (objfile::reset_psymtabs): Update.
|
* objfiles.h (objfile::reset_psymtabs): Update.
|
||||||
|
@ -446,7 +446,7 @@ class scoped_switch_fork_info
|
|||||||
public:
|
public:
|
||||||
/* Switch to the infrun state held on the fork_info identified by
|
/* Switch to the infrun state held on the fork_info identified by
|
||||||
PPTID. If PPTID is the current inferior then no switch is done. */
|
PPTID. If PPTID is the current inferior then no switch is done. */
|
||||||
scoped_switch_fork_info (ptid_t pptid)
|
explicit scoped_switch_fork_info (ptid_t pptid)
|
||||||
: m_oldfp (nullptr)
|
: m_oldfp (nullptr)
|
||||||
{
|
{
|
||||||
if (pptid != inferior_ptid)
|
if (pptid != inferior_ptid)
|
||||||
@ -472,9 +472,18 @@ public:
|
|||||||
if (m_oldfp != nullptr)
|
if (m_oldfp != nullptr)
|
||||||
{
|
{
|
||||||
/* Switch back to inferior_ptid. */
|
/* Switch back to inferior_ptid. */
|
||||||
remove_breakpoints ();
|
TRY
|
||||||
fork_load_infrun_state (m_oldfp);
|
{
|
||||||
insert_breakpoints ();
|
remove_breakpoints ();
|
||||||
|
fork_load_infrun_state (m_oldfp);
|
||||||
|
insert_breakpoints ();
|
||||||
|
}
|
||||||
|
CATCH (ex, RETURN_MASK_ALL)
|
||||||
|
{
|
||||||
|
warning (_("Couldn't restore checkpoint state in %s: %s"),
|
||||||
|
target_pid_to_str (fp->ptid), ex.message);
|
||||||
|
}
|
||||||
|
END_CATCH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user