binutils-gdb/gdb/mi
Lancelot SIX 573269a87c gdb: make thread_info::m_thread_fsm a std::unique_ptr
While working on function calls, I realized that the thread_fsm member
of struct thread_info is a raw pointer to a resource it owns.  This
commit changes the type of the thread_fsm member to a std::unique_ptr in
order to signify this ownership relationship and slightly ease resource
management (no need to manually call delete).

To ensure consistent use, the field is made a private member
(m_thread_fsm).  The setter method (set_thread_fsm) can then check
that it is incorrect to associate a FSM to a thread_info object if
another one is already in place.  This is ensured by an assertion.

The function run_inferior_call takes an argument as a pointer to a
call_thread_fsm and installs it in it in a thread_info instance.  Also
change this function's signature to accept a unique_ptr in order to
signify that the ownership of the call_thread_fsm is transferred during
the call.

No user visible change expected after this commit.

Tested on x86_64-linux with no regression observed.

Change-Id: Ia1224f72a4afa247801ce6650ce82f90224a9ae8
2022-02-07 06:12:06 -05:00
..
ChangeLog-1999-2003
mi-cmd-break.c
mi-cmd-break.h
mi-cmd-catch.c
mi-cmd-disas.c
mi-cmd-env.c
mi-cmd-file.c gdb: remove SYMTAB_COMPUNIT macro, add getter/setter 2022-02-06 15:48:19 -05:00
mi-cmd-info.c
mi-cmd-stack.c gdb: remove SYMBOL_TYPE macro 2022-02-06 16:03:47 -05:00
mi-cmd-target.c
mi-cmd-var.c
mi-cmds.c
mi-cmds.h
mi-common.c
mi-common.h
mi-console.c
mi-console.h
mi-getopt.c
mi-getopt.h
mi-interp.c gdb: make thread_info::m_thread_fsm a std::unique_ptr 2022-02-07 06:12:06 -05:00
mi-interp.h
mi-main.c
mi-main.h
mi-out.c Add ui_file::wrap_here 2022-01-26 15:19:13 -07:00
mi-out.h Convert wrap_here to use integer parameter 2022-01-26 15:19:13 -07:00
mi-parse.c Remove host_hex_value 2022-02-04 07:37:22 -07:00
mi-parse.h
mi-symbol-cmds.c gdb: remove SYMBOL_LINE macro 2022-02-06 16:03:47 -05:00