2020-05-15 23:13:02 +01:00
|
|
|
// Copyright (c) Facebook, Inc. and its affiliates.
|
2019-07-25 08:47:13 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0+
|
|
|
|
|
2020-09-24 00:02:02 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
2019-07-25 08:47:13 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "symbol.h"
|
2020-09-24 00:02:02 +01:00
|
|
|
#include "util.h"
|
2019-07-25 08:47:13 +01:00
|
|
|
|
|
|
|
LIBDRGN_PUBLIC void drgn_symbol_destroy(struct drgn_symbol *sym)
|
|
|
|
{
|
|
|
|
free(sym);
|
|
|
|
}
|
|
|
|
|
|
|
|
LIBDRGN_PUBLIC const char *drgn_symbol_name(struct drgn_symbol *sym)
|
|
|
|
{
|
|
|
|
return sym->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
LIBDRGN_PUBLIC uint64_t drgn_symbol_address(struct drgn_symbol *sym)
|
|
|
|
{
|
|
|
|
return sym->address;
|
|
|
|
}
|
|
|
|
|
|
|
|
LIBDRGN_PUBLIC uint64_t drgn_symbol_size(struct drgn_symbol *sym)
|
|
|
|
{
|
|
|
|
return sym->size;
|
|
|
|
}
|
|
|
|
|
|
|
|
LIBDRGN_PUBLIC bool drgn_symbol_eq(struct drgn_symbol *a, struct drgn_symbol *b)
|
|
|
|
{
|
|
|
|
return (strcmp(a->name, b->name) == 0 && a->address == b->address &&
|
|
|
|
a->size == b->size);
|
|
|
|
}
|