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

fix gdb bthread stack lookup symbol error when using libc++ #2516

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

ehds
Copy link
Contributor

@ehds ehds commented Jan 19, 2024

What problem does this PR solve?

Issue Number:

Problem Summary:
当 brpc 使用 libc++ 编译时,使用当前 gdb bthread 调试脚本会出现找不到符号错误( _M_i, ._M_b._M_p 等变量),这些变量应该是来自 libstdc++ 实现 std::atomic 的中的,而当使用 libc++ 时没有这些变量,所以会出现此类错误。

(gdb) bthread_begin 
Python Exception <class 'gdb.error'>: There is no member or method named _M_i.
Error occurred in Python: There is no member or method named _M_i.

What is changed and the side effects?

Changed:

使用类型强转实现从 atomic<T> -> T 的转化,避免使用特定标准库实现中的变量。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@ehds ehds changed the title fix gdb bthread stack when using libc++ fix gdb bthread stack lookup symbol error when using libc++ Jan 19, 2024
@wwbmmm wwbmmm merged commit 3680dba into apache:master Jan 22, 2024
18 checks passed
jiangdongzi pushed a commit to jiangdongzi/brpc that referenced this pull request Jan 31, 2024
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

Successfully merging this pull request may close these issues.

2 participants