aboutsummaryrefslogtreecommitdiff
path: root/gdb/vec.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-06-11 15:21:11 +0000
committerTom Tromey <tromey@redhat.com>2010-06-11 15:21:11 +0000
commit3cf03773b76a534bca744f8353a3f5bac5b5a582 (patch)
treeb0244faa27d41ca3a10561ef07a1f4470535c2b0 /gdb/vec.h
parent81bb31c0d9904c80f282134ea1ccb6899f93b0a6 (diff)
downloadgdb-3cf03773b76a534bca744f8353a3f5bac5b5a582.zip
gdb-3cf03773b76a534bca744f8353a3f5bac5b5a582.tar.gz
gdb-3cf03773b76a534bca744f8353a3f5bac5b5a582.tar.bz2
* vec.h (VEC_cleanup): New macro.
(DEF_VEC_ALLOC_FUNC_I): Update. (DEF_VEC_ALLOC_FUNC_P): Likewise. (DEF_VEC_ALLOC_FUNC_O): Likewise. * dwarf2loc.c (struct axs_var_loc): Remove. (unimplemented): New function. (translate_register): Likewise. (access_memory): Likewise. (compile_dwarf_to_ax): Likewise. (dwarf2_tracepoint_var_loc): Remove. (dwarf2_tracepoint_var_access): Likewise. (dwarf2_tracepoint_var_ref): Likewise. (locexpr_tracepoint_var_ref): Use compile_dwarf_to_ax. (loclist_tracepoint_var_ref): Likewise. * dwarf2expr.h (dwarf_expr_require_composition): Declare. * dwarf2expr.c (dwarf_expr_require_composition): Rename from require_composition. No longer static. (execute_stack_op): Update. * ax-gdb.h (trace_kludge): Declare.
Diffstat (limited to 'gdb/vec.h')
-rw-r--r--gdb/vec.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/gdb/vec.h b/gdb/vec.h
index 6690588..e9d5a15 100644
--- a/gdb/vec.h
+++ b/gdb/vec.h
@@ -184,6 +184,13 @@
#define VEC_free(T,V) (VEC_OP(T,free)(&V))
+/* A cleanup function for a vector.
+ void VEC_T_cleanup(void *);
+
+ Clean up a vector. */
+
+#define VEC_cleanup(T) (VEC_OP(T,cleanup))
+
/* Use these to determine the required size and initialization of a
vector embedded within another structure (as the final member).
@@ -461,6 +468,15 @@ static inline void VEC_OP (T,free) \
*vec_ = NULL; \
} \
\
+static inline void VEC_OP (T,cleanup) \
+ (void *arg_) \
+{ \
+ VEC(T) **vec_ = arg_; \
+ if (*vec_) \
+ vec_free_ (*vec_); \
+ *vec_ = NULL; \
+} \
+ \
static inline int VEC_OP (T,reserve) \
(VEC(T) **vec_, int alloc_ VEC_ASSERT_DECL) \
{ \
@@ -699,6 +715,15 @@ static inline void VEC_OP (T,free) \
*vec_ = NULL; \
} \
\
+static inline void VEC_OP (T,cleanup) \
+ (void *arg_) \
+{ \
+ VEC(T) **vec_ = arg_; \
+ if (*vec_) \
+ vec_free_ (*vec_); \
+ *vec_ = NULL; \
+} \
+ \
static inline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_) \
{ \
size_t len_ = vec_ ? vec_->num : 0; \
@@ -957,6 +982,15 @@ static inline void VEC_OP (T,free) \
*vec_ = NULL; \
} \
\
+static inline void VEC_OP (T,cleanup) \
+ (void *arg_) \
+{ \
+ VEC(T) **vec_ = arg_; \
+ if (*vec_) \
+ vec_free_ (*vec_); \
+ *vec_ = NULL; \
+} \
+ \
static inline int VEC_OP (T,reserve) \
(VEC(T) **vec_, int alloc_ VEC_ASSERT_DECL) \
{ \