1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-12 15:37:35 +00:00

Add a very hackish /proc/PID/stack.

It walks the stack and identifies anything that looks like a kernel symbol.
This could be a lot more sophisticated.
This commit is contained in:
Andreas Kling 2018-10-26 22:32:35 +02:00
parent 81627cf7d5
commit c928b06218
14 changed files with 130 additions and 13 deletions

View file

@ -79,6 +79,7 @@ auto SyntheticFileSystem::createGeneratedFile(String&& name, Function<ByteBuffer
InodeIdentifier SyntheticFileSystem::addFile(OwnPtr<File>&& file, InodeIndex parent)
{
ASSERT_INTERRUPTS_DISABLED();
ASSERT(file);
auto it = m_inodes.find(parent);
ASSERT(it != m_inodes.end());
@ -92,6 +93,7 @@ InodeIdentifier SyntheticFileSystem::addFile(OwnPtr<File>&& file, InodeIndex par
bool SyntheticFileSystem::removeFile(InodeIndex inode)
{
ASSERT_INTERRUPTS_DISABLED();
auto it = m_inodes.find(inode);
if (it == m_inodes.end())
return false;
@ -127,6 +129,7 @@ InodeIdentifier SyntheticFileSystem::rootInode() const
bool SyntheticFileSystem::enumerateDirectoryInode(InodeIdentifier inode, Function<bool(const DirectoryEntry&)> callback) const
{
InterruptDisabler disabler;
ASSERT(inode.fileSystemID() == id());
#ifdef SYNTHFS_DEBUG
kprintf("[synthfs] enumerateDirectoryInode %u\n", inode.index());
@ -150,6 +153,7 @@ bool SyntheticFileSystem::enumerateDirectoryInode(InodeIdentifier inode, Functio
InodeMetadata SyntheticFileSystem::inodeMetadata(InodeIdentifier inode) const
{
InterruptDisabler disabler;
ASSERT(inode.fileSystemID() == id());
#ifdef SYNTHFS_DEBUG
kprintf("[synthfs] inodeMetadata(%u)\n", inode.index());
@ -186,6 +190,8 @@ bool SyntheticFileSystem::writeInode(InodeIdentifier, const ByteBuffer&)
Unix::ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer) const
{
InterruptDisabler disabler;
ASSERT(inode.fileSystemID() == id());
#ifdef SYNTHFS_DEBUG
kprintf("[synthfs] readInode %u\n", inode.index());