Re: [Kgdb-bugreport] CTRL+C not working for at91rm9200-ek board
Status: Beta
Brought to you by:
jwessel
From: Jason W. <jas...@wi...> - 2008-03-24 12:26:58
|
Himanshu Chauhan wrote: > Dear all, > > After making Linux kernel use the DTE port for standard I/O and writing > a KGDB stub driver for the on board DBGU port, I am finally able to > connect to kgdb on my at91rm9200-ek board. When I pass kgdbwait as > parameter, kernel stops after "Uncompressing Linux.... Booting Linux." > and I can successfully connect to kgdb and then debug the arm kernel. > As I let the kernel go and later when I try to press CTRL+C on gdb > terminal kgdb doesn't seem to break and GDB also doesn't respond. A > second time CTRL+C press, says > > Interrupted while waiting for the program. > Give up (and stop debugging it)? (y or n) > > Ideally, one time press should give me the (gdb) prompt. But I am not > getting it. What can be the reason? > > Thanks in advance. > > Regards > --Himanshu > Assuming you are not using the console polling hooks, in your kgdb specific driver code you need to either detect the break character and execute an compiled breakpoint, or if you registered for an interrupt and receive some input on the port. That means you do something like: c = your_driver_char_read(); if (c == 0x03 || (c == '$' && !debugger_connected)) breakpoint(); Or like in 8250_kgdb.c - where you call breakpoint() kgdb8250_interrupt(int irq, void *dev_id) { if (kgdb_ioread(UART_IIR) & UART_IIR_RDI) { /* Throw away the data if another I/O routine is active. */ if (kgdb_io_ops.read_char != kgdb_get_debug_char && (kgdb_ioread(UART_LSR) & UART_LSR_DR)) kgdb_ioread(UART_RX); else breakpoint(); } return IRQ_HANDLED; } Jason. |