Page 1 of 1

Get "Remote failure reply:E01 when using gdb remote debug --

Posted: Mon Aug 04, 2008 1:58 am
by crasher
in my kernel, I setup the serial port baud rate to 9600 and break points, then I wait for the gdb in the host to connect.

Code: Select all

int main()
{ 
    setup_gdt();
    setup_idt();
    init_serial_port(9600);
    
    printk("setup debug traps");
    set_debug_traps();
    breakpoint();

    func1();
    func2();
    .....
}
In the host, I start gdb with my kernel image as the argument, set serial baud rate 9600
then gdb prints a message which shows me the connection has been establised

Code: Select all

(gdb) set remotebaud 9600
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
breakpoint () at /home/penjyhu/mini-kernel/source/debug/i386-stub.c:957
957     }
But if I type "next" command, gdb will give me an error message

Code: Select all

(gdb) next
Remote failure reply: E01
if I type "step" command at this time, it executes very well.

Does anyone knows how to deal with this problem

My gdb version is GNU gdb 6.6-debian
Below is my gdb stub

Code: Select all

void putDebugChar(int ch)
{
    unsigned timeout = 0xffff; 
    while ((inportb(serial_base + LSR) & XMTRDY) == 0 && --timeout) 
        cpu_relax();
    outportb( serial_base + TXR, (char)ch);
}

int getDebugChar()
{
    unsigned timeout = 0xffff; 
    unsigned char ch;
    while ((inportb(serial_base + LSR) & 0x01) == 0)// && --timeout) 
        cpu_relax();
    ch = inportb(serial_base + RXR);
    return ch;
}

Re: Get "Remote failure reply:E01 when using gdb remote debug --

Posted: Mon Aug 04, 2008 2:28 am
by samueldotj
I havent faced this issue; the following might help you.

You may get more info by debugging remote debugging in gdb.
(gdb) set debug remote 1

It is always good to set the remoteaddresssize to 32. set remote addresssize 32

You can also verify serial read/write functions, by reading/writing a string and redirecting the serial device to a file in your emulator.

Sam

Re: Get "Remote failure reply:E01 when using gdb remote debug --

Posted: Mon Aug 04, 2008 4:30 am
by crasher
In gdb, I type command

Code: Select all

set debug remote 1
to see the communication between host and target.
Every time in host gdb I receive "remote failure reply: E01", it prints a message

Code: Select all

Sending packet: $P29=ffffffff#28...Ack
Packet received: E01
where the register number is 0x29 or 41 in decimal. It is a register of "orig_eax" when I
use the command below to see what it is.

Code: Select all

maint print registers
However in i386-stub.c, I have only 16 registers.
So the cause is found.
See link:http://sourceware.org/cgi-bin/gnatsweb. ... db&pr=2454

Thank you for your help, Samueldot