ARM:如何获取当前上下文

时间:2013-05-30 14:28:28

标签: c++ embedded arm

这个问题与ARMv6有关。

我正在为我们的嵌入式应用程序实现一个回溯例程。我正在使用gcc 4.7.3和uClibc-0.9.33.2。 gcc抱怨函数getcontext:

ucontext_t *context;
getcontext(context); // getcontext was not declared in this scope

我查看过ucontext.h并且没有找到任何函数来获取当前上下文。这是一个问题:如何获得ARM的当前上下文?我需要以某种方式填充ucontext_t结构。

感谢。

1 个答案:

答案 0 :(得分:3)

你可能需要一个更新的uClibc - http://lists.uclibc.org/pipermail/uclibc/2013-January/047400.html表明getcontext补丁是在2013年1月发布的,而你运行的版本是从2012年5月开始的。有两个选项 - 尝试最新的git或backport补丁。