const char *target_prefix, bt_logging_level log_level,
bt_self_component *self_comp)
{
- struct bin_info *bin = NULL;
+ struct bin_info *bin = nullptr;
BT_ASSERT(fdc);
bin->log_level = log_level;
bin->self_comp = self_comp;
if (target_prefix) {
- bin->elf_path = g_build_filename(target_prefix, path, NULL);
+ bin->elf_path = g_build_filename(target_prefix, path, nullptr);
} else {
bin->elf_path = g_strdup(path);
}
bin->memsz = memsz;
bin->low_addr = low_addr;
bin->high_addr = bin->low_addr + bin->memsz;
- bin->build_id = NULL;
+ bin->build_id = nullptr;
bin->build_id_len = 0;
bin->file_build_id_matches = false;
bin->fd_cache = fdc;
error:
bin_info_destroy(bin);
- return NULL;
+ return nullptr;
}
void bin_info_destroy(struct bin_info *bin)
*/
static int bin_info_set_elf_file(struct bin_info *bin)
{
- struct bt_fd_cache_handle *elf_handle = NULL;
- Elf *elf_file = NULL;
+ struct bt_fd_cache_handle *elf_handle = nullptr;
+ Elf *elf_file = nullptr;
int ret;
BT_ASSERT(bin);
}
bin->elf_handle = elf_handle;
- elf_file = elf_begin(bt_fd_cache_handle_get_fd(bin->elf_handle), ELF_C_READ, NULL);
+ elf_file = elf_begin(bt_fd_cache_handle_get_fd(bin->elf_handle), ELF_C_READ, nullptr);
if (!elf_file) {
BT_COMP_LOGE_APPEND_CAUSE(bin->self_comp, "elf_begin failed: %s", elf_errmsg(-1));
goto error;
static int is_build_id_matching(struct bin_info *bin)
{
int ret, is_build_id, is_matching = 0;
- Elf_Scn *curr_section = NULL, *next_section = NULL;
+ Elf_Scn *curr_section = nullptr, *next_section = nullptr;
GElf_Shdr curr_section_hdr;
if (!bin->build_id) {
}
while (next_section) {
- Elf_Data *note_data = NULL;
+ Elf_Data *note_data = nullptr;
curr_section = next_section;
next_section = elf_nextscn(bin->elf_file, curr_section);
/*
* elf_getdata() translates the data to native byte order.
*/
- note_data = elf_getdata(curr_section, NULL);
+ note_data = elf_getdata(curr_section, nullptr);
if (!note_data) {
goto error;
}
static int bin_info_set_dwarf_info_from_path(struct bin_info *bin, char *path)
{
int ret = 0;
- struct bt_fd_cache_handle *dwarf_handle = NULL;
- struct bt_dwarf_cu *cu = NULL;
- Dwarf *dwarf_info = NULL;
+ struct bt_fd_cache_handle *dwarf_handle = nullptr;
+ struct bt_dwarf_cu *cu = nullptr;
+ Dwarf *dwarf_info = nullptr;
if (!bin || !path) {
goto error;
static int bin_info_set_dwarf_info_build_id(struct bin_info *bin)
{
int i = 0, ret = 0;
- char *path = NULL, *build_id_prefix_dir = NULL, *build_id_file = NULL;
- const char *dbg_dir = NULL;
+ char *path = nullptr, *build_id_prefix_dir = nullptr, *build_id_file = nullptr;
+ const char *dbg_dir = nullptr;
size_t build_id_char_len, build_id_suffix_char_len, build_id_file_len;
if (!bin || !bin->build_id) {
/* Append the suffix to the generated string, including the '\0'. */
g_snprintf(&build_id_file[build_id_char_len], build_id_suffix_char_len, BUILD_ID_SUFFIX);
- path = g_build_filename(dbg_dir, BUILD_ID_SUBDIR, build_id_prefix_dir, build_id_file, NULL);
+ path = g_build_filename(dbg_dir, BUILD_ID_SUBDIR, build_id_prefix_dir, build_id_file, nullptr);
if (!path) {
goto error;
}
static int is_valid_debug_file(struct bin_info *bin, char *path, uint32_t crc)
{
int ret = 0;
- struct bt_fd_cache_handle *debug_handle = NULL;
+ struct bt_fd_cache_handle *debug_handle = nullptr;
uint32_t _crc = 0;
if (!path) {
static int bin_info_set_dwarf_info_debug_link(struct bin_info *bin)
{
int ret = 0;
- const gchar *dbg_dir = NULL;
- gchar *bin_dir = NULL, *path = NULL;
+ const gchar *dbg_dir = nullptr;
+ gchar *bin_dir = nullptr, *path = nullptr;
if (!bin || !bin->dbg_link_filename) {
goto error;
bin_dir = g_path_get_dirname(bin->elf_path);
/* First look in the executable's dir */
- path = g_build_filename(bin_dir, bin->dbg_link_filename, NULL);
+ path = g_build_filename(bin_dir, bin->dbg_link_filename, nullptr);
if (is_valid_debug_file(bin, path, bin->dbg_link_crc)) {
goto found;
/* If not found, look in .debug subdir */
g_free(path);
- path = g_build_filename(bin_dir, DEBUG_SUBDIR, bin->dbg_link_filename, NULL);
+ path = g_build_filename(bin_dir, DEBUG_SUBDIR, bin->dbg_link_filename, nullptr);
if (is_valid_debug_file(bin, path, bin->dbg_link_crc)) {
goto found;
/* Lastly, look under the global debug directory */
g_free(path);
- path = g_build_filename(dbg_dir, bin_dir, bin->dbg_link_filename, NULL);
+ path = g_build_filename(dbg_dir, bin_dir, bin->dbg_link_filename, nullptr);
if (is_valid_debug_file(bin, path, bin->dbg_link_crc)) {
goto found;
}
char **result)
{
uint64_t offset;
- char *_result = NULL;
+ char *_result = nullptr;
if (!base_str || !result) {
goto error;
{
int i;
size_t symbol_count;
- Elf_Data *data = NULL;
- GElf_Shdr *_shdr = NULL;
- GElf_Sym *nearest_sym = NULL;
+ Elf_Data *data = nullptr;
+ GElf_Shdr *_shdr = nullptr;
+ GElf_Sym *nearest_sym = nullptr;
if (!scn || !sym || !shdr) {
goto error;
goto end;
}
- data = elf_getdata(scn, NULL);
+ data = elf_getdata(scn, nullptr);
if (!data) {
goto error;
}
symbol_count = _shdr->sh_size / _shdr->sh_entsize;
for (i = 0; i < symbol_count; ++i) {
- GElf_Sym *cur_sym = NULL;
+ GElf_Sym *cur_sym = nullptr;
cur_sym = g_new0(GElf_Sym, 1);
if (!cur_sym) {
* first iteration to prevent subsequent ones.
*/
int ret = 0;
- Elf_Scn *scn = NULL;
- GElf_Sym *sym = NULL;
- GElf_Shdr *shdr = NULL;
- char *sym_name = NULL;
+ Elf_Scn *scn = nullptr;
+ GElf_Sym *sym = nullptr;
+ GElf_Shdr *shdr = nullptr;
+ char *sym_name = nullptr;
/* Set ELF file if it hasn't been accessed yet. */
if (!bin->elf_file) {
{
int ret = 0;
bool found = false;
- struct bt_dwarf_die *die = NULL;
+ struct bt_dwarf_die *die = nullptr;
if (!cu || !func_name) {
goto error;
if (found) {
uint64_t low_addr = 0;
- char *die_name = NULL;
+ char *die_name = nullptr;
ret = bt_dwarf_die_get_name(die, &die_name);
if (ret) {
char **func_name)
{
int ret = 0;
- char *_func_name = NULL;
- struct bt_dwarf_cu *cu = NULL;
+ char *_func_name = nullptr;
+ struct bt_dwarf_cu *cu = nullptr;
if (!bin || !func_name) {
goto error;
int bin_info_lookup_function_name(struct bin_info *bin, uint64_t addr, char **func_name)
{
int ret = 0;
- char *_func_name = NULL;
+ char *_func_name = nullptr;
if (!bin || !func_name) {
goto error;
int bin_info_get_bin_loc(struct bin_info *bin, uint64_t addr, char **bin_loc)
{
- gchar *_bin_loc = NULL;
+ gchar *_bin_loc = nullptr;
if (!bin || !bin_loc) {
goto error;
{
int ret = 0;
bool found = false;
- struct bt_dwarf_die *die = NULL;
- struct source_location *_src_loc = NULL;
+ struct bt_dwarf_die *die = nullptr;
+ struct source_location *_src_loc = nullptr;
if (!cu || !src_loc) {
goto error;
end:
if (found) {
- char *filename = NULL;
+ char *filename = nullptr;
uint64_t line_no;
_src_loc = g_new0(struct source_location, 1);
static int bin_info_lookup_cu_src_loc_no_inl(struct bt_dwarf_cu *cu, uint64_t addr,
struct source_location **src_loc)
{
- struct source_location *_src_loc = NULL;
- struct bt_dwarf_die *die = NULL;
- const char *filename = NULL;
- Dwarf_Line *line = NULL;
+ struct source_location *_src_loc = nullptr;
+ struct bt_dwarf_die *die = nullptr;
+ const char *filename = nullptr;
+ Dwarf_Line *line = nullptr;
Dwarf_Addr line_addr;
int ret = 0, line_no;
goto error;
}
- filename = dwarf_linesrc(line, NULL, NULL);
+ filename = dwarf_linesrc(line, nullptr, nullptr);
if (!filename) {
goto error;
}
struct source_location **src_loc)
{
int ret = 0;
- struct source_location *_src_loc = NULL;
+ struct source_location *_src_loc = nullptr;
if (!cu || !src_loc) {
goto error;
int bin_info_lookup_source_location(struct bin_info *bin, uint64_t addr,
struct source_location **src_loc)
{
- struct bt_dwarf_cu *cu = NULL;
- struct source_location *_src_loc = NULL;
+ struct bt_dwarf_cu *cu = nullptr;
+ struct source_location *_src_loc = nullptr;
if (!bin || !src_loc) {
goto error;
{
bt_logging_level log_level;
- /* Used for logging; can be `NULL` */
+ /* Used for logging; can be `nullptr` */
bt_self_component *self_comp;
/* Base virtual memory address. */
* @param target_prefix Path to the root file system of the target
* or NULL.
* @returns Pointer to the new bin_info on success,
- * NULL on failure.
+ * `nullptr` on failure.
*/
struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path, uint64_t low_addr,
uint64_t memsz, bool is_pic, const char *debug_info_dir,
debug_info_source_create_from_bin(struct bin_info *bin, uint64_t ip, bt_self_component *self_comp)
{
int ret;
- struct debug_info_source *debug_info_src = NULL;
- struct source_location *src_loc = NULL;
+ struct debug_info_source *debug_info_src = nullptr;
+ struct source_location *src_loc = nullptr;
bt_logging_level log_level;
BT_ASSERT(bin);
error:
debug_info_source_destroy(debug_info_src);
- return NULL;
+ return nullptr;
}
static void proc_debug_info_sources_destroy(struct proc_debug_info_sources *proc_dbg_info_src)
static struct proc_debug_info_sources *proc_debug_info_sources_create(void)
{
- struct proc_debug_info_sources *proc_dbg_info_src = NULL;
+ struct proc_debug_info_sources *proc_dbg_info_src = nullptr;
proc_dbg_info_src = g_new0(struct proc_debug_info_sources, 1);
if (!proc_dbg_info_src) {
error:
proc_debug_info_sources_destroy(proc_dbg_info_src);
- return NULL;
+ return nullptr;
}
static struct proc_debug_info_sources *proc_debug_info_sources_ht_get_entry(GHashTable *ht,
int64_t vpid)
{
gpointer key = g_new0(int64_t, 1);
- struct proc_debug_info_sources *proc_dbg_info_src = NULL;
+ struct proc_debug_info_sources *proc_dbg_info_src = nullptr;
if (!key) {
goto end;
g_hash_table_insert(ht, key, proc_dbg_info_src);
/* Ownership passed to ht */
- key = NULL;
+ key = nullptr;
end:
g_free(key);
return proc_dbg_info_src;
static inline const bt_field *event_borrow_common_context_field(const bt_event *event,
const char *field_name)
{
- const bt_field *event_common_ctx, *field = NULL;
+ const bt_field *event_common_ctx, *field = nullptr;
event_common_ctx = bt_event_borrow_common_context_field_const(event);
if (!event_common_ctx) {
proc_debug_info_sources_get_entry(struct debug_info *debug_info,
struct proc_debug_info_sources *proc_dbg_info_src, uint64_t ip)
{
- struct debug_info_source *debug_info_src = NULL;
+ struct debug_info_source *debug_info_src = nullptr;
gpointer key = g_new0(uint64_t, 1);
GHashTableIter iter;
gpointer baddr, value;
if (debug_info_src) {
g_hash_table_insert(proc_dbg_info_src->ip_to_debug_info_src, key, debug_info_src);
/* Ownership passed to ht. */
- key = NULL;
+ key = nullptr;
}
break;
}
static struct debug_info_source *debug_info_query(struct debug_info *debug_info, int64_t vpid,
uint64_t ip)
{
- struct debug_info_source *dbg_info_src = NULL;
+ struct debug_info_source *dbg_info_src = nullptr;
struct proc_debug_info_sources *proc_dbg_info_src;
proc_dbg_info_src =
return debug_info;
error:
g_free(debug_info);
- return NULL;
+ return nullptr;
}
static void debug_info_destroy(struct debug_info *debug_info)
{
struct proc_debug_info_sources *proc_dbg_info_src;
uint64_t build_id_len, baddr;
- uint8_t *build_id = NULL;
+ uint8_t *build_id = nullptr;
struct bin_info *bin;
int64_t vpid;
int ret = 0;
static void handle_event_statedump_debug_link(struct debug_info *debug_info, const bt_event *event)
{
struct proc_debug_info_sources *proc_dbg_info_src;
- struct bin_info *bin = NULL;
+ struct bin_info *bin = nullptr;
int64_t vpid;
uint64_t baddr;
- const char *filename = NULL;
+ const char *filename = nullptr;
uint32_t crc32;
uint64_t crc_field_value;
uint64_t baddr, memsz;
int64_t vpid;
const char *path;
- gpointer key = NULL;
+ gpointer key = nullptr;
bool is_pic;
event_get_payload_unsigned_integer_field_value(event, MEMSZ_FIELD_NAME, &memsz);
g_hash_table_insert(proc_dbg_info_src->baddr_to_bin_info, key, bin);
/* Ownership passed to ht. */
- key = NULL;
+ key = nullptr;
end:
g_free(key);
const bt_stream *in_stream;
const bt_stream *out_stream;
bt_event_class *out_event_class;
- bt_packet *out_packet = NULL;
+ bt_packet *out_packet = nullptr;
bt_event *out_event;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
/* Borrow the input event and its event class. */
const bt_event *in_event = bt_message_event_borrow_event_const(in_message);
/* Create a duplicated output stream. */
out_stream = trace_ir_mapping_create_new_mapped_stream(debug_it->ir_maps, in_stream);
if (!out_stream) {
- out_message = NULL;
+ out_message = nullptr;
goto error;
}
const bt_message *in_message)
{
const bt_stream *in_stream;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
bt_stream *out_stream;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
{
bool has_default_clock_snapshot;
const bt_clock_snapshot *cs;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
bt_packet *out_packet;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
bool has_default_clock_snapshot;
const bt_clock_snapshot *cs;
const bt_packet *in_packet;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
bt_packet *out_packet;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
bool has_default_clock_snapshots;
uint64_t discarded_events, begin_cs_value, end_cs_value;
bt_property_availability prop_avail;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
bt_stream *out_stream;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
const bt_stream *in_stream;
uint64_t discarded_packets, begin_cs_value, end_cs_value;
bt_property_availability prop_avail;
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
bt_stream *out_stream;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
static const bt_message *handle_message(struct debug_info_msg_iter *debug_it,
const bt_message *in_message)
{
- bt_message *out_message = NULL;
+ bt_message *out_message = nullptr;
switch (bt_message_get_type(in_message)) {
case BT_MESSAGE_TYPE_EVENT:
bt_component_class_initialize_method_status status;
bt_logging_level log_level = debug_info_component->log_level;
enum bt_param_validation_status validation_status;
- gchar *validate_error = NULL;
+ gchar *validate_error = nullptr;
validation_status = bt_param_validation_validate(params, debug_info_params, &validate_error);
if (validation_status == BT_PARAM_VALIDATION_STATUS_MEMORY_ERROR) {
if (value) {
debug_info_component->arg_debug_dir = g_strdup(bt_value_string_get(value));
} else {
- debug_info_component->arg_debug_dir = NULL;
+ debug_info_component->arg_debug_dir = nullptr;
}
value = bt_value_map_borrow_entry_value_const(params, "target-prefix");
if (value) {
debug_info_component->arg_target_prefix = g_strdup(bt_value_string_get(value));
} else {
- debug_info_component->arg_target_prefix = NULL;
+ debug_info_component->arg_target_prefix = nullptr;
}
value = bt_value_map_borrow_entry_value_const(params, "full-path");
debug_info_comp->self_comp_filter = self_comp_flt;
bt_self_component_set_data(self_comp, debug_info_comp);
- add_port_status = bt_self_component_filter_add_input_port(self_comp_flt, "in", NULL, NULL);
+ add_port_status =
+ bt_self_component_filter_add_input_port(self_comp_flt, "in", nullptr, nullptr);
if (add_port_status != BT_SELF_COMPONENT_ADD_PORT_STATUS_OK) {
status = static_cast<bt_component_class_initialize_method_status>(add_port_status);
goto error;
}
- add_port_status = bt_self_component_filter_add_output_port(self_comp_flt, "out", NULL, NULL);
+ add_port_status =
+ bt_self_component_filter_add_output_port(self_comp_flt, "out", nullptr, nullptr);
if (add_port_status != BT_SELF_COMPONENT_ADD_PORT_STATUS_OK) {
status = static_cast<bt_component_class_initialize_method_status>(add_port_status);
goto error;
error:
destroy_debug_info_comp(debug_info_comp);
- bt_self_component_set_data(self_comp, NULL);
+ bt_self_component_set_data(self_comp, nullptr);
if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) {
status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR;
debug_info_msg_iter_next(bt_self_message_iterator *self_msg_iter, const bt_message_array_const msgs,
uint64_t capacity, uint64_t *count)
{
- bt_message_iterator *upstream_iterator = NULL;
+ bt_message_iterator *upstream_iterator = nullptr;
bt_message_iterator_next_status upstream_iterator_ret_status;
struct debug_info_msg_iter *debug_info_msg_iter;
- struct debug_info_component *debug_info = NULL;
+ struct debug_info_component *debug_info = nullptr;
bt_message_iterator_class_next_method_status status;
- bt_self_component *self_comp = NULL;
+ bt_self_component *self_comp = nullptr;
bt_message_array_const input_msgs;
const bt_message *out_message;
uint64_t curr_msg_idx, i;
{
bt_message_iterator_class_initialize_method_status status;
bt_message_iterator_create_from_message_iterator_status msg_iter_status;
- struct bt_self_component_port_input *input_port = NULL;
- bt_message_iterator *upstream_iterator = NULL;
- struct debug_info_msg_iter *debug_info_msg_iter = NULL;
+ struct bt_self_component_port_input *input_port = nullptr;
+ bt_message_iterator *upstream_iterator = nullptr;
+ struct debug_info_msg_iter *debug_info_msg_iter = nullptr;
gchar *debug_info_field_name;
int ret;
bt_self_component *self_comp = bt_self_message_iterator_borrow_component(self_msg_iter);
BT_MESSAGE_ITERATOR_MOVE_REF(debug_info_msg_iter->msg_iter, upstream_iterator);
/* Create hashtable that will contain debug info mapping. */
- debug_info_msg_iter->debug_info_map = g_hash_table_new_full(
- g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, (GDestroyNotify) debug_info_destroy);
+ debug_info_msg_iter->debug_info_map =
+ g_hash_table_new_full(g_direct_hash, g_direct_equal, (GDestroyNotify) nullptr,
+ (GDestroyNotify) debug_info_destroy);
if (!debug_info_msg_iter->debug_info_map) {
status = BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
goto error;
return cu;
error:
- return NULL;
+ return nullptr;
}
void bt_dwarf_cu_destroy(struct bt_dwarf_cu *cu)
goto end;
}
- ret = dwarf_nextcu(cu->dwarf_info, cu->next_offset, &next_offset, &cu_header_size, NULL, NULL,
- NULL);
+ ret = dwarf_nextcu(cu->dwarf_info, cu->next_offset, &next_offset, &cu_header_size, nullptr,
+ nullptr, nullptr);
if (ret) {
/* ret is -1 on error, 1 if no next CU. */
goto end;
struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu)
{
- Dwarf_Die *dwarf_die = NULL;
- struct bt_dwarf_die *die = NULL;
+ Dwarf_Die *dwarf_die = nullptr;
+ struct bt_dwarf_die *die = nullptr;
if (!cu) {
goto error;
error:
g_free(dwarf_die);
g_free(die);
- return NULL;
+ return nullptr;
}
void bt_dwarf_die_destroy(struct bt_dwarf_die *die)
int bt_dwarf_die_child(struct bt_dwarf_die *die)
{
int ret;
- Dwarf_Die *child_die = NULL;
+ Dwarf_Die *child_die = nullptr;
if (!die) {
ret = -1;
int bt_dwarf_die_next(struct bt_dwarf_die *die)
{
int ret;
- Dwarf_Die *next_die = NULL;
+ Dwarf_Die *next_die = nullptr;
if (!die) {
ret = -1;
{
int ret;
Dwarf_Sword file_no;
- const char *_filename = NULL;
- Dwarf_Files *src_files = NULL;
- Dwarf_Attribute *file_attr = NULL;
- struct bt_dwarf_die *cu_die = NULL;
+ const char *_filename = nullptr;
+ Dwarf_Files *src_files = nullptr;
+ Dwarf_Attribute *file_attr = nullptr;
+ struct bt_dwarf_die *cu_die = nullptr;
if (!die || !filename) {
goto error;
goto error;
}
- ret = dwarf_getsrcfiles(cu_die->dwarf_die, &src_files, NULL);
+ ret = dwarf_getsrcfiles(cu_die->dwarf_die, &src_files, nullptr);
if (ret) {
goto error;
}
- _filename = dwarf_filesrc(src_files, file_no, NULL, NULL);
+ _filename = dwarf_filesrc(src_files, file_no, nullptr, nullptr);
if (!_filename) {
goto error;
}
int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die, uint64_t *line_no)
{
int ret = 0;
- Dwarf_Attribute *line_attr = NULL;
+ Dwarf_Attribute *line_attr = nullptr;
uint64_t _line_no;
if (!die || !line_no) {
*
* @param dwarf_info Dwarf instance
* @returns Pointer to the new bt_dwarf_cu on success,
- * NULL on failure.
+ * `nullptr` on failure.
*/
struct bt_dwarf_cu *bt_dwarf_cu_create(Dwarf *dwarf_info);
*
* @param cu bt_dwarf_cu instance
* @returns Pointer to the new bt_dwarf_die on success,
- * NULL on failure.
+ * `nullptr` on failure.
*/
struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu);
env_field_count = bt_trace_get_environment_entry_count(in_trace);
for (i = 0; i < env_field_count; i++) {
const char *value_name;
- const bt_value *value = NULL;
+ const bt_value *value = nullptr;
bt_trace_set_environment_entry_status set_env_status;
bt_trace_borrow_environment_entry_by_index_const(in_trace, i, &value_name, &value);
metadata_maps->output_trace_class = create_new_mapped_trace_class(ir_maps, in_trace_class);
if (!metadata_maps->output_trace_class) {
BT_COMP_LOGE_APPEND_CAUSE(self_comp, "Error create output trace class");
- out_trace = NULL;
+ out_trace = nullptr;
goto end;
}
}
goto end;
error:
- out_stream_class = NULL;
+ out_stream_class = nullptr;
end:
return out_stream_class;
}
const bt_stream_class *in_stream_class;
const bt_trace *in_trace;
bt_stream_class *out_stream_class;
- bt_stream *out_stream = NULL;
+ bt_stream *out_stream = nullptr;
BT_ASSERT(ir_maps);
BT_ASSERT(in_stream);
goto end;
error:
- out_stream = NULL;
+ out_stream = nullptr;
end:
return out_stream;
}
goto end;
error:
- out_event_class = NULL;
+ out_event_class = nullptr;
end:
return out_event_class;
}
goto end;
error:
- out_packet = NULL;
+ out_packet = nullptr;
end:
return out_packet;
}
d_maps->input_trace = in_trace;
/* Create the hashtables used to map data objects. */
- d_maps->stream_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ d_maps->stream_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_stream_put_ref);
- d_maps->packet_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ d_maps->packet_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_packet_put_ref);
add_listener_status = bt_trace_add_destruction_listener(
}
/* Create the hashtables used to map metadata objects. */
- md_maps->stream_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ md_maps->stream_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_stream_class_put_ref);
- md_maps->event_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ md_maps->event_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_event_class_put_ref);
- md_maps->field_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ md_maps->field_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_field_class_put_ref);
- md_maps->clock_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
+ md_maps->clock_class_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, nullptr,
(GDestroyNotify) bt_clock_class_put_ref);
add_listener_status =
if (maps->data_maps) {
g_hash_table_destroy(maps->data_maps);
- maps->data_maps = NULL;
+ maps->data_maps = nullptr;
}
if (maps->metadata_maps) {
g_hash_table_destroy(maps->metadata_maps);
- maps->metadata_maps = NULL;
+ maps->metadata_maps = nullptr;
}
g_free(maps);
ir_maps->self_comp = self_comp;
- ir_maps->data_maps = g_hash_table_new_full(g_direct_hash, g_direct_equal, (GDestroyNotify) NULL,
- (GDestroyNotify) trace_ir_data_maps_destroy);
+ ir_maps->data_maps =
+ g_hash_table_new_full(g_direct_hash, g_direct_equal, (GDestroyNotify) nullptr,
+ (GDestroyNotify) trace_ir_data_maps_destroy);
ir_maps->metadata_maps =
- g_hash_table_new_full(g_direct_hash, g_direct_equal, (GDestroyNotify) NULL,
+ g_hash_table_new_full(g_direct_hash, g_direct_equal, (GDestroyNotify) nullptr,
(GDestroyNotify) trace_ir_metadata_maps_destroy);
goto end;
error:
trace_ir_maps_destroy(ir_maps);
- ir_maps = NULL;
+ ir_maps = nullptr;
end:
return ir_maps;
}
const bt_field_class *in_field_class, bt_field_class *out_field_class)
{
enum debug_info_trace_ir_mapping_status status;
- bt_field_class *debug_field_class = NULL, *bin_field_class = NULL, *func_field_class = NULL,
- *src_field_class = NULL;
+ bt_field_class *debug_field_class = nullptr, *bin_field_class = nullptr,
+ *func_field_class = nullptr, *src_field_class = nullptr;
bt_logging_level log_level = md_maps->log_level;
bt_self_component *self_comp = md_maps->self_comp;
{
bt_self_component *self_comp = md_maps->self_comp;
enum debug_info_trace_ir_mapping_status status;
- bt_field_class *out_tag_field_class = NULL;
+ bt_field_class *out_tag_field_class = nullptr;
uint64_t i, variant_option_count;
bt_field_class_type fc_type = bt_field_class_get_type(in_field_class);
{
bt_self_component *self_comp = md_maps->self_comp;
enum debug_info_trace_ir_mapping_status status;
- bt_field_class *out_field_class = NULL;
+ bt_field_class *out_field_class = nullptr;
bt_field_class_type fc_type = bt_field_class_get_type(in_field_class);
BT_COMP_LOGD("Creating bare field class based on field class: in-fc-addr=%p", in_field_class);
bt_field_class *out_elem_fc = copy_field_class_array_element(md_maps, in_elem_fc);
if (!out_elem_fc) {
- out_field_class = NULL;
+ out_field_class = nullptr;
goto error;
}
bt_field_class *out_elem_fc = copy_field_class_array_element(md_maps, in_elem_fc);
if (!out_elem_fc) {
- out_field_class = NULL;
+ out_field_class = nullptr;
goto error;
}
}
}
} else if (bt_field_class_type_is(fc_type, BT_FIELD_CLASS_TYPE_VARIANT)) {
- bt_field_class *out_sel_fc = NULL;
+ bt_field_class *out_sel_fc = nullptr;
if (bt_field_class_type_is(fc_type, BT_FIELD_CLASS_TYPE_VARIANT_WITH_SELECTOR_FIELD)) {
const bt_field_class *in_sel_fc;