bl()/rmbl() commands for setting/removing breakpoints at source line
This commit is contained in:
@@ -39,6 +39,25 @@ DEBUGUS_EXTERNC void libelfin_wrap_get_funcs(PLibelfinBinding pbind, Funcs *func
|
||||
}
|
||||
}
|
||||
|
||||
DEBUGUS_EXTERNC AddrInfo *libelfin_wrap_info_from_line(PLibelfinBinding pbind, const char *file, size_t line)
|
||||
{
|
||||
LibelfinBinding *bind = (LibelfinBinding *)pbind;
|
||||
for (auto &cu : bind->dwarf.compilation_units()) {
|
||||
auto < = cu.get_line_table();
|
||||
for (auto &ent : lt) {
|
||||
if (ent.is_stmt && ent.line == line) {
|
||||
AddrInfo *ai = (AddrInfo *)malloc(sizeof(*ai));
|
||||
ai->addr = bind->loadoffset + (uintptr_t)ent.address;
|
||||
ai->line = (ssize_t)line;
|
||||
ai->file = (const char*)malloc(strlen(file)+1);
|
||||
strcpy((char*)ai->file, file);
|
||||
return ai;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEBUGUS_EXTERNC uintptr_t libelfin_wrap_func_addr(PLibelfinBinding pbind, Func *f)
|
||||
{
|
||||
LibelfinBinding *bind = (LibelfinBinding *)pbind;
|
||||
|
||||
Reference in New Issue
Block a user