This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] add implementation of stack-info-frame MI command



See my post to GDB@. I think this should be handled as an event and not as a command.

The user entering a command like ``up'' needs to trigger the event notification anyway.

enjoy,
Andrew


While using the MI, I noticed that there is a real problem trying to find
the current stack level. One could get the stack and look at the level
value of the first frame or parse the results of a cli frame command,
but these both seem ugly. What is needed is a stack-info-frame that
returns the current stack level to complement the stack-select-frame
which selects a stack level.

Here is what I propose:

-stack-info-frame
^done,level="0"
(gdb)
-stack-select-frame 5
^done
(gdb)
-stack-info-frame
^done,level="5"
(gdb)

The stack-info-frame command is currently unimplemented
even though it appears in the documentation, so there is
no way this patch could break anything. The only objection
I could think of was that folks might want the command
to return all the info about the current frame, like the
stack-list-frames method. That is actually not needed since
one could always run stack-list-frames and then select
a stack level out of the returned frames. In real code,
it is better to query the whole stack as opposed to changing
the stack, doing a query of the current frame, changing the
stack, then doing a query, and so on.

I forgot to mention in my last patch that I sent in my FSF
copyright paperwork, so that should not stand in the way
of incorporating my patches any longer.

cheers
Mo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]