The Pedigree Project 0.1
SyscallTracerCommand.cc
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include "pedigree/kernel/debugger/commands/SyscallTracerCommand.h"
21
23
24SyscallTracerCommand::~SyscallTracerCommand() {}
25
27
29 InterruptState& state, DebuggerIO* pScreen) {
30 // Let's enter 'raw' screen mode.
31 pScreen->disableCli();
32
33 // Initialise the Scrollable class
34 move(0, 1);
35 resize(pScreen->getWidth(), pScreen->getHeight() - 2);
36 setScrollKeys('j', 'k');
37
38 // Clear the top status lines.
39 pScreen->drawHorizontalLine(' ', 0, 0, pScreen->getWidth() - 1, DebuggerIO::White,
40 DebuggerIO::Green);
41
42 // Write the correct text in the upper status line.
43 pScreen->drawString("Pedigree debugger - System Call Tracer", 0, 0, DebuggerIO::White,
44 DebuggerIO::Green);
45
46 // Main loop.
47 bool bStop = false;
48 while (!bStop) {
49 refresh(pScreen);
50
51 // Wait for input.
52 char c = 0;
53 while (!(c = pScreen->getChar()))
54 ;
55
56 if (c == 'q')
57 bStop = true;
58 }
59
60 // Return to the debugger
61 return (true);
62}
63
64const char* SyscallTracerCommand::getLine1(size_t index, DebuggerIO::Colour& colour,
65 DebuggerIO::Colour& bgColour) {
66 return (0);
67}
68
69const char* SyscallTracerCommand::getLine2(size_t index, size_t& colOffset,
70 DebuggerIO::Colour& colour,
71 DebuggerIO::Colour& bgColour) {
72 return (0);
73}
74
75size_t SyscallTracerCommand::getLineCount() {
76 return (0);
77}
virtual void drawString(const char *str, size_t row, size_t col, Colour foreColour, Colour backColour)=0
virtual size_t getWidth()=0
virtual void drawHorizontalLine(char c, size_t row, size_t colStart, size_t colEnd, Colour foreColour, Colour backColour)=0
virtual char getChar()=0
bool execute(const HugeStaticString &input, HugeStaticString &output, InterruptState &state, DebuggerIO *pScreen)
void autocomplete(const HugeStaticString &input, HugeStaticString &output)