Skip to content

Instantly share code, notes, and snippets.

... .. ...
...... . ..,. ?+. .. ...
........ .I.D ,.=8.I ...
. .. ...... D+8. 7. .:D~? . ..
.... ..... ..I~ =: M .7$ I.. .. ..
.. .....D. .O.D.. .8+Z~
.. .. O .. D~8... =7~D,
..... 8.....=~I. ....=$=N .
.. ....$+.: ..=7$. O:. .7Z?7 . ..
@jgouly
jgouly / vt.md
Created September 15, 2020 23:39
Linux: Ctr-Alt-F<N> switches between virtual terminals/consoles, but how?

Linux: Ctr-Alt-F<N> switches between virtual terminals/consoles, but how?

I remembered the chvt (change foreground virtual terminal) command, so that seems like a good place to start. I looked at BusyBox's implementation in console-tools/chvt.c, hoping that it would be small enough to skim through. At 33 lines, with only 9 lines containing code I wasn't disappointed.

The call to console_make_active looks interesting. console_make_active can be found in libbb/get_console.c:

diff --git a/cranelift-codegen/src/timing.rs b/cranelift-codegen/src/timing.rs
index 16f729f7..51d500fe 100644
--- a/cranelift-codegen/src/timing.rs
+++ b/cranelift-codegen/src/timing.rs
@@ -189,7 +189,7 @@ mod details {
let prev = CURRENT_PASS.with(|p| p.replace(pass));
debug!("timing: Starting {}, (during {})", pass, prev);
TimingToken {
- start: Instant::now(),
+ start: unsafe { std::mem::transmute(0u128) },//Instant::now(),
void handle_action(action_code a) {
bool should_process = true;
if (user_hook) {
should_process = user_hook(a);
}
if (should_process) {
switch(a) {
case NORMAL_KEY: ...
}
}
; ModuleID = 'llvm-re'
@transitiontable = internal constant [3 x [2 x i32]] [[2 x i32] [i32 1, i32 -1], [2 x i32] [i32 -1, i32 2], [2 x i32] [i32 3, i32 -1]]
define i32 @match(i8*) {
entry:
%Index = alloca i32
store i32 0, i32* %Index
%IsMatch = alloca i32
store i32 0, i32* %IsMatch
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 52ba489..4d8864e 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1321,15 +1321,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// The make clang go fast button.
CmdArgs.push_back("-disable-free");
+ const char *InputFilename = darwin::CC1::getBaseInputName(Args, Inputs);
// Disable the verification pass in -asserts builds.
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 52ba489..9ebee04 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1323,7 +1323,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Disable the verification pass in -asserts builds.
#ifdef NDEBUG
- CmdArgs.push_back("-disable-llvm-verifier");
+ types::ID MainFileType = Inputs[0].getType();
#include <llvm/Support/IRReader.h>
#include <llvm/LLVMContext.h>
#include <llvm/Module.h>
#include <llvm/Support/raw_ostream.h>
using namespace llvm;
int main()
{
std::string error;
Module *stdlib;
@jgouly
jgouly / gist:1691036
Created January 27, 2012 21:34
titan
class Titan
OPCODES = %w(
SHR
ADD
SUB
AND
LOR
XOR
NOT
PSH
class Object
def self.const_missing k
const_set k, Class.new
end
end
class Lol < Lol2
end
p Lol.superclass