OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or_debug_proxy/] [src/] [or_debug_proxy.c] - Diff between revs 497 and 529

Show entire file | Details | Blame | View Log

Rev 497 Rev 529
Line 89... Line 89...
int current_chain = -1;
int current_chain = -1;
 
 
/* The chain that should be currently selected. */
/* The chain that should be currently selected. */
int dbg_chain = -1;
int dbg_chain = -1;
 
 
 
/* By default, provide access to CPU */
 
int no_cpu = 0;
 
 
int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
{
 
 
        char *s;
        char *s;
        int gdb_protocol = GDB_PROTOCOL_NONE;
        int gdb_protocol = GDB_PROTOCOL_NONE;
        endpoint_target = ENDPOINT_TARGET_NONE;
        endpoint_target = ENDPOINT_TARGET_NONE;
        int inp_arg = 1;
        int inp_arg = 1;
 
 
 
 
        // Check we were compiled with at least one endpoint enabled
        // Check we were compiled with at least one endpoint enabled
#ifndef USB_ENDPOINT_ENABLED
#ifndef USB_ENDPOINT_ENABLED
        printf
        printf
            ("No endpoints enabled.\nRecompile the proxy with at least one endpoint enabled\n");
            ("No endpoints enabled.\nRecompile the proxy with at least one endpoint enabled\n");
        exit(0);
        exit(0);
Line 127... Line 131...
                } else if (strcmp(argv[inp_arg], "-o") == 0) {
                } else if (strcmp(argv[inp_arg], "-o") == 0) {
                        gdb_protocol = GDB_PROTOCOL_RSP;
                        gdb_protocol = GDB_PROTOCOL_RSP;
                        endpoint_target = ENDPOINT_TARGET_OTHER;
                        endpoint_target = ENDPOINT_TARGET_OTHER;
                } else if (strcmp(argv[inp_arg], "-k") == 0) {
                } else if (strcmp(argv[inp_arg], "-k") == 0) {
                        kernel_debug = 1;
                        kernel_debug = 1;
 
                } else if (strcmp(argv[inp_arg], "-b") == 0) {
 
                        no_cpu = 1;
                } else {
                } else {
                        serverPort = strtol(argv[2], &s, 10);
                        serverPort = strtol(argv[2], &s, 10);
                }
                }
 
 
                inp_arg++;
                inp_arg++;
Line 161... Line 167...
        /* USB Endpoint */
        /* USB Endpoint */
        if (endpoint_target == ENDPOINT_TARGET_USB) {
        if (endpoint_target == ENDPOINT_TARGET_USB) {
                printf("\nConnecting to OR1k via USB debug cable\n\n");
                printf("\nConnecting to OR1k via USB debug cable\n\n");
                if ((err = usb_dbg_reset()))
                if ((err = usb_dbg_reset()))
                        goto JtagIfError;
                        goto JtagIfError;
 
                if (!no_cpu)
                dbg_test();     // Perform some tests
                dbg_test();     // Perform some tests
        }
        }
#endif
#endif
 
 
        /* We have a connection to the target system.  Now establish server
        /* We have a connection to the target system.  Now establish server
Line 406... Line 413...
        printf("\t\tAny free port within the usable range of 0 - 65535\n");
        printf("\t\tAny free port within the usable range of 0 - 65535\n");
        printf("\n");
        printf("\n");
        printf("\tOptions:\n");
        printf("\tOptions:\n");
        printf
        printf
            ("\t-k\tAccesses to 0xC0000000 map to 0x0. Useful for kernel debugging.\n");
            ("\t-k\tAccesses to 0xC0000000 map to 0x0. Useful for kernel debugging.\n");
 
        printf
 
            ("\t-b\tBus access only - do not attempt to talk to the CPU\n");
        printf("\n");
        printf("\n");
        printf("\tExample:\n");
        printf("\tExample:\n");
#ifdef USB_ENDPOINT_ENABLED
#ifdef USB_ENDPOINT_ENABLED
        printf
        printf
            ("\t\tStart a GDB server on port 50001, using RSP, connecting to\n\t\thardware target via USB:\n\n");
            ("\t\tStart a GDB server on port 50001, using RSP, connecting to\n\t\thardware target via USB:\n\n");

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.