diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-11-17 13:02:25 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-11-17 13:03:34 -0500 |
commit | f27866ba9c348a72a899f5a84dadf1f943c89720 (patch) | |
tree | 3a04df530e654e382be4d2533db6969b8428d2b4 /gdb/gdbserver/server.c | |
parent | 37269bc92ca6a79f9e56fe83718f3c86a1db845d (diff) | |
download | gdb-f27866ba9c348a72a899f5a84dadf1f943c89720.zip gdb-f27866ba9c348a72a899f5a84dadf1f943c89720.tar.gz gdb-f27866ba9c348a72a899f5a84dadf1f943c89720.tar.bz2 |
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.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r-- | gdb/gdbserver/server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index e827b9c..f0dac95 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -623,7 +623,7 @@ handle_general_set (char *own_buf) } process = current_process (); - VEC_truncate (int, process->syscalls_to_catch, 0); + process->syscalls_to_catch.clear (); if (enabled) { @@ -634,11 +634,11 @@ handle_general_set (char *own_buf) while (*p != '\0') { p = decode_address_to_semicolon (&sysno, p); - VEC_safe_push (int, process->syscalls_to_catch, (int) sysno); + process->syscalls_to_catch.push_back (sysno); } } else - VEC_safe_push (int, process->syscalls_to_catch, ANY_SYSCALL); + process->syscalls_to_catch.push_back (ANY_SYSCALL); } write_ok (own_buf); |