Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jesse Marlin <jesse.marlin@intec.us>
To: Jack J <get_info101@yahoo.com>
Cc: gdb@sources.redhat.com
Subject: debug dynamically linked modules..
Date: Thu, 16 Oct 2003 20:24:00 -0000	[thread overview]
Message-ID: <16270.65162.505380.573926@bass.compgen.com> (raw)
In-Reply-To: <20031016193935.98962.qmail@web20507.mail.yahoo.com>

Jack J writes:
 > Hi,
 > 
 > I would like to know how to debug using gdb
 > (set breakpoint on routine, etc.) a dynmically linked,
 > relocated code.
 > 
 > The platform is RH Linux 9.0. There is some
 > application
 > module compiled with -fPIC and -shared, and
 > -export-dynamic options.  
 > A global structure containing functions is exported by
 > the DLL module.
 > The problem: I would like to set breakpoint on one
 > of the (file static) functions contained in this
 > structure.
 > 
 > >From mainline code after call to dlsym(..) (to the
 > global structure), I try to set break point, and I
 > get error: "Function xxx not defined.".
 > 
 > I do 'info shared' on gdb and do see the file being
 > loaded. Also I do see that "-g" option to add
 > debug symbols in gcc.
 > 
 > Is there anything I am missing ? How does one 
 > normally use gdb in such scenario ?
 > 
 > Any tips, pointers/hints is appreciated.
 > 
 > Thanks,

One thing I do that is successful most of the time is place a
breakpoint on a file:line instead of on a function.  Try looking into
these:

br file:line       - place a breakpoint on a file and line number.
                     C-x SPC does this for you in (X)Emacs.

info shared        - shows which shared libraries are currently loaded.

(gdb) help sharedlibrary
Load shared object library symbols for files matching REGEXP.


  parent reply	other threads:[~2003-10-16 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16 19:39 Jack J
2003-10-16 19:44 ` Daniel Jacobowitz
2003-10-16 20:24 ` Jesse Marlin [this message]
2003-10-17  0:11   ` Jack J
2003-10-17  7:11 ` Izo

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=16270.65162.505380.573926@bass.compgen.com \
    --to=jesse.marlin@intec.us \
    --cc=gdb@sources.redhat.com \
    --cc=get_info101@yahoo.com \
    /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