GDBserver

Macros | Functions
vec.h File Reference
`#include "diagnostics.h"`

Go to the source code of this file.

## Macros
#define | DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION
#define | VEC_length(T, V) (VEC_OP(T,length)(V))
#define | VEC_empty(T, V) (VEC_length (T,V) == 0)
#define | VEC_last(T, V) (VEC_OP(T,last)(V VEC_ASSERT_INFO))
#define | VEC_index(T, V, I) (VEC_OP(T,index)(V,I VEC_ASSERT_INFO))
#define | VEC_iterate(T, V, I, P) (VEC_OP(T,iterate)(V,I,&(P)))
#define | VEC_alloc(T, N) (VEC_OP(T,alloc)(N))
#define | VEC_free(T, V) (VEC_OP(T,free)(&V))
#define | VEC_cleanup(T) (VEC_OP(T,cleanup))
#define | VEC_embedded_size(T, N) (VEC_OP(T,embedded_size)(N))
#define | VEC_embedded_init(T, O, N) (VEC_OP(T,embedded_init)(VEC_BASE(O),N))
#define | VEC_copy(T, V) (VEC_OP(T,copy)(V))
#define | VEC_merge(T, V1, V2) (VEC_OP(T,merge)(V1, V2))
#define | VEC_space(T, V, R) (VEC_OP(T,space)(V,R VEC_ASSERT_INFO))
#define | VEC_reserve(T, V, R) (VEC_OP(T,reserve)(&(V),R VEC_ASSERT_INFO))
#define | VEC_quick_push(T, V, O) (VEC_OP(T,quick_push)(V,O VEC_ASSERT_INFO))
#define | VEC_safe_push(T, V, O) (VEC_OP(T,safe_push)(&(V),O VEC_ASSERT_INFO))
#define | VEC_pop(T, V) (VEC_OP(T,pop)(V VEC_ASSERT_INFO))
#define | VEC_truncate(T, V, I) (VEC_OP(T,truncate)(V,I VEC_ASSERT_INFO))
#define | VEC_safe_grow(T, V, I) (VEC_OP(T,safe_grow)(&(V),I VEC_ASSERT_INFO))
#define | VEC_replace(T, V, I, O) (VEC_OP(T,replace)(V,I,O VEC_ASSERT_INFO))
#define | VEC_quick_insert(T, V, I, O) (VEC_OP(T,quick_insert)(V,I,O VEC_ASSERT_INFO))
#define | VEC_safe_insert(T, V, I, O) (VEC_OP(T,safe_insert)(&(V),I,O VEC_ASSERT_INFO))
#define | VEC_ordered_remove(T, V, I) (VEC_OP(T,ordered_remove)(V,I VEC_ASSERT_INFO))
#define | VEC_unordered_remove(T, V, I) (VEC_OP(T,unordered_remove)(V,I VEC_ASSERT_INFO))
#define | VEC_block_remove(T, V, I, L) (VEC_OP(T,block_remove)(V,I,L VEC_ASSERT_INFO))
#define | VEC_address(T, V) (VEC_OP(T,address)(V))
#define | VEC_lower_bound(T, V, O, LT) (VEC_OP(T,lower_bound)(V,O,LT VEC_ASSERT_INFO))
#define | vec_free_(V) xfree (V)
#define | VEC_ASSERT_INFO ,__FILE__,__LINE__
#define | VEC_ASSERT_DECL ,const char *file_,unsigned line_
#define | VEC_ASSERT_PASS ,file_,line_
#define | vec_assert(expr, op)
#define | VEC(T) VEC_##T
#define | VEC_OP(T, OP) VEC_##T##_##OP
#define | VEC_T(T)
#define | DEF_VEC_I(T)
#define | DEF_VEC_P(T)
#define | DEF_VEC_O(T)
#define | vec_offset(T, VPTR) ((size_t) ((char *) &(VPTR)->vec - (char *) VPTR))
#define | DEF_VEC_ALLOC_FUNC_I(T)
#define | DEF_VEC_FUNC_P(T)
#define | DEF_VEC_ALLOC_FUNC_P(T)
#define | DEF_VEC_FUNC_O(T)
#define | DEF_VEC_ALLOC_FUNC_O(T)

