mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
gdbserver: simply copy the pointer in 'set_target_ops'
The 'set_target_ops' function takes a target op vector and creates a clone of it via XNEW and memcpy. This is not necessary. 'the_target' is a singleton, and the argument that is passed to 'set_target_ops' is always the address of a global, static object. Therefore, update the implementation to simply copy the pointer. gdbserver/ChangeLog: 2020-02-20 Pedro Alves <palves@redhat.com> * target.cc (set_target_ops): Simply copy the given target pointer instead of creating a copy of the pointed object.
This commit is contained in:

committed by
Tankut Baris Aktemur

parent
d633e83140
commit
478f9adff5
@ -1,3 +1,8 @@
|
||||
2020-02-20 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* target.cc (set_target_ops): Simply copy the given target pointer
|
||||
instead of creating a copy of the pointed object.
|
||||
|
||||
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
||||
|
||||
Turn process_stratum_target's get_ipa_tdesc_idx op into a method
|
||||
|
@ -270,8 +270,7 @@ target_supports_multi_process (void)
|
||||
void
|
||||
set_target_ops (process_stratum_target *target)
|
||||
{
|
||||
the_target = XNEW (process_stratum_target);
|
||||
memcpy (the_target, target, sizeof (*the_target));
|
||||
the_target = target;
|
||||
}
|
||||
|
||||
/* Convert pid to printable format. */
|
||||
|
Reference in New Issue
Block a user