小编vlg*_*789的帖子

在Windbg中获取sizeof(类型)

我需要变量的大小,我想从Windbg命令行获取该值.编译代码并添加C++ sizeof()只是为了获得该值是困难和无用的.

从文档中我看到Windbg可以在值之后进行过滤dt /s.但是显示那个价值?

windbg

17
推荐指数
1
解决办法
5975
查看次数

用于在运行时记录调用堆栈的库(Windows/Linux)

我需要一种方法来记录调试日志中的函数堆栈跟踪,以帮助我诊断缺陷.问题是我需要在Windows和Linux上使用C++实现它.

经过一番研究,我发现:

  • 对于Windows实现,我可以使用StackWalk64 API函数和系列.
  • 在Linux下,我发现libunwind听起来很棒.
  • 或者,我可以使用glibc的回溯

在开始工作之前,我想要一些建议,如果这是正确的方法,并询问是否有一个已经编写的多平台库可以提供帮助.我怀疑我不是第一个需要这个的程序员.:)

c++ linux windows debugging

9
推荐指数
1
解决办法
2609
查看次数

Boost.flyweight和Boost.MPL

根据http://www.boost.org/doc/libs/1_40_0/libs/flyweight/test/test_basic.cpp,我有一个关于flyweight选项的问题,给出了下面的定义

typedef boost::flyweights::flyweight<
    std::string, 
    boost::flyweights::tag<int>,
    boost::flyweights::static_holder_class<boost::mpl::_1>,          
    boost::flyweights::hashed_factory_class<
        boost::mpl::_1, 
        boost::mpl::_2, 
        boost::hash<boost::mpl::_2>,
        std::equal_to<boost::mpl::_2>,
        std::allocator<boost::mpl::_1>
    >,
    boost::flyweights::simple_locking,
    boost::flyweights::refcounted
> StringFlyweight;

StringFlyweight    test1("Hello World");
Run Code Online (Sandbox Code Playgroud)

什么价值boost::mpl::_1boost::mpl::_2?什么时候被签名?

boost::mpl::_1最有可能的std::string.boost::mpl::_2应该是size_t?如果是真的,如何扣除?我不明白key_type是如何选择的.

我已经阅读了http://www.boost.org/doc/libs/1_41_0/libs/flyweight/doc/tutorial/lambda_expressions.html但我这是我第一次接触Boost.MPL并且还不够:)

c++ templates boost boost-mpl

5
推荐指数
1
解决办法
326
查看次数

如何删除Lua中括号内的文本?

我有一个像"Text the I need (extra descriptor) text"我想要的文字"Text the I need text".

我试图使用str:gsub('\([^)]*\)', "")但由于某种原因无法工作

regex lua gsub

3
推荐指数
1
解决办法
1040
查看次数

标签 统计

c++ ×2

boost ×1

boost-mpl ×1

debugging ×1

gsub ×1

linux ×1

lua ×1

regex ×1

templates ×1

windbg ×1

windows ×1