aboutsummaryrefslogtreecommitdiff
path: root/gdb/memrange.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-10-14 08:43:54 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-14 08:43:55 -0400
commit4cdd21a8d3fd943d6993e9d053edf09583802744 (patch)
tree23e8793e081cdccbc32fa04ae7af0b78bf4933ca /gdb/memrange.h
parentd0d292a27402ee2d3f91d541371f134f91730373 (diff)
downloadgdb-4cdd21a8d3fd943d6993e9d053edf09583802744.zip
gdb-4cdd21a8d3fd943d6993e9d053edf09583802744.tar.gz
gdb-4cdd21a8d3fd943d6993e9d053edf09583802744.tar.bz2
Use std::vector for traceframe_info::memory
Straightforward change from a VEC to std::vector. This allows making the destruction of a traceframe_info trivial. I added a constructor with parameters to mem_range to be able to emplace_back directly with the values. It is necessary to leave a default constructor there because mem_range is still used in a VEC. gdb/ChangeLog: * memrange.h (struct mem_range): Add constructors. * tracepoint.h (struct traceframe_info) <memory>: Change type to std::vector<mem_range>. * tracepoint.c (free_traceframe_info): Don't manually free vector. (traceframe_info_start_memory): Adjust to vector change. (traceframe_available_memory): Likewise. * tracefile-tfile.c (build_traceframe_info): Likewise. * ctf.c (ctf_traceframe_info): Likewise.
Diffstat (limited to 'gdb/memrange.h')
-rw-r--r--gdb/memrange.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/memrange.h b/gdb/memrange.h
index b181c98..029ec71 100644
--- a/gdb/memrange.h
+++ b/gdb/memrange.h
@@ -26,6 +26,12 @@
struct mem_range
{
+ mem_range () = default;
+
+ mem_range (CORE_ADDR start_, int length_)
+ : start (start_), length (length_)
+ {}
+
/* Lowest address in the range. */
CORE_ADDR start;