Re: Trace/breakpoint trap.

Jeffrey Walton via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAH8yC8=H1gex32EOei1yYfLp7WR9MPif==XSL0Kx9J40xqUBLw@mail.gmail.com>
On Fri, May 14, 2021 at 5:39 PM Jason Long via Gdb <[email protected]> wrote:
>
> Thank you.
> Why you selected "0x0000555557425000 - 0x000055555c440280 is .text" ?
> How to build with debug information?
> Disassembly? I must use a disassembler?

From the top level directory, where you run configure, change CFLAGS
and CXXFLAGS to include:

  -g3 -O1 -fdebug-prefix-map=${PWD}=/opt/src/wallet

Then, after you perform 'sudo make install', perform the following to
copy the sources to /opt/src/wallet.

IFS= find "./" \( -name '*.h' -o -name '*.hpp' -o -name '*.hxx' -o \
                  -name '*.c' -o -name '*.cc' -o \
                  -name '*.cpp' -o -name '*.cxx' -o -name '*.CC' -o \
                  -name '*.s' -o -name '*.S' \) -print | while read -r file
do
    # This trims the leading "./" in "./foo.c".
    file=$(echo -n "${file}" | tr -s '/' | cut -c 3-);
    cp --parents --preserve=timestamps "${file}" /opt/src/wallet
done

After the sources are in /opt/src/wallet, GDB will start working as expected.

Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.