This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug python/18567] Frame filters apply to 'backtrace' but not 'frame' command


https://sourceware.org/bugzilla/show_bug.cgi?id=18567

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Phil Muldoon from comment #2)

> I'm not sure how a frame filter can apply to a single line of output?

I think the simplest way here is to start the frame iteration process
at the selected frame (not the newest frame); and then just request a
single frame from the iterator and print that.

> If one frame is only ever
> printed (regardless, say, if the iterator had more than one), then a frame
> filter is not needed: there's nothing to filter. Perhaps we could apply a
> single frame decorator? 

Yeah, just request one from the iteration process.

A frame filter may choose to consume multiple frames in order to do its
filtering.  That's ok though.

The concrete case for SpiderMonkey is that the JIT unwinder has found
some frames -- but we don't add any display information from the unwinder
(you really just can't and anyway if you could it is too hard anyway);
so all the user-useful information is delegated to the frame filter.

In this case the frame filter is always 1:1 with underlying frames,
though of course there's no reason to restrict things in this way.

> However, that would be a pain as previously written frame filters that would
> apply to backtraces would have to adapt to just returning one frame for
> these and other commands.

Well-written frame filters are supposed to be lazy already.
And, even if they aren't, it doesn't matter, since gdb can always
choose exactly what it prints.

One way to look at this is that "bt" is paginated and nothing breaks
if we don't print every single frame in the stack every time.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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