Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242229
b: refs/heads/master
c: d57f078
h: refs/heads/master
i:
  242227: 68a214e
v: v3
  • Loading branch information
David Howells committed Mar 18, 2011
1 parent 67fc8d4 commit e7adf27
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e460d64405c04581e42aa9cbae76815a2d4e9abe
refs/heads/master: d57f078b193981d1b7d24193f3118c6b806db0ff
1 change: 1 addition & 0 deletions trunk/include/linux/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ extern int
kgdb_handle_exception(int ex_vector, int signo, int err_code,
struct pt_regs *regs);
extern int kgdb_nmicallback(int cpu, void *regs);
extern void gdbstub_exit(int status);

extern int kgdb_single_step;
extern atomic_t kgdb_active;
Expand Down
30 changes: 30 additions & 0 deletions trunk/kernel/debug/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,3 +1093,33 @@ int gdbstub_state(struct kgdb_state *ks, char *cmd)
put_packet(remcom_out_buffer);
return 0;
}

/**
* gdbstub_exit - Send an exit message to GDB
* @status: The exit code to report.
*/
void gdbstub_exit(int status)
{
unsigned char checksum, ch, buffer[3];
int loop;

buffer[0] = 'W';
buffer[1] = hex_asc_hi(status);
buffer[2] = hex_asc_lo(status);

dbg_io_ops->write_char('$');
checksum = 0;

for (loop = 0; loop < 3; loop++) {
ch = buffer[loop];
checksum += ch;
dbg_io_ops->write_char(ch);
}

dbg_io_ops->write_char('#');
dbg_io_ops->write_char(hex_asc_hi(checksum));
dbg_io_ops->write_char(hex_asc_lo(checksum));

/* make sure the output is flushed, lest the bootloader clobber it */
dbg_io_ops->flush();
}

0 comments on commit e7adf27

Please sign in to comment.