/*
- * dwarf.c
- *
- * Babeltrace - DWARF Information Reader
+ * SPDX-License-Identifier: MIT
*
* Copyright 2015 Antoine Busque <abusque@efficios.com>
*
- * Author: Antoine Busque <abusque@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Babeltrace - DWARF Information Reader
*/
+#include <stdbool.h>
+
#include <glib.h>
+
#include "dwarf.h"
-BT_HIDDEN
struct bt_dwarf_cu *bt_dwarf_cu_create(Dwarf *dwarf_info)
{
struct bt_dwarf_cu *cu;
return NULL;
}
-BT_HIDDEN
void bt_dwarf_cu_destroy(struct bt_dwarf_cu *cu)
{
g_free(cu);
}
-BT_HIDDEN
int bt_dwarf_cu_next(struct bt_dwarf_cu *cu)
{
int ret;
}
ret = dwarf_nextcu(cu->dwarf_info, cu->next_offset, &next_offset,
- &cu_header_size, NULL, NULL, NULL);
+ &cu_header_size, NULL, NULL, NULL);
if (ret) {
/* ret is -1 on error, 1 if no next CU. */
goto end;
return ret;
}
-BT_HIDDEN
struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu)
{
Dwarf_Die *dwarf_die = NULL;
}
dwarf_die = dwarf_offdie(cu->dwarf_info, cu->offset + cu->header_size,
- dwarf_die);
+ dwarf_die);
if (!dwarf_die) {
goto error;
}
return NULL;
}
-BT_HIDDEN
void bt_dwarf_die_destroy(struct bt_dwarf_die *die)
{
if (!die) {
g_free(die);
}
-BT_HIDDEN
int bt_dwarf_die_has_children(struct bt_dwarf_die *die)
{
return dwarf_haschildren(die->dwarf_die);
}
-BT_HIDDEN
int bt_dwarf_die_child(struct bt_dwarf_die *die)
{
int ret;
return ret;
}
-BT_HIDDEN
int bt_dwarf_die_next(struct bt_dwarf_die *die)
{
int ret;
return ret;
}
-BT_HIDDEN
int bt_dwarf_die_get_tag(struct bt_dwarf_die *die, int *tag)
{
int _tag;
return -1;
}
-BT_HIDDEN
int bt_dwarf_die_get_name(struct bt_dwarf_die *die, char **name)
{
const char *_name;
return -1;
}
-BT_HIDDEN
int bt_dwarf_die_get_call_file(struct bt_dwarf_die *die, char **filename)
{
int ret;
return -1;
}
-BT_HIDDEN
int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die,
uint64_t *line_no)
{
return -1;
}
-BT_HIDDEN
int bt_dwarf_die_contains_addr(struct bt_dwarf_die *die, uint64_t addr,
bool *contains)
{