[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New function for gdb-ui.el?

From: Richard M. Stallman
Subject: Re: New function for gdb-ui.el?
Date: Wed, 26 Oct 2005 21:30:11 -0400

    I don't think I understand the issues.  I thought if I used the keyword 
    e.g "inline int mysquare (int x)", I would get an inline function.  Perhaps
    thats not the case because I can set a breakpoint, stop there and see 
    in the stack.

If you can do that, then it wasn't inlined.  At least, that call to
mysquare was not inlined.  (I don't remember any more whether GCC can
decide to inline some calls to a function and not inline other calls.)

    If I use -O2 or -O3 (gcc 3.4.4) then I can't stop there (because its 

Probably so.

Note that inlining can occur even with -O0.  I always compile Emacs
with -O0 -fno-inline to make sure nothing will be inlined.

    So how can "until" possibly proceed to there?

You may think think there's no there, there, but there is.  There is
code in the calling function that corresponds to mysquare.  GDB knows
where it is, as you'll see if you step thru that calling function.
(This may be easier to see if the inlined function contains several
function calls to unknown functions instead of just arithmetic.)

If you are in a function foo and you ask to go until a line in mysquare,
GDB should see if foo has any code that identifies itself as coming
from that line in mysquare, and it should put the temp breakpoint there.

If foo contains two inlined calls to mysquare, GDB should put a
temp breakpoint in each of them, so that the program will stop at
whichever one it reaches.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]