This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to connect GDB with Redboot


Hi Jifl and Jesper.
First ,thank you for your advice.
I use the PMON to debug the redboot.srec. Now the program can go to 
cyg_start, and executes the loop successfully. And the net is working
right. But I can't input redboot's command. And we just need ethernet
debug, so I just need the module which can connect with GDB, and no input
is not problem. Is it right?

I think when res==0,the program go to the condition waiting connection
from the GDB. Am I right?

But when the program executes the  "breakpoint()" ,it stops. Do I need to
do something for the virtual vector table or other?

Many thanks!

 Ness


    while (true) {
        if (prompt) {
            printf("RedBoot> ");
            prompt = false;
        }
        res = gets(line, sizeof(line), 250);
        if (res < 0) {
            // No input arrived
#ifdef CYGPKG_REDBOOT_NETWORKING
            if (have_net) {
                // Check for incoming TCP debug connection
                net_io_test();
            }
#endif
        } else {
            if (res == 0) {
                // Special case of '$' - need to start GDB protocol
                CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
                breakpoint();  // Get GDB stubs started, with a proper
environment, etc.
            } else {
                if (strlen(line) > 0) {
                    if ((cmd = parse(line, &argc, &argv[0])) != (struct
cmd *)0) {
                        (cmd->fun)(argc, argv);
                    } else {
                        printf("Illegal command: %s\n", line);
                    }
                }
                prompt = true;
            }
        }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]