gdb on the Mac

  • Hi all,

    when I use gdb on the Mac (10.2) I get stack traces like this

    ...
    #14 0x930f9f5c in -[NSApplication sendAction:to:from:] ()
    #15 0x9316f638 in -[NSMenu performActionForItemAtIndex:] ()
    #16 0x931afd48 in -[NSCarbonMenuImpl
    performActionWithHighlightingForItemAtIndex:] ()
    #17 0x932bae48 in -[NSMenu performKeyEquivalent:] ()
    #18 0x930a8efc in -[NSApplication sendEvent:] ()
    #19 0x930b2418 in -[NSApplication run] ()
    #20 0x931605cc in NSApplicationMain ()
    #21 0x00002ea4 in _start ()
    #22 0x00002d24 in start ()

    It gives me no line numbers!

    gdb -v
    GNU gdb 5.1-20020408 (Apple version gdb-228) (Sun Jul 14 10:07:24 GMT
    2002)
    Copyright 2002 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for
    details.
    This GDB was configured as "powerpc-apple-macos10".

    On my Solaris box it gives me line numbers which helps a lot. Here I use

    -bash-3.00$ gdb -v
    GNU gdb 6.3.50.20051117
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for
    details.
    This GDB was configured as "sparc-sun-solaris2.10".

    Can I convince the Apple gdb to generate line numbers as well?

    Thanks a lot!

    Regards,

      Andreas
  • On Nov 17, 2007, at 5:31 AM, Andreas Höschler wrote:

    > Hi all,
    >
    > when I use gdb on the Mac (10.2) I get stack traces like this
    >
    > ...
    > #14 0x930f9f5c in -[NSApplication sendAction:to:from:] ()
    > #15 0x9316f638 in -[NSMenu performActionForItemAtIndex:] ()
    > #16 0x931afd48 in -[NSCarbonMenuImpl
    > performActionWithHighlightingForItemAtIndex:] ()
    > #17 0x932bae48 in -[NSMenu performKeyEquivalent:] ()
    > #18 0x930a8efc in -[NSApplication sendEvent:] ()
    > #19 0x930b2418 in -[NSApplication run] ()
    > #20 0x931605cc in NSApplicationMain ()
    > #21 0x00002ea4 in _start ()
    > #22 0x00002d24 in start ()
    >
    > It gives me no line numbers!
    >
    > Can I convince the Apple gdb to generate line numbers as well?

    Well you aren't going to get line numbers for code that isn't yours
    unless that information is included in the executable or an associated
    dSYM file. The above lists all Apple code.

    If you are talking about not seeing line numbers for your code then
    the answer depends on debug symbol format you are using, how you may
    or may not strip your applications, the use of dSYM file, and even
    when you are attempting to debug it (debugger from Xcode, etc.).

    -Shawn_______________________________________________
    MacOSX-dev mailing list
    <MacOSX-dev...>
    http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • you should try:
    info threads

    and from the resulting thread list you might see the first known
    function/method from your code.
    pick the number and try:
    thread <picked thread num>

    then:
    where

    does that help?

    Andreas Höschler <ahoesch...>
    Sent by: <macosx-dev-bounces...>
    17.11.2007 14:35

    To
    <macosx-dev...>
    cc

    Subject
    gdb on the Mac

    Hi all,

    when I use gdb on the Mac (10.2) I get stack traces like this

    ...
    #14 0x930f9f5c in -[NSApplication sendAction:to:from:] ()
    #15 0x9316f638 in -[NSMenu performActionForItemAtIndex:] ()
    #16 0x931afd48 in -[NSCarbonMenuImpl
    performActionWithHighlightingForItemAtIndex:] ()
    #17 0x932bae48 in -[NSMenu performKeyEquivalent:] ()
    #18 0x930a8efc in -[NSApplication sendEvent:] ()
    #19 0x930b2418 in -[NSApplication run] ()
    #20 0x931605cc in NSApplicationMain ()
    #21 0x00002ea4 in _start ()
    #22 0x00002d24 in start ()

    It gives me no line numbers!

    gdb -v
    GNU gdb 5.1-20020408 (Apple version gdb-228) (Sun Jul 14 10:07:24 GMT
    2002)
    Copyright 2002 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for
    details.
    This GDB was configured as "powerpc-apple-macos10".

    On my Solaris box it gives me line numbers which helps a lot. Here I use

    -bash-3.00$ gdb -v
    GNU gdb 6.3.50.20051117
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for
    details.
    This GDB was configured as "sparc-sun-solaris2.10".

    Can I convince the Apple gdb to generate line numbers as well?

    Thanks a lot!

    Regards,

      Andreas

    _______________________________________________
    MacOSX-dev mailing list
    <MacOSX-dev...>
    http://www.omnigroup.com/mailman/listinfo/macosx-dev
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today