Debug libtool program with gdb

libtool program is a shell script that can’t work with gdb.Here is an example:
$ ls -l check_ifnet
-rwxr-xr-x 1 gentoo gentoo 4269 Aug 18 20:46 check_ifnet
$file check_ifnet
check_ifnet: POSIX shell script text executable

For libtool programs, the shared libraries are put into .lib directory and that script sets up the running environment (See more information I find that many people manually copy the shared libraries for debugging purpose. That’s not quite convenient.

I have two ways to test these kind of programs with gdb:

  1. edit the program and change this line “exec “$progdir/$program” ${1+”$@”}” to “gdb “$progdir/$program” ${1+”$@”}”. Then run the program.
  2. libtool –mode=execute gdb your_program (This one is better)

, , ,

  1. #1 by trashbird1240 on September 10, 2010 - 12:44 am

    When I’m writing a libtool program, I specify “–disable-shared” during the configure step, and that way I can compile an actual ELF image.

  2. #2 by usenet on April 16, 2013 - 3:44 pm

    Great blog you have got here.. It’s hard to find high-quality writing like yours these days. I really appreciate individuals like you! Take care!!

  3. #3 by Marcia on July 2, 2013 - 10:28 am

    Hi! Do you know if they make any plugins to assist with Search Engine Optimization?
    I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good success. If you know of any please share.
    Many thanks!

  4. #4 by how to get pregnant quick on August 8, 2013 - 3:15 am

    Hello, I would like to subscribe for this blog to take
    newest updates, thus where can i do it please help.

  5. #5 by open relationship means on June 26, 2014 - 9:20 am

    Its like you learn my mind! You appear to know so much approximately this, like you wrote the ebook in it or something.
    I believe that you simply can do with some % to power
    the message home a bit, however other than that, that is magnificent blog.
    A fantastic read. I will certainly be back.

  1. Diy Funny Life
  2. Valgrind – Your Memory Assistant « Mu Qiao's Blog
  3. abusive relationships abusive relationships signs abusive relationships stories abusive relationships quotes abusive relationships hotline abusive relationships quiz abusive relationships tumblr abusive relationships movies abusive relationships articles

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: