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: backtrace changes current source location


Thanks!

Felix Lee wrote:
Andrew Cagney <cagney@gnu.org>:

Can you find out why selected sal is being corrupted, code shouldn't be modifying it.


this is happening in stack.c:print_frame_info().  any time
information about a frame is printed, sal is set to that frame's
location.  the motivation for that change was an MI issue where
sal didn't get set when it should be.

it seems reasonable to me to always set sal when a frame gets
printed, but this is inconvenient in the case of backtraces.
backtraces seem like an exception, rather than a flaw in the
general strategy, which is why I chose to save/restore sal in
backtrace.

Should:


(gdb) info frame 5

change things to frame 5's sal?

my feeling is that sal is a user convenience for reducing typing,
and programs talking to gdb should not depend on it being
predictable, since it's easy for a program to specify precisely
what source location they're interested in.  but I don't feel
strongly about that.

Right.


MI and/or CLI should locally determine current-sal, and pass it down to print_frame_info.

I'll submit a new patch with the changes
you suggest.

I'm actually not yet suggesting anything yet :-). I'm just trying to understand why two ends of GDB end up fighting over what the value of current-sal should be :-(


Lets get the testcase in.

Andrew


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