LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: György 'nog' Jeney<nog@s...>
    Date: Fri May 20 21:30:37 CEST 2005
    Subject: [openrisc] [or1ksim #94] Make simprintf use the new debugging functions
    Top
    Hi,

    Changelog says it all.

    ChangeLog:
    * Make simprintf use the new debugging functions.

    nog.
    -------------- next part --------------
    --- support/simprintf.c 2005-05-20 18:18:25.000000000 +0200
    +++ ../or1ksim-ac/support/simprintf.c 2005-05-20 21:16:34.000000000 +0200
    @@ -40,6 +40,8 @@
    #include "sim-config.h"
    #include "debug.h"

    +DEFAULT_DEBUG_CHANNEL(simprintf);
    +
    /* Length of PRINTF format string */
    #define FMTLEN 2000

    @@ -70,7 +72,7 @@

    simgetstr(stackaddr, regparam);

    - debug(6, "simprintf: stackaddr: 0x%"PRIxADDR"\n", stackaddr);
    + TRACE("simprintf: stackaddr: 0x%"PRIxADDR"\n", stackaddr);
    if ((f = fopen(config.sim.fstdout, "a+"))) {
    uint32_t arg;
    oraddr_t argaddr;
    @@ -87,16 +89,16 @@
    && config.sim.exe_log_start <= runtime.cpu.instructions && (config.sim.exe_log_end <= 0 || runtime.cpu.instructions <= config.sim.exe_log_end));

    if (tee_exe_log) fprintf (runtime.sim.fexe_log, "SIMPRINTF: ");
    - debug(6, "simprintf: %s\n", fmtstrpart);
    + TRACE("simprintf: %s\n", fmtstrpart);
    while(strlen(fmtstrpart)) {
    - debug(6, "simprintf(): 1");
    + TRACE("simprintf(): 1");
    if ((fmtstrend = strstr(fmtstrpart + 1, "%")))
    *fmtstrend = '\0';
    - debug(6," 2");
    + TRACE(" 2");
    if (strstr(fmtstrpart, "%")) {
    char *tmp;
    int string = 0;
    - debug(6, " 3");
    + TRACE(" 3");
    #if STACK_ARGS
    arg = eval_direct32(argaddr,1,0);
    argaddr += 4;
    @@ -108,7 +110,7 @@
    arg = evalsim_reg(atoi(regstr));
    }
    #endif
    - debug(6, " 4: fmtstrpart=%p fmtstrpart=%s arg=0x%08"PRIx32"\n",
    + TRACE(" 4: fmtstrpart=%p fmtstrpart=%s arg=0x%08"PRIx32"\n",
    fmtstrpart, fmtstrpart, arg);
    tmp = fmtstrpart;
    if (*tmp == '%') {
    @@ -127,8 +129,8 @@
    for(; eval_direct8(arg,1,0); len++)
    *(str+len) = eval_direct8(arg++,1,0);
    *(str+len) = eval_direct8(arg,1,0); /* null ch */
    - debug(6, "4a: len=%d str=%s\n", len, str);
    - debug(6, "4b:");
    + TRACE("4a: len=%d str=%s\n", len, str);
    + TRACE("4b:");
    fprintf(f, fmtstrpart, str);
    if (tee_exe_log) fprintf(runtime.sim.fexe_log, fmtstrpart, str);
    free(str);
    @@ -137,20 +139,20 @@
    if (tee_exe_log) fprintf(runtime.sim.fexe_log, fmtstrpart, arg);
    }
    } else {
    - debug(6, " 5");
    + TRACE(" 5");
    fprintf(f, fmtstrpart);
    if (tee_exe_log) fprintf(runtime.sim.fexe_log, fmtstrpart);
    - debug(6, fmtstrpart);
    + TRACE(fmtstrpart);
    }
    if (!fmtstrend)
    break;
    - debug(6, " 6");
    + TRACE(" 6");
    fmtstrpart = fmtstrend;
    *fmtstrpart = '%';
    - debug(6, " 7");
    + TRACE(" 7");
    }

    - debug(6," 8\n");
    + TRACE(" 8\n");
    if (fclose(f))
    perror(strerror(errno));
    }
    --- support/dbchs.h 2005-05-20 21:13:59.000000000 +0200
    +++ ../or1ksim-ac/support/dbchs.h 2005-05-20 21:16:48.000000000 +0200
    @@ -32,3 +32,4 @@ DECLARE_DEBUG_CHANNEL(gpio)
    DECLARE_DEBUG_CHANNEL(mc)
    DECLARE_DEBUG_CHANNEL(dma)
    DECLARE_DEBUG_CHANNEL(vapi)
    +DECLARE_DEBUG_CHANNEL(simprintf)

    Follow upAuthor
    [openrisc] [or1ksim #94] Make simprintf use the new debugging functionsMatjaz Breskvar

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.