Skip to content

To debug cargo project cause lots of 'symbol not found' problems on OSX #40787

Open
@wind2412

Description

@wind2412

My workspace is on OSX. If I touch hello.rs, rustc -g hello.rs and then gdb -q hello of a single .rs file, there won't be any problem and it will load symbols successfully. However, when I use cargo new hello --bin, cd hello, then cargo build and then gdb -q target/debug/hello, it will be a blast on my iterm full of messages as follows:

>gdb -q target/debug/hello                                                                           
Reading symbols from target/debug/hello...
warning: `/Users/zhengxiaolin/Documents/eclipse/hello/target/debug/deps/hello-aa762faea86652ac.0.o': can't open to read symbols: No such file or directory.

warning: can't find symbol '_ZN104_$LT$$RF$$u27$b$u20$collections..string..String$u20$as$u20$core..str..pattern..Pattern$LT$$u27$a$GT$$GT$13into_searcher17h12b3d7238e011a15E' in minsymtab

warning: can't find symbol '_ZN116_$LT$collections..borrow..Cow$LT$$u27$a$C$$u20$str$GT$$u20$as$u20$core..ops..AddAssign$LT$$RF$$u27$a$u20$str$GT$$GT$10add_assign17hdd8b6423379d7623E' in minsymtab

warning: can't find symbol '_ZN11collections3fmt6format17h622e78b799d1c558E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$10trim_right17ha60cffd510213a23E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$11into_string17h77e8e55aae74110bE' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$12encode_utf1617h4b31c1b570b71bf6E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$12escape_debug17h6eadad2fa42faab1E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$12to_lowercase17hdfeeabf72d2d11edE' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$12to_uppercase17hf48dd8c27a89e68dE' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$14escape_default17h52d3319153d73dafE' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$14escape_unicode17h116b615659071afdE' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$4trim17hbce03c1a35407699E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$6repeat17h6fe0557d17b09553E' in minsymtab

warning: can't find symbol '_ZN11collections3str21_$LT$impl$u20$str$GT$9trim_left17h015cef6fe5ab820fE' in minsymtab

warning: can't find symbol '_ZN11collections5btree3map16unwrap_unchecked28_$u7b$$u7b$closure$u7d$$u7d$14_MSG_FILE_LINE17he2a66a8a2be2ef68E' in minsymtab

warning: can't find symbol '_ZN11collections5slice10merge_sort14_MSG_FILE_LINE17h71c2ec20d499b44fE' in minsymtab

and so on.. My paste is only a small part. The no-symbol message has a lot..
Hope to solve the problem~ :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.O-macosOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions