Blog


GDB and Understand

About 1/2 our engineers program on Linux. A couple use the Mac. And the rest use Windows.

On Linux and the Mac it is quite common to have command line GDB session in use for debugging and to need to inspect or walk a call stack from the “where” command.  It is a bit of a pain to have these separated from Understand. And we may (if we can figure out the Windows side) add debugging support directly into Understand, but until here is a tip that makes working with GDB a bit easier.

With B465 you paste any text into a command result window (get one by choosing “Options->Run a command”).  Once pasted, we analyze it for file, line and entity names and it becomes clickable for Understand events and menus.

Here is a GDB call stack pasted in:

 Gdb_

Files and lines are identified so I can visit them in Understand, or right click and get information and graphs.

Also, with B465 we have made file detection much smarter. It will recognize short, relative and full path names and associate line numbers with them in any fashion a compiler or other tool can think to spit them out.

 


7 Responses to “GDB and Understand”

  1. Marc A. Criley Says:

    This ain’t workin’ for me (and I really want it too).
    I’m running U2.0 b467 installed on Linux, so I should be good here.
    You say I can get a command window by doing “Options -> Run a command”. Well, I have no “Options” menu, though I do have “Tools -> Run a command”. It doesn’t give me a command results window, though, until I do in fact run a command, so I do a “pwd” to bring that up.
    I should then be able to paste into that window, according to what’s said above. However, the results window appears to be view-only; I can’t paste anything into it.
    What am I missing here?
    Marc

  2. Ken Nelson Says:

    I think it was me that was missing something.
    I’d run a set of commands testing things before I did this particular entry, so I had a window up.
    For now, just issue a command, like ls or dir or just jibberish in that dialog and a command result window will pop up.
    And I’ll ask that we have a menu item added to show the command result window.
    Ken N.

  3. Sharath Says:

    I am not able to the output in a command window “for file, line and entity names and it becomes clickable”. How are you doing this? I am using Build 475 and am using it on windows. Just to add, i am not using this for GDB, but for another compiler. I just want to make the output clickable.

    Thanks a ton.
    Sharath

  4. Sharath Says:

    Sorry for the earlier comment. There was a typo so I am posting againg.
    I am not able to analyze the output in a command window “for file, line and entity names and it becomes clickable”. How are you doing this? I am using Build 475 and am using it on windows. Just to add, i am not using this for GDB, but for another compiler. I just want to make the output clickable.

    Thanks a ton.
    Sharath

  5. KevinG Says:

    Try the latest build, we just recently added a lot more flexibility to how the output lines were scanned for links. If that doesn’t work, let us know the format and we’ll see if we can add it.
    Regards,
    KevinG

  6. Domagoj Says:

    Hi,

    I get the following error in the Command Window:

    GNU gdb 6.8
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
    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-unknown-linux-gnu”…
    (gdb) Hangup detected on fd 0
    error detected on stdin

    What should I do to fix this?

    Thx. — D

  7. KevinG Says:

    Hi Domagoj,
    This error looks like it is output from whatever command that you’re running. I’m not sure what that is. If you want to send more detailed information about the command to support@scitools.com I’ll see what we can do to resolve it.
    Thanks,
    KevinG