summaryrefslogtreecommitdiff
path: root/DevTools
AgeCommit message (Collapse)Author
2020-08-15Kernel+LibC+UserspaceEmulator: Bring back sys$dup2()Andreas Kling
This is racy in userspace and non-racy in kernelspace so let's keep it in kernelspace. The behavior change where CLOEXEC is preserved when dup2() is called with (old_fd == new_fd) was good though, let's keep that.
2020-08-15Kernel+LibC+UserspaceEmulator: Remove sys$dup() and sys$dup2()Andreas Kling
We can just implement these in userspace, so yay two less syscalls!
2020-08-15LibGUI: Make focus events more aware of why focus is changingAndreas Kling
This patch adds GUI::FocusEvent which has a GUI::FocusSource. The focus source is one of three things: - Programmatic - Mouse - Keyboard This allows receivers of focus events to implement different behaviors depending on how they receive/lose focus.
2020-08-14Inspector: Require horizontal scrollbars less oftenNico Weber
Make the window a bit larger, and give the left pane a Fixed size policy, so that it takes up less than half the window.
2020-08-12DevTools: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code. Also, in case of signal_trampoline_dummy, marking it external (non-static) prevents it from being 'optimized away', which would lead to surprising and weird linker errors.
2020-08-12HackStudio: Mark compilation-unit-only functions as staticBen Wiederhake
This also resolves some typing issues that only 'accidentally' worked, like declaring a function to return type A, and the definition actually returning type B (which works if type B is a subtype of type A). I like to call these "ninja imports". To prevent problems like this in the future, I put all globals in a HackStudio.h. I'm not sure about the name, but main.h and common.h felt wrong.
2020-08-12HackStudio: Use adopt_own(*new T) instead of OwnPtr(new T)Andreas Kling
2020-08-11UserspaceEmulator: Remove some silly semicolonsNico Weber
2020-08-11UserspaceEmulator: Log unimplemented instructions with proper backtraceAndreas Kling
2020-08-10Kernel: Use Userspace<T> for the execve syscallBrian Gianforcaro
2020-08-09HackStudio: Set the pgrp of the pseudoterminal to the child pidAnotherTest
This fixes #3046.
2020-08-07UserspaceEmulator: Add the dup2 syscallAndreas Kling
2020-08-07UserspaceEmulator: Add the chdir syscallAndreas Kling
2020-08-07UserspaceEmulator: Pass full path to new UE instance in virt$execve()Andreas Kling
Don't just pass argv[0] to the new UE, pass the full program path.
2020-08-07UserspaceEmulator: Add the getpgid() and waitid() syscallsAndreas Kling
With this, you can now kinda sorta run the shell in UserspaceEmulator!
2020-08-07UserspaceEmulator: Add the setpgid syscallAndreas Kling
2020-08-07UserspaceEmulator: Make the "unimplemented syscall" output look nicerAndreas Kling
2020-08-07UserspaceEmulator: Result is initialized after OR with all-1 immediateAndreas Kling
When compiling with "-Os", GCC produces the following pattern for atomic decrement (which is used by our RefCounted template): or eax, -1 lock xadd [destination], eax Since or-ing with -1 will always produce the same output (-1), we can mark the result of these operations as initialized. This stops us from complaining about false positives when running the shell in UE. :^)
2020-08-06UserspaceEmulator: Fix bad rc check in ttyname and getcwd syscallsAndreas Kling
Errors here are (rc < 0), not (rc < 1).
2020-08-05UserspaceEmulator: Support ioctl(TCGETS) and ioctl(TCSETS)Andreas Kling
2020-08-05UserspaceEmulator: Add the access syscallAndreas Kling
2020-08-05UserspaceEmulator: Add the getcwd syscallAndreas Kling
2020-08-05UserspaceEmulator: Add the ttyname syscallAndreas Kling
2020-08-05UserspaceEmulator: Support ioctl(TIOCSPGRP)Andreas Kling
2020-08-05UserspaceEmulator: Add the getpgrp syscallAndreas Kling
2020-08-05UserspaceEmulator: Add support for UNIX signals :^)Andreas Kling
The emulator will now register signal handlers for all possible signals and act as a translation layer between the kernel and the emulated process. To get an accurate simulation of signal handling, we duplicate the same trampoline mechanism used by the kernel's signal delivery system, and also use the "sigreturn" syscall to return from a signal handler. Signal masking is not fully implemented yet, but this is pretty cool!
2020-08-05Base: Move "js" and "little" HackStudio projects into ~/Source/Andreas Kling
2020-08-05HackStudio: Open project or file from argv[1] if givenLinus Groh
When HackStudio is invoked with one or more arguments it will attempt to treat the first argument as a project or source file and open it accordingly.
2020-08-05HackStudio: Rename project file format from .files to .hackstudioLinus Groh
2020-08-01UserspaceEmulator: Don't print backtrace offsets if we have file/lineAndreas Kling
File/line is way more interesting than offsets, so let's only do the offsets if we don't have file/line information.
2020-08-01UserspaceEmulator: Report heap buffer overflows :^)Andreas Kling
2020-08-01UserspaceEmulator: Mark mmap regions as malloc blocks when mallocingAndreas Kling
We don't have to be clever at all to figure out which MmapRegions are malloc blocks, we can just mark the containing region as such when the emulated process performs a malloc! :^)
2020-08-01UserspaceEmulator: Forward errors from fork() correctlyAndreas Kling
2020-07-31UserspaceEmulator: Use a report() function instead of dbgprintf()Andreas Kling
Ultimately we'll want to make it a bit easier to add more reporting. This at least makes it easier to redirect the logging.
2020-07-30LibX86: Disassemble most remaining FPU instructionsNico Weber
Some of the remaining instructions have different behavior for register and non-register ops. Since we already have the two-level flags tables, model this by setting all handlers in the two-level table to the register op handler, while the first-level flags table stores the action for the non-reg handler.
2020-07-28LibWeb: Move HTML classes into the Web::HTML namespaceAndreas Kling
2020-07-28LibX86: Disassemble most FPU instructions starting with D9Nico Weber
Some of these don't just use the REG bits of the mod/rm byte as slashes, but also the R/M bits to have up to 9 different instructions per opcode/slash combination (1 opcode requires that MOD is != 11, the other 8 have MODE == 11). This is done by making the slashes table two levels deep for these cases. Some of this is cosmetic (e.g "FST st0" has no effect already, but its bit pattern gets disassembled as "FNOP"), but for most uses it isn't. FSTENV and FSTCW have an extraordinary 0x9b prefix. This is not yet handled in this patch.
2020-07-28DevTools: Let Inspector use ProcessChooser and new icons.thankyouverycool
Inspector now opens ProcessChooser when no PID is supplied.
2020-07-28DevTools+LibGUI: Make ProcessChooser a general Dialog in LibGUIthankyouverycool
Moves ProcessChooser and RunningProcessesModel to LibGUI and generalizes their construction for use by other apps. Updates Profiler to reflect the change and use its new icons.
2020-07-28UserspaceEmulator: Add syscalls: stat(), realpath(), gethostname()Andreas Kling
This is enough to run /bin/ls :^)
2020-07-28UserspaceEmulator: Don't just return "EMULATED" in get_process_name()Andreas Kling
Now that emulated processes have their real name (with a "(UE)" prefix) we can actually let them know their name.
2020-07-28UserspaceEmulator: Support ioctl(TIOCGWINSZ)Andreas Kling
This is very commonly used by terminal programs, and easy to support.
2020-07-27UserspaceEmulator: Set the process and thread name to "(UE) Executable"Andreas Kling
This makes it much easier to see who's who when running multiple emulators at the same time. :^)
2020-07-27UserspaceEmulator: Implement the execve() syscall :^)Andreas Kling
This virtual syscall works by exec'ing the UserspaceEmulator itself, with the emulated program's provided arguments as the arguments to the new UserspaceEmulator instance. This means that we "follow" exec'ed programs and emulate them as well. In the future we might want to make this an opt-in (or opt-out, idk) behavior, but for now it's what we do. This is really quite cool, I think! :^)
2020-07-27UserspaceEmulator: Implement the fork() syscall :^)Andreas Kling
2020-07-27UserspaceEmulator: Implement the setuid() and setgid() syscallsAndreas Kling
Note that running a setuid program (e.g /bin/ping) in UE does not actually run uid=0. You'll have to run UE itself as uid=0 if you want to test programs that do setuid/setgid.
2020-07-27UserspaceEmulator: Implement the accept() and setsockopt() syscallsAndreas Kling
It's now possible to run LookupServer in UE (by setting up SystemServer to run the service inside UE.) No bugs found, but very cool! :^)
2020-07-27UserspaceEmulator: Transfer the environment to the emulated processAndreas Kling
2020-07-27UserspaceEmulator: Mark SimpleRegions as initialized up front for nowAndreas Kling
This prevents some false positives since the initial stack is expected to be zero-initialized.
2020-07-27UserspaceEmulator: Recognize xor/sub zeroing idioms and don't taintAndreas Kling
"xor reg,reg" or "sub reg,reg" both zero out the register, which means we know for sure the result is 0. So mark the value as initialized, and make sure we don't taint the CPU flags. This removes some false positives from the uninitialized memory use detection mechanism. Fixes #2850.