This view mode takes every stack frame and turns it into a root in the
profile graph. This allows functions that are called from many places
to bubble up to the top. It's a very handy way to discover heavy things
in a profile that are otherwise obscured by having many callers.
* AK: Add formatter for JsonValue.
* Inspector: Use new format functions.
* Profiler: Use new format functions.
* UserspaceEmulator: Use new format functions.
Previously, the client would decide when to ask the server for
completions, and it would only do so for identifiers that had spans
(determined via the highlighter!).
Swap this around and make the server decide if it wants to complete
something.
This commit also adds a CompletionKind (which only has one value:
Identifier), to work with other kinds of completions as well.
In the future all (normal) output should be written by any of the
following functions:
out (currently called new_out)
outln
dbg (currently called new_dbg)
dbgln
warn (currently called new_warn)
warnln
However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)
I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
This commit moves all the logic that deals with the language server
(from HackStudio) into a LanguageClient class, provides some functions
to make constructing them easier, and makes all language servers use a
singular IPC definition.
Also fixes the FIXME about making the autocompletion async.
This makes adding language servers in the future significantly less
duplicate-y, and significantly easier :^)
Editors now communicate with the c++ language server when openning and
editing c++ source files, and go through the language server to get
autocomplete suggestions.
The language server keeps track of the content of currently edited
files by receiving updates about edit actions.
Also, C++ autocompletion is no longer tied to HackStudio itself and
moved to be part of the language server.
Previously, when resolving the paths for the FormEditor widget icons
we didn't take into the account that calling class_name() returns the
widget name with a "GUI::" prefix.
Also, we now skip over widgets that we don't have an icon for.
Don't require clients to templatize modrm().read{8,16,32,64}() with
the ValueWithShadow type when we can figure it out automatically.
The main complication here is that ValueWithShadow is a UE concept
while the MemoryOrRegisterReference inlines exist at the lower LibX86
layer and so doesn't have direct access to those types. But that's
nothing we can't solve with some simple template trickery. :^)
m_cached_code_end points at the first invalid byte, so we need to
update the cache if the last byte we want to read points at the
end or past it. Previously we updated the cache 1 byte prematurely in
read16, read32, read64 (but not in read8).
Noticed by reading the code (the code looked different from read8() and
the other 3). I didn't find anything that actually hit this case.
This is useful for reading and writing doubles for #3329.
It is also useful for emulating 64-bit binaries.
MemoryOrRegisterReference assumes that 64-bit values are always
memory references since that's enough for fpu support. If we
ever want to emulate 64-bit binaries, that part will need minor
updating.
CppAutoComplete gets a string of code and a position within it, and
returns a Vector of auto-complete suggestions that are relevant for the
given position.
Currently, it's very naive - it uses our CppLexer to find identifiers
in the code which the auto-complete target is a prefix of.
The kernel doesn't support msg_iovlens != 1 yet and nothing passes
an amount != 1, but if anyone ever adds support for this they won't
have to worry about ue at least.
When SO_TIMESTAMP is set as an option on a SOCK_DGRAM socket, then
recvmsg() will return a SCM_TIMESTAMP control message that
contains a struct timeval with the system time that was current
when the socket was received.
The implementation only supports a single iovec for now.
Some might say having more than one iovec is the main point of
recvmsg() and sendmsg(), but I'm interested in the control message
bits.
* Pass the correct source address for copying tine addr_length.
Previously, this was broken when addr_length was non-nullptr.
* Copy min(sizeof(address), address_length) bytes into address,
instead of sizeof(address), which might be larger than the
user buffer.
* Use sockaddr_storage instead of sockaddr_un. In practice they're
both the same size, but this is what sockaddr_storage is for.
With this (in particular, the first fix), `ue /bin/ntpquery`
actually gets past the recvfrom() call :^)
With this, `ue /bin/ntpquery` can be used to test sendto() and
recvfrom() in ue. (It eventually hits an unimplemented FILD_RM64,
but not before doing emulated network i/o and printing response
details.)
Previously, the strucutre of the HackStudio widgets made it so the
actions tab would be hidden when the "edit mode" was something other
than EditMode::Text (for example, when using the form editor).