aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-07-31 10:06:00 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-07-31 10:06:00 -0400
commit1c28969efcca7c214e41c496f599bc4de2c56dbe (patch)
tree9c9e936f78bd753835d67b3bd1b4ded178665754 /gdb/target-descriptions.h
parent1424ad867742286be44932bf29720539add19ae0 (diff)
downloadgdb-1c28969efcca7c214e41c496f599bc4de2c56dbe.zip
gdb-1c28969efcca7c214e41c496f599bc4de2c56dbe.tar.gz
gdb-1c28969efcca7c214e41c496f599bc4de2c56dbe.tar.bz2
Delete test target descriptions when exiting
Looking at the address sanitizer output, this was a quite low hanging fruit. We create target_desc objects for testing that we never free. Saving them in unique_ptrs takes care of it. I created a small struct to hold these because I thought it would help readability. gdb/ChangeLog: * target-descriptions.c (struct xml_test_tdesc): New. (xml_tdesc): Change type to std::vector<xml_test_tdesc>. (record_xml_tdesc): Update. (maintenance_check_xml_descriptions): Update. * target-descriptions.h (record_xml_tdesc): Update comment.
Diffstat (limited to 'gdb/target-descriptions.h')
-rw-r--r--gdb/target-descriptions.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h
index 87403ac..96290b7 100644
--- a/gdb/target-descriptions.h
+++ b/gdb/target-descriptions.h
@@ -215,7 +215,7 @@ namespace selftests {
/* Record that XML_FILE should generate a target description that equals
TDESC, to be verified by the "maintenance check xml-descriptions"
- command. */
+ command. This function takes ownership of TDESC. */
void record_xml_tdesc (const char *xml_file,
const struct target_desc *tdesc);