Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2935 → Rev 2930

/branches/tracing/uspace/app/debug/fib_synch.c
File deleted
/branches/tracing/uspace/app/debug/fib_synch.h
File deleted
/branches/tracing/uspace/app/debug/main.c
45,7 → 45,6
 
#include "cmd.h"
#include "include/arch.h"
#include "fib_synch.h"
#include "main.h"
 
void thread_debug_start(unsigned thread_hash);
72,8 → 71,6
breakpoint_t brk_list[MAX_BRKPTS];
int lifted_brkpt;
 
fcv_t go_cv;
 
void read_line(char *buffer, int n)
{
char c;
164,13 → 161,6
(*cmd_table[idx_found].proc)(cmd_argc, cmd_argv);
}
 
/*
* Called by a fibril (from arch code) when a breakpoint is hit.
*/
void breakpoint_hit(void)
{
fcv_wait(&go_cv);
}
 
int task_connect(int taskid)
{
279,16 → 269,16
 
while (!abort_debug) {
 
printf("[t%d] go...\n", thread_id);
printf("go\n");
/* Run thread until an event occurs */
rc = udebug_go(app_phone, thread_hash,
&ev_type, &val0, &val1);
printf("[t%d] stopped\n", thread_id);
 
if (ev_type == UDEBUG_EVENT_FINISHED) {
printf("thread %u debugging finished\n", thread_id);
break;
}
 
if (rc >= 0) debug_event(thread_hash, ev_type, val0);
}
 
320,7 → 310,7
while ((i = getchar()) != 'c')
putchar(i);
 
taskid = 14;
taskid = 13;
rc = task_connect(taskid);
if (rc < 0) {
printf("Failed to connect to task %d\n", taskid);
363,8 → 353,6
{
next_thread_id = 1;
paused = 0;
 
fcv_init(&go_cv);
}
 
int main(void)
/branches/tracing/uspace/app/debug/Makefile
44,7 → 44,6
 
OUTPUT = debug
GENERIC_SOURCES = cmd.c \
fib_synch.c \
main.c
 
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
61,7 → 60,6
 
clean:
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch
find . -name '*.o' -follow -exec rm \{\} \;
 
depend:
$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
/branches/tracing/uspace/app/debug/arch/mips32/src/mips32.c
98,8 → 98,6
}
if (bi < MAX_BRKPTS) {
printf("breakpoint %d hit\n", bi);
breakpoint_hit();
 
rc = udebug_mem_write(app_phone, &brk_list[bi].arch.back, brk_addr, 4);
printf("udebug_mem_write(phone, 0x%x, 0x%02x, 1) -> %d\n", brk_addr, brk_list[bi].arch.back, rc);
rc = udebug_mem_read(app_phone, &brk_list[bi].arch.back, brk_addr+4, 4);
/branches/tracing/uspace/app/debug/arch/ia32/src/ia32.c
90,7 → 90,6
 
if (bi < MAX_BRKPTS) {
printf("breakpoint %d hit\n", bi);
breakpoint_hit();
 
buffer[ISTATE_OFF_EIP] = brk_addr;
buffer[ISTATE_OFF_EFLAGS] |= 0x0100; /* trap flag */
/branches/tracing/uspace/app/debug/cmd.c
44,7 → 44,6
#include "cmd.h"
 
static void cmd_break(int argc, char *argv[]);
void cmd_go(int argc, char *argv[]);
void cmd_help(int argc, char *argv[]);
static void cmd_read(int argc, char *argv[]);
static void cmd_quit(int argc, char *argv[]);
53,7 → 52,6
 
cmd_desc_t cmd_table[] = {
{ 1, "break", cmd_break },
{ 0, "go", cmd_go },
{ 0, "help", cmd_help },
{ 2, "read", cmd_read },
{ 0, "quit", cmd_quit },
71,11 → 69,6
arch_breakpoint_add(addr);
}
 
void cmd_go(int argc, char *argv[])
{
fcv_broadcast(&go_cv);
}
 
void cmd_help(int argc, char *argv[])
{
int i;
/branches/tracing/uspace/app/debug/main.h
36,7 → 36,6
#define MAIN_H_
 
#include "include/arch/types.h"
#include "fib_synch.h"
 
typedef struct {
int set;
48,11 → 47,7
extern breakpoint_t brk_list[MAX_BRKPTS];
 
extern int app_phone;
extern fcv_t go_cv;
 
void breakpoint_hit(void);
 
 
#endif
 
/** @}