Use gdbarch obstack to allocate the TYPE_NAME string in arch_type
authorPatrick Palka <patrick@parcs.ath.cx>
Mon, 29 Jun 2015 14:45:47 +0000 (10:45 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Sat, 29 Aug 2015 12:53:08 +0000 (08:53 -0400)
commitaa78b3b28aeff4bb9977a313f5a8002d920b34c5
tree9929b889caa9329b4a0f7665c26e252eaaa18702
parent8f57eec2fb31db5ab4598f09136e7978b7f84c97
Use gdbarch obstack to allocate the TYPE_NAME string in arch_type

Since the type whose name is being set is now being allocated on the
gdbarch obstack, we should allocate its TYPE_NAME on the obstack too.
This reduces the number of individual valgrind warnings for the command
"gdb gdb" from ~300 to ~150.

Tested on x86_64-unknown-linux-gnu.

gdb/ChangeLog:

* gdbarch.h (gdbarch_obstack_strdup): Declare.
* gdbarch.c (gdbarch_obstack_strdup): Define.
* gdbtypes.c (arch_type): Use it.
gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbtypes.c