gdb

How do I debug a failing cargo test in GDB?

余生颓废 提交于 2020-11-25 20:55:06
问题 I have a failing Cargo test: $ cargo test [snip] Running target/gunzip-c62d8688496249d8 running 2 tests test test_extract_failure ... FAILED test test_extract_success ... ok failures: ---- test_extract_failure stdout ---- task 'test_extract_failure' panicked at 'assertion failed: result.is_err()', /home/dhardy/other/flate2-rs/tests/gunzip.rs:19 failures: test_extract_failure test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured task '<main>' panicked at 'Some tests failed', /home

How do I debug a failing cargo test in GDB?

浪尽此生 提交于 2020-11-25 20:52:04
问题 I have a failing Cargo test: $ cargo test [snip] Running target/gunzip-c62d8688496249d8 running 2 tests test test_extract_failure ... FAILED test test_extract_success ... ok failures: ---- test_extract_failure stdout ---- task 'test_extract_failure' panicked at 'assertion failed: result.is_err()', /home/dhardy/other/flate2-rs/tests/gunzip.rs:19 failures: test_extract_failure test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured task '<main>' panicked at 'Some tests failed', /home

How do I debug a failing cargo test in GDB?

只谈情不闲聊 提交于 2020-11-25 20:51:40
问题 I have a failing Cargo test: $ cargo test [snip] Running target/gunzip-c62d8688496249d8 running 2 tests test test_extract_failure ... FAILED test test_extract_success ... ok failures: ---- test_extract_failure stdout ---- task 'test_extract_failure' panicked at 'assertion failed: result.is_err()', /home/dhardy/other/flate2-rs/tests/gunzip.rs:19 failures: test_extract_failure test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured task '<main>' panicked at 'Some tests failed', /home

How do I debug a failing cargo test in GDB?

亡梦爱人 提交于 2020-11-25 20:49:01
问题 I have a failing Cargo test: $ cargo test [snip] Running target/gunzip-c62d8688496249d8 running 2 tests test test_extract_failure ... FAILED test test_extract_success ... ok failures: ---- test_extract_failure stdout ---- task 'test_extract_failure' panicked at 'assertion failed: result.is_err()', /home/dhardy/other/flate2-rs/tests/gunzip.rs:19 failures: test_extract_failure test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured task '<main>' panicked at 'Some tests failed', /home

Linux信号(Understanding Linux Kernel 3rd)

烈酒焚心 提交于 2020-11-21 06:13:39
总览 产生 内核或应用程序产生,一份简短的信息。 传递 挂起状态 非挂起状态 信号类型 发给进程的信号(所有线程共享) 发给线程的信号 处理者 进程信号是其中一个没有屏蔽这个信号的线程处理。 线程就是指定线程处理。 处理方式 do_signal 处理 创建对应的特定栈帧来处理。 信号处理函数 整个进程中的线程共享。 有默认也有自定义。 需要的信息也可以自定义。 信号的作用 简讯 一份简短的信息。 生产者是内核或进程。 处理者是具体的线程或者是进程组中符合处理条件的线程。 内容 标准的信号就只有一个数字。 32 位的整数,每一位对应一个信号位。 支持实时信号的系统是 64 位,即两个 long . 信号定义 trap -l 用上面的指令罗列出支持的信号。 在编程中一般是宏定义,然后每个宏对应一个数字。 #define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 #define SIGILL 4 #define SIGTRAP 5 #define SIGABRT 6 #define SIGIOT 6 #define SIGBUS 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGUSR1 10 #define SIGSEGV 11 #define SIGUSR2 12 #define

应用层内存溢出/越界/重复释放等问题检查工具(ASan)

爷,独闯天下 提交于 2020-11-21 04:04:50
https://github.com/google/sanitizers/wiki https://github.com/google/sanitizers/wiki/AddressSanitizer AddressSanitizer (aka ASan) is a memory error detector for C/C++. It finds: Use after free (dangling pointer dereference) Heap buffer overflow Stack buffer overflow Global buffer overflow Use after return Use after scope Initialization order bugs Memory leaks This tool is very fast. The average slowdown of the instrumented program is ~2x (see AddressSanitizerPerformanceNumbers ). The tool consists of a compiler instrumentation module (currently, an LLVM pass) and a run-time library which

linux 配置vscode

ぐ巨炮叔叔 提交于 2020-11-19 07:35:53
launch.json 1 { 2 " version " : " 0.2.0 " , 3 " configurations " : [ 4 { 5 " name " : " (gdb) Launch " , // 配置名称,将会在启动配置的下拉菜单中显示 6 " type " : " cppdbg " , // 配置类型,这里只能为cppdbg 7 " request " : " launch " , // 请求配置类型,可以为launch(启动)或attach(附加) 8 " program " : " ${workspaceRoot}/${fileBasenameNoExtension}.o " , // 将要进行调试的程序的路径 9 " args " : [], // 程序调试时传递给程序的命令行参数,一般设为空即可 10 " stopAtEntry " : false , // 设为true时程序将暂停在程序入口处,一般设置为false 11 " cwd " : " ${workspaceRoot} " , // 调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录 12 " environment " : [], 13 " externalConsole " : true , // 调试时是否显示控制台窗口,一般设置为true显示控制台 14 "

在windows上用eclipse搭建STM32开发环境

你。 提交于 2020-11-18 08:29:03
1.下载eclipse需要的运行环境,JDK/JRE. 在http://wiki.eclipse.org/Eclipse/Installation中,找到最新的eclipse版本需要的JAVA 版本,然后去相应网站下载JAVA。这里我用的是Eclipse 4.5(Mars),它需要JAVA 7。 2.下载eclipse 在eclipse的官网下载 Eclipse IDE for C/C++ Developers 3.下载bleeding-edge-toolchain,openOCD,windows-build-tool。 在网站http://www.freddiechopin.info/en/download,找到download,选择bleeding-edge-toolchain,下载最新的即可。 之后接着点击download,下载OpenOCD,同样下载最新的。 这个网站上提供的windows-build-tool版本太老,无法使用,建议到http://gnuarmeclipse.github.io/windows-build-tools/下载最新的windows-build-tools。 4.下载eclipse GNU ARM plug-in 在https://sourceforge.net/projects/gnuarmeclipse/上下载最新的即可。 5.下载Zadig