Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 216105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:31:59+00:00 2026-05-11T18:31:59+00:00

Can anyone tell me how to do runtime debugging on shared libraries? I need

  • 0

Can anyone tell me how to do runtime debugging on shared libraries?

I need to runtime-debug a function in my shared library, but its called by another program.
How can I do something like dbx with shared libraries?

I m using dbx on AIX.
is gdb better than dbx for what I m trying to do?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:32:00+00:00Added an answer on May 11, 2026 at 6:32 pm

    You just need to call gdb with the executable (it does not matter if it is yours or a 3rd party one). Here is an example where I debug the ls command and set a breakpoint in the (shared) c library. This example uses gdb 6.8 which supports deferred (pending) breakpoints which makes this easy:

    gdb /bin/ls
    GNU gdb 6.8-debian
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu"...
    (no debugging symbols found)
    (gdb) b write
    Function "write" not defined.
    Make breakpoint pending on future shared library load? (y or [n]) y
    Breakpoint 1 (write) pending.
    (gdb) r
    Starting program: /bin/ls
    (no debugging symbols found)
    (no debugging symbols found)
    (no debugging symbols found)
    (no debugging symbols found)
    (no debugging symbols found)
    (no debugging symbols found)
    (no debugging symbols found)
    [Thread debugging using libthread_db enabled]
    (no debugging symbols found)
    (no debugging symbols found)
    [New Thread 0x7f98d2d23780 (LWP 7029)]
    [Switching to Thread 0x7f98d2d23780 (LWP 7029)]
    
    Breakpoint 1, 0x00007f98d2264bb0 in write () from /lib/libc.so.6
    (gdb)
    

    As you can see gdb automatically manages all threads used by the executable. You don’t have to do anything special for threads there. The breakpoint will work in any thread.

    Alternatively if you want to attach the debugger to an already running application (I use tail -f /tmp/ttt here as an example):

    ps ux | grep tail
    lothar    8496  0.0  0.0   9352   804 pts/3    S+   12:38   0:00 tail -f /tmp/ttt
    lothar    8510  0.0  0.0   5164   840 pts/4    S+   12:39   0:00 grep tail
    
    gdb
    GNU gdb 6.8-debian
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu"...
    (no debugging symbols found)
    (gdb) attach 8496
    Attaching to program: /usr/bin/tail, process 8496
    Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
    Loaded symbols for /lib/librt.so.1
    Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
    Loaded symbols for /lib/libc.so.6
    Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
    [Thread debugging using libthread_db enabled]
    [New Thread 0x7f24853f56e0 (LWP 8496)]
    Loaded symbols for /lib/libpthread.so.0
    Reading symbols from /lib/ld-linux-x86-64.so.2...
    (no debugging symbols found)...done.
    Loaded symbols for /lib64/ld-linux-x86-64.so.2
    (no debugging symbols found)
    0x00007f2484d2bb50 in nanosleep () from /lib/libc.so.6
    (gdb) b write
    Breakpoint 1 at 0x7f2484d57bb0
    (gdb) c
    Continuing.
    [Switching to Thread 0x7f24853f56e0 (LWP 8496)]
    
    Breakpoint 1, 0x00007f2484d57bb0 in write () from /lib/libc.so.6
    (gdb)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 219k
  • Answers 219k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer beforeclose sounds like callback that calls a function before the… May 12, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer When the PHP interpreter exits it calls fclose() on all… May 12, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer Instead of giving a 'replication slave' privilege to ., I… May 12, 2026 at 11:43 pm

Related Questions

I'm trying to teach-myself how to serialize/deserialize to/from XML using the attribute-based serializer. I've
At runtime, I'd like to be able to unload a DLL and reload a
Ok, so coming from a background of mostly perl, and mostly writing dirty little
I have a dynamically created (runtime creation) textbox whose name is available as a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.