Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2922 → Rev 2923

/branches/tracing/uspace/app/debug/cmd.c
40,6 → 40,7
#include <sys/types.h>
 
#include "main.h"
#include "include/arch.h"
#include "cmd.h"
 
static void cmd_break(int argc, char *argv[]);
60,32 → 61,12
static void cmd_break(int argc, char *argv[])
{
uintptr_t addr;
char brkp[1];
int rc;
breakpoint_t *brk;
int i;
 
brk = NULL;
for (i = 0; i < MAX_BRKPTS; i++)
if (brk_list[i].set == 0) brk = brk_list+i;
 
if (!brk) {
printf("too many breakpoints\n");
return;
}
 
(void)argc;
addr = strtoul(argv[1], NULL, 0);
 
printf("You requested a breakpoint at 0x%x\n", addr);
rc = udebug_mem_read(app_phone, &brk->back, addr, 1);
printf("udebug_mem_read() -> %d\n", rc);
brkp[0] = 0xcc;
rc = udebug_mem_write(app_phone, brkp, addr, 1);
printf("udebug_mem_write() -> %d\n", rc);
 
brk->addr = addr;
brk->set = 1;
arch_breakpoint_add(addr);
}
 
void cmd_help(int argc, char *argv[])