当前位置: 首页>>代码示例>>C++>>正文


C++ Tracer::SetGlobalLoglevel方法代码示例

本文整理汇总了C++中Tracer::SetGlobalLoglevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Tracer::SetGlobalLoglevel方法的具体用法?C++ Tracer::SetGlobalLoglevel怎么用?C++ Tracer::SetGlobalLoglevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracer的用法示例。


在下文中一共展示了Tracer::SetGlobalLoglevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, char **argv)
{
    unsigned int cit;
    int          option;
    char         filename[MAX_PATH];
    char         command_line[MAX_PATH];            // win2k max = MAX_PATH, otherwise could be 32k.
    map <DWORD,t_Debugger_memory*>::const_iterator  it;

    // init target char buf.
    memset(target, 0, sizeof(target));

    // Set the debugger's log level. (disable logging)
    dbg.log.set(LOG_SHUTUP);
    dbg.SetGlobalLoglevel(LOG_SHUTUP);

    //
    // do the command line argument thing.
    //

    for (int i = 1; i < argc; i++)
    {
        //
        // attach to a pid.
        //

        if (stricmp(argv[i], "-a") == 0 && i + 1 < argc)
        {
            if (!dbg.attach(atoi(argv[i+1])))
            {
                printf("[ERROR] No process with the ID %u\n", atoi(argv[i+1]));
                return 1;
            }

            // update the target name.
            strncpy(target, argv[i+1], sizeof(target) - 1);

            i++;
        }

        //
        // load a file. (no arguments)
        //

        else if (stricmp(argv[i], "-l") == 0 && i + 1 < argc)
        {
            if (!dbg.load(argv[i+1]))
            {
                printf("[ERROR] Could not load %s\n", argv[i+1]);
                return 1;
            }

            // update the target name.
            strncpy(target, argv[i+1], sizeof(target) - 1);
            
            // cut off the target name at the first dot.
            //char *dot = strchr(target, '.');
            //*dot = 0;

            i++;
        }

        //
        // load a file with arguments.
        //

        else if (stricmp(argv[i], "-la") == 0 && i + 1 < argc)
        {
            _snprintf(command_line, sizeof(command_line), "%s %s", argv[i+1], argv[i+2]);

            if (!dbg.load(argv[i+1], command_line))
            {
                printf("[ERROR] Could not load %s %s\n", argv[i+1], argv[i+2]);
                return 1;
            }

            // update the target name.
            _snprintf(target, sizeof(target), command_line);

            i += 2;
        }

        //
        // select a breakpoint list.
        //

        else if (stricmp(argv[i], "-b") == 0 && i + 1 < argc)
        {
            breakpoint_list = argv[i+1];

            // we open the file now with a global file handle and set the breakpoints after all
            // the modules have been loaded and parsed in the initial breakpoint handler.
            if ((bpl = fopen(breakpoint_list, "r+")) == NULL)
            {
                printf("\n[ERROR] Failed opening breakpoing list: %s\n", breakpoint_list);
                return 1;
            }

            i++;
        }

//.........这里部分代码省略.........
开发者ID:melbcat,项目名称:idc_public_script,代码行数:101,代码来源:main.cpp


注:本文中的Tracer::SetGlobalLoglevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。