本文介绍了Windows上的堆栈跟踪(如回溯),也许是WSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在寻找一种在Windows上重现回溯功能的简便方法。这是因为我使用的代码主要是在Linux和OSX上开发的,但也可以在Windows上运行。在一个地方,它通过使用backtrace函数显示信息,在BSD Unix,Linux,OSX 1.5上可以获得
,...在Windows上,它只是说该功能不可用。

I am looking for an easy way to reproduce the backtrace function on Windows. This is because I am using code that was developed mainly on Linux and OSX, but also runs on Windows. In one place, it displays information by using the backtrace function, which is available on BSD Unix, Linux, OSX 1.5, … On Windows, it just says that the feature is not available.

我发现了一些对StackWalk和GetStackTrace的引用,但这需要编写特殊代码来处理这些和回溯之间的差异。

I have found some references to StackWalk and GetStackTrace, but this would require writing special code to take care of the differences between these and backtrace.

另一方面,可以轻松激活适用于Linux的Windows子系统,它可以运行所有Linux二进制文件。文档说明了如何安装WSL,然后是Linux和BASH等。

On the other hand, it is easy to activate the Windows Subsystem for Linux, which can run all Linux binaries. The documentation explains how to install WSL, then Linux and BASH, etc.

是否可以激活WSL然后只是在C ++程序中调用backtrace?如果是这样,我还没有理解如何引用所需的库,或者在Visual Studio中激活正确的功能。

Is it possible to activate WSL and then simply make a call to backtrace from within a C++ program? If so, I haven't yet understood how to reference the libraries needed, or activate the correct feature in Visual Studio.

Tom

推荐答案

https://github.com/Microsoft/WSL/issues/3448# issuecomment-411462386

https://github.com/Microsoft/WSL/issues/3448#issuecomment-411462386


这篇关于Windows上的堆栈跟踪(如回溯),也许是WSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 02:33