Fix gdb reg parsing and gdb 'G' reg writing issues ##debug

This commit is contained in:
M. George Dan 2021-08-27 00:56:00 +00:00 committed by GitHub
parent d6f1160464
commit c25595a767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ gdb_reg_t *arch_parse_reg_profile(const char * reg_profile) {
}
i = 0;
r_list_foreach (gdb_regs_list, iter, reg) {
memcpy (reg, gdb_regs + i, sizeof (gdb_reg_t));
memcpy (gdb_regs + i, reg, sizeof (gdb_reg_t));
i++;
}
memset (gdb_regs + i, 0, sizeof (gdb_reg_t));

View File

@ -1087,7 +1087,7 @@ int gdbr_write_reg(libgdbr_t *g, const char *name, char *value, int len) {
// Use 'G' if write_register failed/isn't supported
gdbr_read_registers (g);
memcpy (g->data + g->registers[i].offset, value, len);
memcpy (g->data + (g->registers[i].offset / 8), value, len);
gdbr_write_bin_registers (g, g->data, g->data_len);
ret = 0;