Skip to content

Commit

Permalink
Merge pull request #455 from Fabien-Chouteau/semihosting
Browse files Browse the repository at this point in the history
Improve ARM semi-hosting support
  • Loading branch information
texane committed Aug 12, 2016
2 parents 1eb3c71 + 3a1ab6e commit 28dc5c9
Show file tree
Hide file tree
Showing 2 changed files with 363 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/gdbserver/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,10 +1321,12 @@ int serve(stlink_t *sl, st_state_t *st) {
memcpy(&insn, &sl->q_buf[offset], sizeof(insn));

if (insn == 0xBEAB && !has_breakpoint(addr)) {
DLOG("Do semihosting...\n");

do_semihosting (sl, reg.r[0], reg.r[1], &reg.r[0]);

/* Write return value */
stlink_write_reg(sl, reg.r[0], 0);

/* Jump over the break instruction */
stlink_write_reg(sl, reg.r[15] + 2, 15);

Expand Down
Loading

0 comments on commit 28dc5c9

Please sign in to comment.