75 if (!sa->
file && !
sb->file) {
84 return strcmp(sa->
file,
sb->file);
93 if (initial_samples_count) {
106 for (
size_t i = 0;
i < initial_samples_count;
i++) {
111 r->samples_count = 0;
112 for (
size_t i = 0;
i < initial_samples_count;
i++) {
114 if (
r->samples_count) {
121 r->samples[
r->samples_count++] = *new_sample;
123 free(initial_samples);
156 #define CMP(x, y) (x > y.address ? 1 : (x < y.address ? -1 : 0))
169 if ((
r - 1)->address ==
r->address) {
188 if (next->
address != cur->address) {
196 if (!
bin->cur || !
bin->cur->o || !
bin->cur->o->lines) {
200 if (!
s ||
s->address !=
addr) {
219 if (!
bin->cur || !
bin->cur->o || !
bin->cur->o->lines) {
223 if (
s &&
s->address !=
addr) {
227 while (
s && !
s->file) {
233 const char *file_nopath;
235 file_nopath =
s->file;
237 file_nopath = strrchr(
s->file,
'/');
241 file_nopath =
s->file;
245 return strdup(file_nopath);
252 file_nopath,
s->line,
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API void rz_bin_source_line_info_free(RzBinSourceLineInfo *sli)
RZ_API const RzBinSourceLineSample * rz_bin_source_line_info_get_next(const RzBinSourceLineInfo *sli, RZ_NONNULL const RzBinSourceLineSample *cur)
RZ_DEPRECATE RZ_API bool rz_bin_addr2line(RzBin *bin, ut64 addr, char *file, int len, int *line)
static int line_sample_cmp(const void *a, const void *b)
RZ_API void rz_bin_source_line_info_builder_init(RzBinSourceLineInfoBuilder *builder)
RZ_API void rz_bin_source_line_info_builder_fini(RzBinSourceLineInfoBuilder *builder)
RZ_API RzBinSourceLineInfo * rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder)
RZ_API const RzBinSourceLineSample * rz_bin_source_line_info_get_first_at(const RzBinSourceLineInfo *sli, ut64 addr)
Find the first sample that affects the given address. i.e. find the first sample with the highest add...
RZ_DEPRECATE RZ_API char * rz_bin_addr2text(RzBin *bin, ut64 addr, int origin)
RZ_API void rz_bin_source_line_info_builder_push_sample(RzBinSourceLineInfoBuilder *builder, ut64 address, ut32 line, ut32 column, const char *file)
Push a new sample into the builder.
RZ_API void Ht_() free(HtName_(Ht) *ht)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_return_val_if_fail(expr, val)
static bool rz_bin_source_line_sample_is_closing(const RzBinSourceLineSample *s)
RZ_API bool RZ_API char * rz_file_slurp_line(const char *file, int line, int context)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API size_t rz_str_ncpy(char *dst, const char *src, size_t n)
Secure string copy with null terminator.
RZ_API void rz_str_trim(RZ_NONNULL RZ_INOUT char *str)
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
RZ_API const char * rz_str_constpool_get(RzStrConstPool *pool, const char *str)
RZ_API void rz_str_constpool_fini(RzStrConstPool *pool)
RZ_API bool rz_str_constpool_init(RzStrConstPool *pool)
static void ** rz_pvector_reserve(RzPVector *vec, size_t capacity)
RZ_API void rz_pvector_sort(RzPVector *vec, RzPVectorComparator cmp)
RZ_API void * rz_vector_flush(RzVector *vec)
Turn the vector into a fixed-size array. This will clear the vector and return an array of its origin...
RZ_API void rz_pvector_init(RzPVector *vec, RzPVectorFree free)
RZ_API void rz_pvector_fini(RzPVector *vec)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
#define rz_array_upper_bound(array, len, x, i, cmp)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_vector_fini(RzVector *vec)
static size_t rz_vector_len(const RzVector *vec)
RZ_API void rz_vector_init(RzVector *vec, size_t elem_size, RzVectorFree free, void *free_user)
static void * rz_pvector_at(const RzPVector *vec, size_t index)
RzStrConstPool filename_pool
RzStrConstPool filename_pool
RzBinSourceLineSample * samples
All source line references for given adresses.
A single sample of source line info for a specific address.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()