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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
crasher
Posts: 21
Joined: Mon Jan 21, 2008 4:02 am

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

Post 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;
}
User avatar
samueldotj
Member
Member
Posts: 32
Joined: Mon Nov 13, 2006 12:24 am

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

Post 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
crasher
Posts: 21
Joined: Mon Jan 21, 2008 4:02 am

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

Post 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
Post Reply