Professional Web Applications Themes

Debugging with PB... - Mac Programming

I have a Mach-O application that I'm trying to debug. I haven't really touched gdb since college, but I was trying to use the PB debugger (which is just gdb with a UI, as far as I can tell). The problem is, I can't get it to work. The application runs, but none of my breakpoints are respected. I can't get it to show me any functions, data, etc. My guess is because the application has several threads, but still, shouldn't the breakpoints work, or only if I'm looking at the right thread? In GCC Compiler Settings, I have "Generate ...

  1. #1

    Default Debugging with PB...

    I have a Mach-O application that I'm trying to debug. I haven't really
    touched gdb since college, but I was trying to use the PB debugger (which is
    just gdb with a UI, as far as I can tell).

    The problem is, I can't get it to work. The application runs, but none of
    my breakpoints are respected. I can't get it to show me any functions,
    data, etc. My guess is because the application has several threads, but
    still, shouldn't the breakpoints work, or only if I'm looking at the right
    thread?

    In GCC Compiler Settings, I have "Generate debugging symbols" and "No
    optimization; very debuggable" both set.

    Still, I can't debug anything...what am I doing wrong? Also, how can I run
    (and debug) something as root?

    -Mike

    Mike Guest

  2. #2

    Default Re: Debugging with PB...

    In article <BBB9C1D8.297BA%org>,
    "Mike H." <org> wrote:
     

    The only thing I can think of, are you still using "Run"? This is what
    it sounds like. In PB, there's two separate menu items, Run and Debug.
    Run does not run your program in the debugger and any breakpoints you
    set will have no effect. Debug does, and that's what you need to use.

    Multiple threads have no effect, and almost all OS X applications have
    multiple threads anyway. Even if you don't create them, Cocoa (and
    probably Carbon but I don't really know) will create some anyway.

    If you are using Debug, then I don't know.

    Running something as root, the only way I know is to use the sudo
    command. You should be able to debug as root by running gdb with sudo,
    but I don't know how you could use PB's front-end that way.
    Michael Guest

  3. #3

    Default Re: Debugging with PB...

    Thanks for the quick response. I'm definitely using the Debug button, and
    the debugger comes up. I can only get into something if I press the Pause
    button and then look around, but not all details are available to me...and
    it's still completely missing all the breakpoints.

    Thanks,

    Mike

    in article mail-41C18D.23260720102003localhost, Michael Ash at
    com wrote on 10/20/03 5:26 PM:
     


    Mike Guest

  4. #4

    Default Re: Debugging with PB...

    In article <BBB9CD6D.297CF%org>,
    "Mike H." <org> wrote:
     

    Have you done a clean build? Most changes in the target settings require
    a clean build to take effect completely. Changing things like debug
    symbols or the optimization level require that the entire project be
    recompiled, but PB is too dense to tell you that.
    Michael Guest

  5. #5

    Default Re: Debugging with PB...

    I did a clean build, but it still didn't help. PB literally shows
    *nothing*...it should only run until the first breakpoint, which is in main,
    but it breezes by there and doesn't stop until I hit the Pause button. Then
    if I hit step (or anything) it just goes back to running...

    There are four threads and none of them give me any information.

    I've actually had the same problem when trying to debug this with gdb...

    Very odd...

    -Mike

    in article mail-A579E5.08535821102003localhost, Michael Ash at
    com wrote on 10/21/03 2:53 AM:
     
    >
    > Have you done a clean build? Most changes in the target settings require
    > a clean build to take effect completely. Changing things like debug
    > symbols or the optimization level require that the entire project be
    > recompiled, but PB is too dense to tell you that.[/ref]


    Mike Guest

  6. #6

    Default Re: Debugging with PB...

    In article <BBBAD1DA.29850%org>,
    "Mike H." <org> wrote:
     

    When you say none of the threads give you any information, does this
    mean you're not even getting the current call stack for them? If so,
    that's very wrong, you should always get some kind of call stack, even
    with optimizations and no debug symbols.

    In case your problem could be caused by optimizations, I just remembered
    that, by default, your build style optimization setting overrides the
    setting in your build settings, so that changing your optimization level
    with the popup menu doesn't actually do anything. You have to go to your
    Development or Deployment (depending on which one you're using...) build
    style and change or delete the flag there. Or something. But the
    Development style by default has no optimizations.

    It's starting to sound like your gdb is somehow broken. Maybe you should
    reinstall it or something, but I don't know.
    Michael Guest

  7. #7

    Default Re: Debugging with PB...

    Michael Ash <com> wrote in message news:<mail-2CE9D1.20211521102003localhost>... 
    >
    > When you say none of the threads give you any information, does this
    > mean you're not even getting the current call stack for them? If so,
    > that's very wrong, you should always get some kind of call stack, even
    > with optimizations and no debug symbols.
    >
    > In case your problem could be caused by optimizations, I just remembered
    > that, by default, your build style optimization setting overrides the
    > setting in your build settings, so that changing your optimization level
    > with the popup menu doesn't actually do anything. You have to go to your
    > Development or Deployment (depending on which one you're using...) build
    > style and change or delete the flag there. Or something. But the
    > Development style by default has no optimizations.
    >
    > It's starting to sound like your gdb is somehow broken. Maybe you should
    > reinstall it or something, but I don't know.[/ref]

    The other thing to try is to create a brand new project, say a
    Standard Tool (hello world) and put a breakpoint in that and see if
    you can halt there. I can verify that multiple threads work fine.
    When it halts on a breakpoint (I hope you figure that one out) there
    is a dropdown menu above the stack frame window that lists the threads
    and when you pick one it shows that stack frame, the editor window
    then switches to the PC for that thread.

    --jim
    Jim Guest

  8. #8

    Default Re: Debugging with PB...

    In article <BBB9C1D8.297BA%org>,
    "Mike H." <org> wrote:
     

    That's what I was going to ask. Having set those options like
    that, have you used the broom icon to trash the existing
    object files and then recompiled the application ?

    What's your application written in ? Is it C or C++ ?


    Simon Guest

Similar Threads

  1. Debugging output does not appear when use Debugging IPAddresses
    By Schroeder2 in forum Coldfusion Server Administration
    Replies: 2
    Last Post: June 7th, 11:15 PM
  2. Debugging
    By Andrew Durstewitz in forum ASP
    Replies: 15
    Last Post: May 10th, 02:53 AM
  3. VI Debugging
    By Scott in forum ASP
    Replies: 1
    Last Post: October 22nd, 12:28 PM
  4. debugging
    By Pete in forum PERL Miscellaneous
    Replies: 2
    Last Post: September 21st, 02:04 AM
  5. debugging with gdb
    By Paul Pluzhnikov in forum UNIX Programming
    Replies: 0
    Last Post: August 5th, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139