fxos/shell/commands.h

72 lines
1.6 KiB
C++

//---
// fxos-shell.commands: Internal functions for each command
//---
#ifndef _FXOS_COMMANDS_H
#define _FXOS_COMMANDS_H
#include <vector>
#include <string>
#include <fxos/memory.h>
#include "session.h"
#include "parser.h"
//---
// Include commands
//---
/* Include the specified list of files *AFTER* the current command ends */
void _dot(Session &s, std::vector<std::string> const &files, bool absolute);
//---
// Virtual spaces
//---
/* List specified spaces (all if no arguments) */
void _vl(Session &s, std::vector<std::string> const &spaces);
/* Select the current virtual space */
void _vs(Session &s, std::string const &name);
/* Create a new virtual space */
void _vc(Session &s, std::string name);
/* Map a file into one or more regions inside the current virtual space */
void _vm(Session &s, std::string filename, std::vector<MemoryRegion> regions);
//---
// Evaluation
//---
/* Evaluate a numerical input in the specified virtual space */
void _e(Session &s, std::string space_name, std::vector<long> const &values);
//---
// Goto
//---
/* Goto specified location */
void _g(Session &s, long location);
//---
// Hexdump
//---
/* Dump memory contents of a byte-boundary region */
void _h(Session &s, FxOS::MemoryRegion r);
/* Advanced memory view. Displays the specified region, highlighting provided
selections (in the form of <start, size> pairs). */
void _h_hexdump(Session &s, Range r,
std::vector<std::pair<uint32_t,int>> selections = {});
//---
// Information
//---
/* General information about the OS */
void _io(Session &s, std::string space="");
#endif /* _FXOS_COMMANDS_H */