## Functions
void * | vec_p_reserve (void *, int)
void * | vec_o_reserve (void *, int, size_t, size_t)

## Macro Definition Documentation

## ◆ DEF_VEC_ALLOC_FUNC_I

#define DEF_VEC_ALLOC_FUNC_I | ( |  | T | ) |

Definition at line 473 of file vec.h.

## ◆ DEF_VEC_ALLOC_FUNC_O

#define DEF_VEC_ALLOC_FUNC_O | ( |  | T | ) |

Definition at line 1040 of file vec.h.

## ◆ DEF_VEC_ALLOC_FUNC_P

#define DEF_VEC_ALLOC_FUNC_P | ( |  | T | ) |

Definition at line 768 of file vec.h.

## ◆ DEF_VEC_FUNC_O

#define DEF_VEC_FUNC_O | ( |  | T | ) |

Definition at line 868 of file vec.h.

## ◆ DEF_VEC_FUNC_P

#define DEF_VEC_FUNC_P | ( |  | T | ) |

Definition at line 583 of file vec.h.

## ◆ DEF_VEC_I

#define DEF_VEC_I | ( |  | T | ) |

Value:
DIAGNOSTIC_PUSH \
DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION \
static inline void VEC_OP (T,must_be_integral_type) (void) \
{ \
(void)~(T)0; \
} \
\
VEC_T(T); \
DEF_VEC_FUNC_P(T) \
DEF_VEC_ALLOC_FUNC_I(T) \
DIAGNOSTIC_POP \
struct vec_swallow_trailing_semi
VEC_OP
#define VEC_OP(T, OP)
Definition: vec.h:415
VEC_T
#define VEC_T(T)
Definition: vec.h:417

Definition at line 426 of file vec.h.

## ◆ DEF_VEC_O

#define DEF_VEC_O | ( |  | T | ) |

Value:
DIAGNOSTIC_PUSH \
DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION \
VEC_T(T); \
DEF_VEC_FUNC_O(T) \
DEF_VEC_ALLOC_FUNC_O(T) \
DIAGNOSTIC_POP \
struct vec_swallow_trailing_semi
VEC_T
#define VEC_T(T)
Definition: vec.h:417

Definition at line 456 of file vec.h.

## ◆ DEF_VEC_P

#define DEF_VEC_P | ( |  | T | ) |

Value:
DIAGNOSTIC_PUSH \
DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION \
static inline void VEC_OP (T,must_be_pointer_type) (void) \
{ \
(void)((T)1 == (void *)1); \
} \
\
VEC_T(T); \
DEF_VEC_FUNC_P(T) \
DEF_VEC_ALLOC_FUNC_P(T) \
DIAGNOSTIC_POP \
struct vec_swallow_trailing_semi
VEC_OP
#define VEC_OP(T, OP)
Definition: vec.h:415
VEC_T
#define VEC_T(T)
Definition: vec.h:417

Definition at line 441 of file vec.h.

## ◆ DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION

#define DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION

Definition at line 36 of file vec.h.

## ◆ VEC

#define VEC | ( |  | T | ) | VEC_##T

Definition at line 414 of file vec.h.

Referenced by parse_debug_format_options(), and thread_db_load_search().

## ◆ VEC_address

#define VEC_address | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,address)(V))

Definition at line 385 of file vec.h.

## ◆ VEC_alloc

#define VEC_alloc | ( |  | T,
|  |  | N
| ) |  | (VEC_OP(T,alloc)(N))

Definition at line 189 of file vec.h.

## ◆ vec_assert

#define vec_assert | ( |  | expr,
|  |  | op
| ) |  |

Value:
((void)((expr) ? 0 : (gdb_assert_fail (op, file_, line_, \
FUNCTION_NAME), 0)))
gdb_assert_fail
#define gdb_assert_fail(assertion, file, line, function)
Definition: gdb_assert.h:43

Definition at line 410 of file vec.h.

## ◆ VEC_ASSERT_DECL

