]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr<char>
authorAndrew Burgess <aburgess@redhat.com>
Fri, 4 Oct 2024 17:45:04 +0000 (18:45 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 10 Oct 2024 16:36:20 +0000 (17:36 +0100)
commit9c13221eaf486d6c140f6202f836d80e2a8a69fe
treea2379effd042996541a847aea643d4e05ddc41b9
parentf04b2702faf409b0d54a1dacd4ef4beb4272c35d
gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr<char>

Convert target_desc::arch and target_desc::osabi from 'const char*' to
gdb::unique_xmalloc_ptr<char>.  This also allows us to remove the user
defined ~target_desc destructor.

I doubt it ever actually occurred, but in theory at least, there was a
memory leak in set_tdesc_architecture and set_tdesc_osabi where the
member variables were assigned without freeing any previous
value... but I suspect that usually these fields are only set once.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/tdesc.cc
gdbserver/tdesc.h