mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 19:19:44 +03:00
Kernel: Print all logbuffer from ConsoleDevice to debug Virtual Console
This commit is contained in:
parent
2e565f1b8a
commit
dbccfc3281
Notes:
sideshowbarker
2024-07-18 18:00:18 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/dbccfc32812 Pull-request: https://github.com/SerenityOS/serenity/pull/6277 Reviewed-by: https://github.com/ElectrodeYT Reviewed-by: https://github.com/awesomekling
@ -38,6 +38,11 @@ UNMAP_AFTER_INIT ConsoleManagement::ConsoleManagement()
|
|||||||
UNMAP_AFTER_INIT void ConsoleManagement::initialize()
|
UNMAP_AFTER_INIT void ConsoleManagement::initialize()
|
||||||
{
|
{
|
||||||
for (size_t index = 0; index < 4; index++) {
|
for (size_t index = 0; index < 4; index++) {
|
||||||
|
// FIXME: Better determine the debug TTY we chose...
|
||||||
|
if (index == 1) {
|
||||||
|
m_consoles.append(VirtualConsole::create_with_preset_log(index, ConsoleDevice::the().logbuffer()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
m_consoles.append(VirtualConsole::create(index));
|
m_consoles.append(VirtualConsole::create(index));
|
||||||
}
|
}
|
||||||
// Note: By default the active console is the first one.
|
// Note: By default the active console is the first one.
|
||||||
|
@ -116,10 +116,12 @@ UNMAP_AFTER_INIT NonnullRefPtr<VirtualConsole> VirtualConsole::create(size_t ind
|
|||||||
return adopt_ref(*new VirtualConsole(index));
|
return adopt_ref(*new VirtualConsole(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
|
UNMAP_AFTER_INIT NonnullRefPtr<VirtualConsole> VirtualConsole::create_with_preset_log(size_t index, const CircularQueue<char, 16384>& log)
|
||||||
: TTY(4, index)
|
{
|
||||||
, m_index(index)
|
return adopt_ref(*new VirtualConsole(index, log));
|
||||||
, m_console_impl(*this)
|
}
|
||||||
|
|
||||||
|
UNMAP_AFTER_INIT void VirtualConsole::initialize()
|
||||||
{
|
{
|
||||||
m_tty_name = String::formatted("/dev/tty{}", m_index);
|
m_tty_name = String::formatted("/dev/tty{}", m_index);
|
||||||
VERIFY(GraphicsManagement::the().console());
|
VERIFY(GraphicsManagement::the().console());
|
||||||
@ -138,6 +140,25 @@ UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
|
|||||||
VERIFY(m_cells);
|
VERIFY(m_cells);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
|
||||||
|
: TTY(4, index)
|
||||||
|
, m_index(index)
|
||||||
|
, m_console_impl(*this)
|
||||||
|
{
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index, const CircularQueue<char, 16384>& log)
|
||||||
|
: TTY(4, index)
|
||||||
|
, m_index(index)
|
||||||
|
, m_console_impl(*this)
|
||||||
|
{
|
||||||
|
initialize();
|
||||||
|
for (auto& ch : log) {
|
||||||
|
echo(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT VirtualConsole::~VirtualConsole()
|
UNMAP_AFTER_INIT VirtualConsole::~VirtualConsole()
|
||||||
{
|
{
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static NonnullRefPtr<VirtualConsole> create(size_t index);
|
static NonnullRefPtr<VirtualConsole> create(size_t index);
|
||||||
|
static NonnullRefPtr<VirtualConsole> create_with_preset_log(size_t index, const CircularQueue<char, 16384>&);
|
||||||
|
|
||||||
virtual ~VirtualConsole() override;
|
virtual ~VirtualConsole() override;
|
||||||
|
|
||||||
@ -85,7 +86,8 @@ public:
|
|||||||
void emit_char(char);
|
void emit_char(char);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VirtualConsole(const unsigned index);
|
explicit VirtualConsole(const unsigned index);
|
||||||
|
VirtualConsole(const unsigned index, const CircularQueue<char, 16384>&);
|
||||||
// ^KeyboardClient
|
// ^KeyboardClient
|
||||||
virtual void on_key_pressed(KeyEvent) override;
|
virtual void on_key_pressed(KeyEvent) override;
|
||||||
|
|
||||||
@ -119,6 +121,8 @@ private:
|
|||||||
RecursiveSpinLock m_lock;
|
RecursiveSpinLock m_lock;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void initialize();
|
||||||
|
|
||||||
void invalidate_cursor(size_t row);
|
void invalidate_cursor(size_t row);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user