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 {
24 }
25 
26 SyscallTracerCommand::~SyscallTracerCommand()
27 {
28 }
29 
31  const HugeStaticString &input, HugeStaticString &output)
32 {
33 }
34 
36  const HugeStaticString &input, HugeStaticString &output,
37  InterruptState &state, DebuggerIO *pScreen)
38 {
39  // Let's enter 'raw' screen mode.
40  pScreen->disableCli();
41 
42  // Initialise the Scrollable class
43  move(0, 1);
44  resize(pScreen->getWidth(), pScreen->getHeight() - 2);
45  setScrollKeys('j', 'k');
46 
47  // Clear the top status lines.
48  pScreen->drawHorizontalLine(
49  ' ', 0, 0, pScreen->getWidth() - 1, DebuggerIO::White,
50  DebuggerIO::Green);
51 
52  // Write the correct text in the upper status line.
53  pScreen->drawString(
54  "Pedigree debugger - System Call Tracer", 0, 0, DebuggerIO::White,
55  DebuggerIO::Green);
56 
57  // Main loop.
58  bool bStop = false;
59  while (!bStop)
60  {
61  refresh(pScreen);
62 
63  // Wait for input.
64  char c = 0;
65  while (!(c = pScreen->getChar()))
66  ;
67 
68  if (c == 'q')
69  bStop = true;
70  }
71 
72  // Return to the debugger
73  return (true);
74 }
75 
76 const char *SyscallTracerCommand::getLine1(
77  size_t index, DebuggerIO::Colour &colour, DebuggerIO::Colour &bgColour)
78 {
79  return (0);
80 }
81 
82 const char *SyscallTracerCommand::getLine2(
83  size_t index, size_t &colOffset, DebuggerIO::Colour &colour,
84  DebuggerIO::Colour &bgColour)
85 {
86  return (0);
87 }
88 
89 size_t SyscallTracerCommand::getLineCount()
90 {
91  return (0);
92 }
virtual size_t getWidth()=0
bool execute(const HugeStaticString &input, HugeStaticString &output, InterruptState &state, DebuggerIO *pScreen)
void autocomplete(const HugeStaticString &input, HugeStaticString &output)
virtual char getChar()=0
virtual void drawString(const char *str, size_t row, size_t col, Colour foreColour, Colour backColour)=0
virtual void drawHorizontalLine(char c, size_t row, size_t colStart, size_t colEnd, Colour foreColour, Colour backColour)=0