QureL / qurel.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

非局部转移与qemu协程分析

QureL opened this issue · comments

commented

https://qurel.github.io/qemu-coroutine/

非局部转移

解析

qemu-coroutine的ucontext模式是基于setjmp和longjmp实现的,可以完成函数外部的跳转。

setjmp示例:

#include <stdio.h>
#include <setjmp.h>

jmp_buf env;

int func1()
{
printf(