public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/30784] Single stepping until exit from function _ZN6shibsp8SPConfig4initEPKcS2_@plt, which has no line number information
Date: Mon, 21 Aug 2023 19:41:47 +0000	[thread overview]
Message-ID: <bug-30784-4717-QAoOpvHUMR@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30784-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30784

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
(In reply to nelakurthi koteswararao from comment #0)
> Hi
> 
> built shibboleth-sp-3.3.0 package by passing '-g' option to enable debug
> symbols.
> but gdb fails with below error when break point is set in SPConfig::init()
> (shibboleth-sp-3.3.0/shibsp/SPConfig.cpp)
> {{
> (gdb) n
> 
> Thread 1 "dbd" hit Breakpoint 3, 0x00007ffff132bf50 in
> shibsp::SPConfig::init(char const*, char const*)@plt () from
> /lib64/libshibsp-lite.so.10
> (gdb) n
> Single stepping until exit from function _ZN6shibsp8SPConfig4initEPKcS2_@plt,
> which has no line number information.
> 0x00007ffff1329020 in ?? () from /lib64/libshibsp-lite.so.10
> }}
> libs build using shiboleth-sp-3.3.0 are given below.
> {{
> lrwxrwxrwx 1 root root       24 Aug 20 05:48 libshibsp-lite.so ->
> libshibsp-lite.so.10.0.3
> lrwxrwxrwx 1 root root       24 Aug 20 05:48 libshibsp-lite.so.10 ->
> libshibsp-lite.so.10.0.3
> -rwxr-xr-x 1 root root 24714944 Aug 20 05:48 libshibsp-lite.so.10.0.3
> lrwxrwxrwx 1 root root       19 Aug 20 05:47 libshibsp.so ->
> libshibsp.so.10.0.3
> lrwxrwxrwx 1 root root       19 Aug 20 05:47 libshibsp.so.10 ->
> libshibsp.so.10.0.3
> -rwxr-xr-x 1 root root 57520408 Aug 20 05:47 libshibsp.so.10.0.3
> }}
> shibboleth-sp-3.3.0/shibsp$ file .libs/libshibsp.so.10.0.3
> .libs/libshibsp.so.10.0.3: ELF 64-bit LSB shared object, x86-64, version 1
> (GNU/Linux), dynamically linked, with debug_info, not stripped
> 
> shibsp$ file .libs/libshibsp-lite.so.10.0.3
> .libs/libshibsp-lite.so.10.0.3: ELF 64-bit LSB shared object, x86-64,
> version 1 (GNU/Linux), dynamically linked, with debug_info, not stripped
> shibboleth-sp-3.3.0/shibsp$
> }}
> is it required to load above so file using gdb command before setting
> breakpoint ? or symbol links to .so files is causing failure?
> any insight in to the isuse?
> 
> regards
> koti

The other problem I can see is that you are stopped at
shibsp::SPConfig::init(char const*, char const*)@plt, not
shibsp::SPConfig::init(char const*, char const*).  The @plt symbol is a special
symbol resolver function called the first time the function is called, to
resolve which version of the function to use (in the context of shared
libraries where there might be multiple).

Normally, when you put a breakpoint on shibsp::SPConfig::init, GDB should _not_
put a breakpoint on the corresponding @plt function.  But it sometimes makes a
mistake and does put a breakpoint there, meaning that execution will stop on
the @plt function first.  If that happens, continue the execution again, that
should make you stop on the real shibsp::SPConfig::init function.

A problem like this was fixed in this commit, for example:
https://gitlab.com/gnutools/binutils-gdb/-/commit/f0bdf68d3fb6db1dd2b83e07062e2104cdb785c2

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-08-21 19:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 16:11 [Bug c++/30784] New: " koteswararao18 at gmail dot com
2023-08-20 16:13 ` [Bug c++/30784] " koteswararao18 at gmail dot com
2023-08-21  1:44 ` simark at simark dot ca
2023-08-21  3:04 ` koteswararao18 at gmail dot com
2023-08-21 19:35 ` tromey at sourceware dot org
2023-08-21 19:41 ` simark at simark dot ca [this message]
2023-08-22 14:16 ` koteswararao18 at gmail dot com
2023-08-22 15:08 ` simark at simark dot ca

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=bug-30784-4717-QAoOpvHUMR@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).