Make process_info::syscalls_to_catch an std::vector
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 17 Nov 2017 18:02:25 +0000 (13:02 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 17 Nov 2017 18:03:34 +0000 (13:03 -0500)
commitf27866ba9c348a72a899f5a84dadf1f943c89720
tree3a04df530e654e382be4d2533db6969b8428d2b4
parent37269bc92ca6a79f9e56fe83718f3c86a1db845d
Make process_info::syscalls_to_catch an std::vector

This patch makes the syscalls_to_catch field of process_info an
std::vector<int>.  The process_info structure must now be
newed/deleted.

In handle_extended_wait, the code that handles exec events destroys the
existing process_info and creates a new one.  It moves the content of
syscalls_to_catch from the old to the new vector.  I used std::move for
that (through an intermediary variable), which should have the same
behavior as the old code.

gdb/gdbserver/ChangeLog:

* inferiors.h (struct process_info): Add constructor, initialize
fields..
<syscalls_to_catch>: Change type to std::vector<int>.
* inferiors.c (add_process): Allocate process_info with new.
(remove_process): Free process_info with delete.
* linux-low.c (handle_extended_wait): Adjust.
(gdb_catching_syscalls_p, gdb_catch_this_syscall_p): Adjust.
* server.c (handle_general_set): Adjust.
gdb/gdbserver/ChangeLog
gdb/gdbserver/inferiors.c
gdb/gdbserver/inferiors.h
gdb/gdbserver/linux-low.c
gdb/gdbserver/server.c