From: Thamil K <thamilk@gmail.com>
To: gdb@sourceware.org
Subject: GDB Stacktrace for optimized code!
Date: Tue, 20 Apr 2021 11:25:18 +0530 [thread overview]
Message-ID: <CAOUPoJ1zoPjfxaCb_JYvOEz96xyFGcVRCshVQQh1e5ugY0md4w@mail.gmail.com> (raw)
Hi Geeks,
For programs compiled with -O2, where the compiler uses 'jmp' where
possible instead of 'call' or where callee doesn't push $rbp onto the
stack, gdb is still able to generate stack trace properly. But by
inspecting the $rbp and return address, I am unable to trace back the
calls. I would like to know how gdb synthesises the stack trace ? Any
pointers on documentation? Thanks in advance.
Thanks
Thamil
next reply other threads:[~2021-04-20 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 5:55 Thamil K [this message]
2021-04-20 10:54 ` Hannes Domani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOUPoJ1zoPjfxaCb_JYvOEz96xyFGcVRCshVQQh1e5ugY0md4w@mail.gmail.com \
--to=thamilk@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).