#define VEC_ASSERT_DECL ,const char *file_,unsigned line_

Definition at line 408 of file vec.h.

## ◆ VEC_ASSERT_INFO

#define VEC_ASSERT_INFO ,__FILE__,__LINE__

Definition at line 407 of file vec.h.

## ◆ VEC_ASSERT_PASS

#define VEC_ASSERT_PASS ,file_,line_

Definition at line 409 of file vec.h.

## ◆ VEC_block_remove

#define VEC_block_remove | ( |  | T,
|  |  | V,
|  |  | I,
|  |  | L
| ) |  | (VEC_OP(T,block_remove)(V,I,L VEC_ASSERT_INFO))

Definition at line 376 of file vec.h.

## ◆ VEC_cleanup

#define VEC_cleanup | ( |  | T | ) | (VEC_OP(T,cleanup))

Definition at line 203 of file vec.h.

## ◆ VEC_copy

#define VEC_copy | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,copy)(V))

Definition at line 222 of file vec.h.

## ◆ VEC_embedded_init

#define VEC_embedded_init | ( |  | T,
|  |  | O,
|  |  | N
| ) |  | (VEC_OP(T,embedded_init)(VEC_BASE(O),N))

Definition at line 214 of file vec.h.

## ◆ VEC_embedded_size

#define VEC_embedded_size | ( |  | T,
|  |  | N
| ) |  | (VEC_OP(T,embedded_size)(N))

Definition at line 213 of file vec.h.

## ◆ VEC_empty

#define VEC_empty | ( |  | T,
|  |  | V
| ) |  | (VEC_length (T,V) == 0)

Definition at line 148 of file vec.h.

Referenced by btrace_data_empty().

## ◆ VEC_free

#define VEC_free | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,free)(&V))

Definition at line 196 of file vec.h.

Referenced by btrace_data_fini(), free_char_ptr_vec(), and target_desc::~target_desc().

## ◆ vec_free_

#define vec_free_ | ( |  | V | ) | xfree (V)

Definition at line 405 of file vec.h.

## ◆ VEC_index

#define VEC_index | ( |  | T,
|  |  | V,
|  |  | I
| ) |  | (VEC_OP(T,index)(V,I VEC_ASSERT_INFO))

Definition at line 167 of file vec.h.

Referenced by btrace_data_append().

## ◆ VEC_iterate

#define VEC_iterate | ( |  | T,
|  |  | V,
|  |  | I,
|  |  | P
| ) |  | (VEC_OP(T,iterate)(V,I,&(P)))

Definition at line 181 of file vec.h.

Referenced by free_char_ptr_vec(), parse_debug_format_options(), tdesc_get_features_xml(), thread_db_load_search(), and target_desc::~target_desc().

## ◆ VEC_last

#define VEC_last | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,last)(V VEC_ASSERT_INFO))

Definition at line 158 of file vec.h.

## ◆ VEC_length

#define VEC_length | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,length)(V))

Definition at line 140 of file vec.h.

Referenced by btrace_data_append().

## ◆ VEC_lower_bound

#define VEC_lower_bound | ( |  | T,
|  |  | V,
|  |  | O,
|  |  | LT
| ) |  | (VEC_OP(T,lower_bound)(V,O,LT VEC_ASSERT_INFO))

Definition at line 399 of file vec.h.

## ◆ VEC_merge

#define VEC_merge | ( |  | T,
|  |  | V1,
|  |  | V2
| ) |  | (VEC_OP(T,merge)(V1, V2))

Definition at line 229 of file vec.h.

## ◆ vec_offset

#define vec_offset | ( |  | T,
|  |  | VPTR
| ) |  | ((size_t) ((char *) &(VPTR)->vec - (char *) VPTR))

Definition at line 471 of file vec.h.

Referenced by vec_o_reserve().

## ◆ VEC_OP

#define VEC_OP | ( |  | T,
|  |  | OP
| ) |  | VEC_##T##_##OP

Definition at line 415 of file vec.h.

## ◆ VEC_ordered_remove

