Page MenuHomeFreeBSD

Make the 'q' in ddb(4) pager actually abort the output
AbandonedPublic

Authored by trasz on Nov 23 2017, 12:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 7:49 PM
Unknown Object (File)
Apr 27 2024, 11:34 AM
Unknown Object (File)
Apr 19 2024, 1:34 PM
Unknown Object (File)
Dec 23 2023, 11:37 PM
Unknown Object (File)
Dec 23 2023, 12:59 AM
Unknown Object (File)
Nov 1 2023, 11:59 AM
Unknown Object (File)
Aug 20 2023, 5:45 PM
Unknown Object (File)
May 6 2023, 8:57 AM
Subscribers

Details

Reviewers
jhb
Summary

Make the 'q' in ddb(4) pager actually abort the output, instead
of printing all the remaining lines without paging.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12977
Build 13232: arc lint + arc unit

Event Timeline

This is not inline with how db_pager_quit works where individual commands check the flag in loops. Is there a specific command you are using that doesn't honor 'q'? Several commands such as 'show ktr', 'show irq', etc. do honor it.

sys/ddb/db_output.c
253

See comment here which documents the current usage.

Oh wow, it's been a year now. Anyway - I still do want to upstream it :-)

Now - I understand how db_pager_quit works right now. There are two reasons for the diff:

  1. Some of the places which check for it are not precise to the line. In other words - you press 'q' and still get a few lines more. It's mostly a cosmetic issue, though.
  1. Some places just fail to check for it. And you usually only realise it when you're trying to use it and then wait for minutes until the whole thing scrolls to the end. It's incredibly annoying. Sure, I can fix each of those, but honestly - handling it in db_printf() is just easier, there are no places to miss, and it won't rot over time.

Note that I don't intend to get rid of the existing behaviour - it's just it removes it to be an optimization, for the commands to exit early instead of trying to printf stuff that won't make it into the actual output.