小编aja*_*elu的帖子

How to read a memory dump in binary from GDB?

At the time of a crash I have a post crash handler where I try to dump whats in certain memory regions

auto memdump = std::fstream("FileMemDump.bin", std::ios::out | std::ios::binary);
auto memRegion = getMemoryRegion();
std::cout << "Memory region start: " << memRegion.start << " size: " << memRegion.size;
memdump.write((char*)memRegion.start, memRegion.size);
memdump.close();
Run Code Online (Sandbox Code Playgroud)

and after the file has created a core file So after I load the core in the following manner :

#gdb ./exec ./core.file
Run Code Online (Sandbox Code Playgroud)

I give the restore command; the start …

linux gdb c++11

5
推荐指数
0
解决办法
338
查看次数

核心文件存储在lxc容器中的哪个位置?

当我在容器上运行代码时,它核心我无法在我的容器上找到它(或者核心文件没有被存储).

  1. ulimit -c 被设置为 unlimited
  2. /proc/sys/kernel/core_pattern设置为 |/usr/share/apport/apport %p %s %c %P(是什么意思|?)

我是否需要对主机系统进行任何更改?

linux virtual-machine lxc

4
推荐指数
1
解决办法
3761
查看次数

将int转换为字符串

str2是我需要追加str1的字符串,是我追加的字符串str2.在我追加到最后,str2我需要附加一个数字(int cnt)str2.所以我使用下面的代码,它出现在我的脑海中并且正在运行.这样的代码是不对的,因为我看到了 编译器对库的抱怨的使用string s = lexical_cast<string>(a);itoa (i,buffer,10);实现.

    string str2;
    string str1;
    int cnt;
    str2 += str1 ;
    str2 += char(cnt+48);//cnt converted to ASCII char and appended;
Run Code Online (Sandbox Code Playgroud)

c++ string int

0
推荐指数
1
解决办法
110
查看次数

标签 统计

linux ×2

c++ ×1

c++11 ×1

gdb ×1

int ×1

lxc ×1

string ×1

virtual-machine ×1