#define VEC_ordered_remove | ( |  | T,
|  |  | V,
|  |  | I
| ) |  | (VEC_OP(T,ordered_remove)(V,I VEC_ASSERT_INFO))

Definition at line 355 of file vec.h.

## ◆ VEC_pop

#define VEC_pop | ( |  | T,
|  |  | V
| ) |  | (VEC_OP(T,pop)(V VEC_ASSERT_INFO))

Definition at line 286 of file vec.h.

## ◆ VEC_quick_insert

#define VEC_quick_insert | ( |  | T,
|  |  | V,
|  |  | I,
|  |  | O
| ) |  | (VEC_OP(T,quick_insert)(V,I,O VEC_ASSERT_INFO))

Definition at line 330 of file vec.h.

## ◆ VEC_quick_push

#define VEC_quick_push | ( |  | T,
|  |  | V,
|  |  | O
| ) |  | (VEC_OP(T,quick_push)(V,O VEC_ASSERT_INFO))

Definition at line 265 of file vec.h.

## ◆ VEC_replace

#define VEC_replace | ( |  | T,
|  |  | V,
|  |  | I,
|  |  | O
| ) |  | (VEC_OP(T,replace)(V,I,O VEC_ASSERT_INFO))

Definition at line 318 of file vec.h.

## ◆ VEC_reserve

#define VEC_reserve | ( |  | T,
|  |  | V,
|  |  | R
| ) |  | (VEC_OP(T,reserve)(&(V),R VEC_ASSERT_INFO))

Definition at line 253 of file vec.h.

## ◆ VEC_safe_grow

#define VEC_safe_grow | ( |  | T,
|  |  | V,
|  |  | I
| ) |  | (VEC_OP(T,safe_grow)(&(V),I VEC_ASSERT_INFO))

Definition at line 304 of file vec.h.

## ◆ VEC_safe_insert

#define VEC_safe_insert | ( |  | T,
|  |  | V,
|  |  | I,
|  |  | O
| ) |  | (VEC_OP(T,safe_insert)(&(V),I,O VEC_ASSERT_INFO))

Definition at line 343 of file vec.h.

## ◆ VEC_safe_push

#define VEC_safe_push | ( |  | T,
|  |  | V,
|  |  | O
| ) |  | (VEC_OP(T,safe_push)(&(V),O VEC_ASSERT_INFO))

Definition at line 276 of file vec.h.

Referenced by btrace_data_append(), delim_string_to_char_ptr_vec_append(), and tdesc_create_feature().

## ◆ VEC_space

#define VEC_space | ( |  | T,
|  |  | V,
|  |  | R
| ) |  | (VEC_OP(T,space)(V,R VEC_ASSERT_INFO))

Definition at line 241 of file vec.h.

## ◆ VEC_T

#define VEC_T | ( |  | T | ) |

Value:
typedef struct VEC(T) \
{ \
unsigned num; \
unsigned alloc; \
T vec[1]; \
} VEC(T)
VEC
#define VEC(T)
Definition: vec.h:414

Definition at line 417 of file vec.h.

## ◆ VEC_truncate

#define VEC_truncate | ( |  | T,
|  |  | V,
|  |  | I
| ) |  | (VEC_OP(T,truncate)(V,I VEC_ASSERT_INFO))

Definition at line 294 of file vec.h.

## ◆ VEC_unordered_remove

#define VEC_unordered_remove | ( |  | T,
|  |  | V,
|  |  | I
| ) |  | (VEC_OP(T,unordered_remove)(V,I VEC_ASSERT_INFO))

Definition at line 367 of file vec.h.

## Function Documentation

## ◆ vec_o_reserve()

void* vec_o_reserve | ( | void * | ,
|  | int | ,
|  | size_t | ,
|  | size_t |
| ) |  |

Definition at line 91 of file vec.c.

References vec_prefix::alloc, calculate_allocation(), vec_prefix::vec, vec_offset, and xrealloc().

Referenced by vec_p_reserve().

## ◆ vec_p_reserve()

void* vec_p_reserve | ( | void * | ,
|  | int |
| ) |  |

Definition at line 80 of file vec.c.

References vec_o_reserve().