wingolog

libtool + gdb, a cure for pain

15 October 2008 9:27 AM (libtool | gdb | hack)

I finally got tired of misinchanting "gdb mumble .libs lt --args foo bar mumble" and dropped this into my ~/bin as lgdb:

#!/bin/bash
prog=$1
shift
exec gdb --args $(dirname $prog)/.libs/lt-$(basename $prog) "$@"

I am aware of the libtool gdb idiom, but that appears to have been deprecated. There is a current of thought within autotools people that abhors concision. I do not understand it.

(As long as I'm ranting, I wish that libtool would make the shell script + relinking case secondary to the binary case, if it is at all necessary.)

I hope this post is as superfluous as the last, for the world if not for my ego.

15 responses

  1. James Henstridge says:

    The following should work: "libtool --mode=execute gdb programname". This is what "libtool gdb" was shorthand for, and I'd be surprised if they removed the --mode=execute feature.

    Given that it acts a a pure prefix, you could use it as an alias rather than a shell script.

  2. lamby says:

    That's not a shell script, it's a Bash script.

  3. Dan Winship says:

    > (As long as I'm ranting, I wish that libtool would make the shell script + relinking case secondary to the binary case, if it is at all necessary.)

    It's necessary if you're building a library that you already have installed, because if you don't set LD_LIBRARY_PATH, the newly-built program will dynamically link against /usr/lib/libmumble.so rather than ../libmumble/.libs/libmumble.so like you wanted.

    Then again, maybe if you build with --enable-maintainer-mode, it could just build the working-directory copy with the mangled library path automatically, and then relink it with the standard library path only when you do "make install"...

    Anyway, knowing the "libtool --mode=execute" idiom is useful because you can use it with things other than gdb too (strace, valgrind, etc).

  4. Andy Wingo says:

    James, you're right as usual -- I should probably use that instead of poking .libs. It will also take care of making sure that the lt-foo is there, as it is not there until it is first run.

    Dan, it seems that once the lt-foo executable is created, it is indeed linked to the in-tree libs. So there does not actually seem to be a need for the shell script at all, given that libtool controls the installation process and can relink then anyway. (AM_MAINTAINER_MODE is sortof-deprecated too, in case you hadn't heard.)

    Lamby. Picking nits is entertaining but you must take more care. Your statement is vague ("That"? I assume you refer to my script?), incorrect (Bash is indeed a shell), and misguided (I never called it a shell script).

  5. BenoƮt Dejean says:

    Or use Nemiver !

  6. Baptiste says:

    Yep, Nemiver supports libtool wrapper in latest release.

  7. Will Thompson says:

    Andy: I think Lamby was picking James' nits, not yours. :)

  8. Andy Wingo says:

    Will: Are you picking my nits? ;-)

  9. dissertation writer says:

    Congratulations to all who were honored a scholarship! The awards given at college or university are like signals that you belonged to the best society circles and managed to become a part of the smart people society who provide help to students who desperately need it.

  10. YO YO says:
  11. dasdsadsa says:
  12. ADIL says:

    River map of United statesRiver map of United statesRiver map of United statesRiver map of United statesPrintable calendar 2017Printable calendar 2017Printable calendar 2017Printable calendar 2017Printable calendar 2017Printable calendar 2017Free Printable calendar 2017

    Free Printable calendar 2017Free Printable calendar 2017Free Printable calendar 2017Free Printable calendar 2017Free Printable calendar 2017Free calendar TemplatesFree calendar Templates

    Free calendar TemplatesFree calendar TemplatesFree calendar TemplatesFree calendar TemplatesFree calendar TemplatesFree calendar TemplatesFree 2017 calendar Templates

    Free 2017 calendar TemplatesFree 2017 calendar TemplatesFree 2017 calendar TemplatesFree 2017 calendar TemplatesFree 2017 calendar Templates

    printable calendars printable calendars printable calendars printable calendar printable black calendars printable black calendars printable black calendars printable indian calendars printable us calendars printable us calendars printable calendars us printable calendars indian printable calendars print us calendars

    This is an excellent post i seen.I have to thanks to you to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.

  13. james clark says:

    Valentine's Day, also called Saint Valentine's Day or the Feast of Saint Valentine, valentines day is an annual holiday celebrated on February 14. valentines day messages It originated as a Western Christian liturgical feast day honoring one or more early saints named Valentinus, and is recognized as a significant cultural and commercial celebration in many regions around the world, happy valentines day quotes although it is not a public holiday in any country. Valentine's Day is celebrated on February 14 Valentine's Day is also a very popular date for weddings..It is a festival of romantic love and many people give cards, letters, flowers or presents to their spouse or partner. They may also arrange a romantic meal in a restaurant or night in a hotel. Common symbols of Valentine's Day are hearts, red roses and Cupid.The most common happy valentines day images Valentine's Day symbols are the heart, particularly in reds and pinks, and pictures or models of Cupid. Cupid is usually portrayed as a small winged figure with a bow and arrow.Many people celebrate their love for their partner by sending cards or letters, giving gifts or flowers and arranging meals in restaurants or romantic nights in hotels. People who would like to have a romantic relationship with somebody may use the occasion to make this known, often anonymously. Valentine's cards are often decorated with images of hearts, red roses or Cupid. Common Valentine's Day gifts are flowers chocolates, candy, lingerie and champagne or sparkling wine

  14. More Info says:

    how to get followers on instagram ? With one click at our site.

  15. happy valentines day says:

    Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.happy valentines day poemshappy valentine's day smshappy valentines day imageshappy valentines day quotes

Leave a Reply