Merge pull request #7 from coldtobi/fix_arm_compile_issues

Fix arm compile issues
This commit is contained in:
sstefani 2022-06-10 14:48:40 +02:00 committed by GitHub
commit a6feaf045a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View File

@ -58,6 +58,7 @@
#define DWARF_EINVAL 4 /* unsupported operation or bad value */ #define DWARF_EINVAL 4 /* unsupported operation or bad value */
#define DWARF_EBADVERSION 5 /* unwind info has unsupported version */ #define DWARF_EBADVERSION 5 /* unwind info has unsupported version */
#define DWARF_ENOINFO 6 /* no unwind info found */ #define DWARF_ENOINFO 6 /* no unwind info found */
#define DWARF_STOPUNWIND 7
struct dwarf_cie_info { struct dwarf_cie_info {
arch_addr_t start_ip; /* first IP covered by this procedure */ arch_addr_t start_ip; /* first IP covered by this procedure */

View File

@ -47,6 +47,7 @@
int is_64bit(struct mt_elf *mte) int is_64bit(struct mt_elf *mte)
{ {
(void)(mte);
return 0; return 0;
} }
@ -690,7 +691,7 @@ int do_singlestep(struct task *task, struct breakpoint *bp)
bp1 = breakpoint_find(task, next_pcs[0]); bp1 = breakpoint_find(task, next_pcs[0]);
if (!bp1) { if (!bp1) {
bp1 = breakpoint_new(task, next_pcs[0], NULL, SW_BP); bp1 = breakpoint_new(task, next_pcs[0], NULL, BP_SW);
if (!bp1) if (!bp1)
return -1; return -1;
} }
@ -702,7 +703,7 @@ int do_singlestep(struct task *task, struct breakpoint *bp)
if (next_pcs[1]) { if (next_pcs[1]) {
bp2 = breakpoint_find(task, next_pcs[1]); bp2 = breakpoint_find(task, next_pcs[1]);
if (!bp2) { if (!bp2) {
bp2 = breakpoint_new(task, next_pcs[1], NULL, SW_BP); bp2 = breakpoint_new(task, next_pcs[1], NULL, BP_SW);
if (!bp2) if (!bp2)
return -1; return -1;
} }

View File

@ -32,7 +32,7 @@
#include "common.h" #include "common.h"
#include "backend.h" #include "backend.h"
#include "debug.h" #include "debug.h"
#include "dwarf.h" #include "../../../dwarf.h"
#include "library.h" #include "library.h"
#include "task.h" #include "task.h"
@ -153,6 +153,7 @@ static int is_signal_frame(struct dwarf_cursor *c)
int dwarf_arch_map_reg(struct dwarf_addr_space *as, unsigned int reg) int dwarf_arch_map_reg(struct dwarf_addr_space *as, unsigned int reg)
{ {
(void)(as);
if (reg >= ARRAY_SIZE(dwarf_to_regnum_map)) if (reg >= ARRAY_SIZE(dwarf_to_regnum_map))
return -DWARF_EBADREG; return -DWARF_EBADREG;
@ -177,11 +178,13 @@ static inline int access_mem(struct dwarf_addr_space *as, arch_addr_t addr, void
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref; struct libref *libref = c->libref;
if (addr < ARCH_ADDR_T(libref->image_addr)) if (addr < ARCH_ADDR_T(libref->mmap_addr))
fatal("invalid access mem: addr %#lx < %p", addr, libref->image_addr); fatal("invalid access mem: addr %#lx < %p", addr, libref->mmap_addr);
if (addr >= ARCH_ADDR_T(libref->image_addr + libref->load_size)) if (addr >= ARCH_ADDR_T(libref->mmap_addr + libref->mmap_size))
fatal("invalid access mem: addr %#lx >= %p", addr, libref->image_addr + libref->load_size); fatal("invalid access mem: addr %#lx >= %p", addr, libref->mmap_addr + libref->mmap_size);
} }
#else
(void)(as);
#endif #endif
memcpy(valp, (void *)addr, size); memcpy(valp, (void *)addr, size);
@ -506,7 +509,7 @@ static unsigned long arm_search_unwind_table(struct dwarf_addr_space *as, arch_a
{ {
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref; struct libref *libref = c->libref;
unsigned long map_offset = (unsigned long)libref->image_addr + libref->load_offset - libref->load_addr; unsigned long map_offset = (unsigned long)libref->mmap_addr + libref->mmap_offset - libref->txt_vaddr;
unsigned long lo, hi, e, f; unsigned long lo, hi, e, f;
arch_addr_t val; arch_addr_t val;
@ -647,6 +650,8 @@ int dwarf_arch_step(struct dwarf_addr_space *as)
int dwarf_arch_check_call(struct dwarf_addr_space *as, arch_addr_t ip) int dwarf_arch_check_call(struct dwarf_addr_space *as, arch_addr_t ip)
{ {
(void)(as);
(void)(ip);
return 1; return 1;
} }