gdb can suck it

I swear, the last time gdb worked right was in 1991 on SunOS 4.1.3.

    % gdb foo
    [ ... 7 lines of worthless RMS ranting elided ... ]
    (gdb) r
    Starting program: foo
    [New Thread 8192 (LWP 3056)]
    Cannot find user-level thread for LWP 3056: generic error
    (gdb) quit
    The program is running. Exit anyway? (y or n) y
    Cannot find thread 8192: generic error
    (gdb) k
    Kill the program being debugged? (y or n) y
    Cannot find thread 8192: generic error
    (gdb) quit
    The program is running. Exit anyway? (y or n) y
    Cannot find thread 8192: generic error
    (gdb) ^Z

    Suspended
    % kill %
    % ^M
    [4]    Terminated                    gdb foo
Tags: , ,

13 Responses:

  1. fksche says:

    TV Party? Come on ...

    Worst Black Flag song ever

  2. inoshiro says:

    Isn't there a non-crazy debugger you can use for threaded applications? AFAIK, getting gdb to actually work with multiple threads of execution is still black magic.

    • deviant_ says:

      Well, it should be fixed at least for the NPTL case, but unfortunately that largely means "in the future" :/

    • jwz says:

      My program doesn't even use threads -- apparently this bullshit now comes along for the ride uninvited if you use X and/or OpenGL. Yay progress.

      • midendian says:

        If any of the libraries you link with were linked with -lpthread or -pthread (wierd gcc option), gdb thinks you use threads. Really stupid.

  3. ch says:

    Ahh, SunoS 4.1.3. I remember that release. It was good. (Then Solaris happened ...)

  4. harryh says:

    I'm really sorry, but I couldn't resist.

  5. moof says:

    Mmmm, lightweight processes. Now that there's mostly-compatible POSIX specs, there had to be something else that's still gratuitously incompatible. Trying to get the "all the world's a lignux box" threaded code to work on any other OS is Not Fun.

  6. gile says:

    On QNX (which is probably harmful to my heatlh, but whatever...) gdb refuses to do ANYTHING. The only time I can use it is to look at core dumps. gdb doesn't support threads, yet QNX is fully threaded.

    (gdb) r
    Starting program: /u/gile/phaim2/src/gcc_ntox86_gpp.phaim/phaim2
    [immediately returns here]
    (gdb) q
    The program is running. Exit anyway? (y or n) y

    I think someone was asleep when they decided to include gdb, broken like all other versions.

  7. nerpdawg says:

    gdb -q

    If only it worked irl..