when gdb bitcoind program, gdb prints message "can't open to read symbols" #8812

issue lovecodelc opened this issue on September 26, 2016
  1. lovecodelc commented at 9:17 AM on September 26, 2016: none

    Hi all, this is my first time to ask question on GitHub, I come from China. Maybe there are some mistakes in this question, Sorry.

    Before I write C++ on Linux, such Ubuntu, Now turn to on Max OS.

    I install Bitcoin Core code and compile it successful according to https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md , and start it successful.

    But when I gdb bitcoind binary executable, i meet some problems, such as:

    1. Reading symbols from /***/bitcoin/src/bitcoind... warning: can't find symbol '_Z10ParseHexUVRK8UniValueRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE' in minsymtab. why?

    2. warning: `/private/tmp/boost-20160924-23596- 1q34jy8/boost_1_61_0/bin.v2/libs/chrono/build/darwin-4.2.1/release/threading-multi/process_cpu_clocks.o': can't open to read symbols: No such file or directory. why?

    //a lot of "can't open to read symbols: No such file or directory" about boost

    3)when i gdb funcation by step, it notices "<value optimized out>", even if i modify Makefile(in ./src/Makefile, not ./Makefile)configuration, before "CXXFLAGS = -g -O2", now " CXXFLAGS = -g -O0", it seems not work, why?

    1. when I use gdb breakpoint, such HTTPReq_JSONRPC funcation, when request arrives, the break is stop other place not HTTPReq_JSONRPC, why?

    How can i solve above questions?? Thank you.

  2. laanwj added the label MacOSX on Sep 26, 2016
  3. laanwj commented at 10:20 AM on September 26, 2016: member

    when I use gdb breakpoint, such HTTPReq_JSONRPC funcation, when request arrives, the break is stop other place not HTTPReq_JSONRPC, why?

    That's what you get if you use gdb with an optimized executable. The association between line numbers and addresses will be partially muddled.

    The easiest way to get a debuggable executable is to configure with --enable-debug. This will automatically set the optimization flags so that gdb can make sense of the executable and includes full symbols.

  4. lovecodelc commented at 11:06 AM on September 26, 2016: none

    @laanwj Thank you, I execute "make clean" and "./configure --enable-debug", then "make"; but it appears same problem when debug it:

    (gdb) b HTTPReq_JSONRPC Breakpoint 1 at 0x10165829b: HTTPReq_JSONRPC. (2 locations) //why 2 locations??? (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE>
    1.1 y 0x000000010165829b in SerReadWrite<CSizeComputer, std::__1::vector<CTxOut, std::__1::allocator<CTxOut> > >(CSizeComputer&, std::__1::vector<CTxOut, std::__1::allocator<CTxOut> > const&, int, int, CSerActionSerialize) at ./serialize.h:919 1.2 y 0x00000001016582b0 in std::__1::vector<CTxInWitness, std::__1::allocator<CTxInWitness> >::resize(unsigned long) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1994

  5. laanwj commented at 11:34 AM on September 26, 2016: member

    In that case your debugger and/or compiler is probably broken. I can't help you with that.

  6. jonasschnelli commented at 3:08 PM on September 28, 2016: contributor

    Maybe try lldb which is the native debugger since Xcode4.8 or so. Maybe do a git clean -dxf(danger: deletes all unstated files) and configure (with --enable-debug) and compile again?

  7. laanwj commented at 7:48 AM on September 29, 2016: member

    Closing this as it isn't really issue, more of a Q/A

  8. laanwj closed this on Sep 29, 2016

  9. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me