Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task name 显示异常 #9

Open
dujunqiu opened this issue Oct 21, 2024 · 3 comments
Open

task name 显示异常 #9

dujunqiu opened this issue Oct 21, 2024 · 3 comments

Comments

@dujunqiu
Copy link

dujunqiu commented Oct 21, 2024

task

如上图所示,rt-thread创建的线程不显示具体的名称,用的是5.20版本

[2024-10-21 14:08:27.939]  \ | /
[2024-10-21 14:08:27.939] - RT -     Thread Operating System
[2024-10-21 14:08:27.939]  / | \     5.2.0 build Oct 21 2024 14:07:59
[2024-10-21 14:08:27.939]  2006 - 2024 Copyright by RT-Thread team
@dujunqiu
Copy link
Author

感觉是这个函数的问题--static void _cbSendTaskList(void),list里面取出来的数据是乱码的;

@dujunqiu
Copy link
Author

dujunqiu commented Oct 21, 2024

发现问题并临时处理了一下,感觉链表里面哪里的数据没对上,先临时用着

static void _cbSendTaskList(void)
{
...
        if (thread != tidle)
        {
            //TODO 不知道为什么list里面取出来的值不对,需要偏移一下
            thread2 = (int)thread+0x00000020;
            rt_kprintf("test-2 thread=%p 2=0x%p \n", thread, thread2);
            _cbSendTaskInfo(thread2);
        }
...
}

@dujunqiu
Copy link
Author

1:自己在这个函数里面打印一下thread的地址,static void _cbSendTaskInfo(const rt_thread_t thread)
2:初始化的时候会加载一次thread, PC上启动SystemView的时候会再加载一次thread, 需要保证两次加载的thread地址是相同的;
3:最终的地址是 rt_thread_init 加载的,所以是静态数据,不会发生变化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant