SystemMonitor: ProcessStack is now ThreadStack

This is a follow-up to #3095. In particular:
    https://github.com/SerenityOS/serenity/pull/3095#discussion_r469113354
This commit is contained in:
Ben Wiederhake 2020-08-15 12:58:14 +02:00 committed by Andreas Kling
parent 46e53417c9
commit cebf8ae3b7
Notes: sideshowbarker 2024-07-19 03:37:31 +09:00
4 changed files with 12 additions and 12 deletions

View File

@ -7,8 +7,8 @@ set(SOURCES
ProcessFileDescriptorMapWidget.cpp
ProcessMemoryMapWidget.cpp
ProcessModel.cpp
ProcessStackWidget.cpp
ProcessUnveiledPathsWidget.cpp
ThreadStackWidget.cpp
)
serenity_bin(SystemMonitor)

View File

@ -24,13 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ProcessStackWidget.h"
#include "ThreadStackWidget.h"
#include <AK/ByteBuffer.h>
#include <LibCore/File.h>
#include <LibCore/Timer.h>
#include <LibGUI/BoxLayout.h>
ProcessStackWidget::ProcessStackWidget()
ThreadStackWidget::ThreadStackWidget()
{
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
@ -40,11 +40,11 @@ ProcessStackWidget::ProcessStackWidget()
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
}
ProcessStackWidget::~ProcessStackWidget()
ThreadStackWidget::~ThreadStackWidget()
{
}
void ProcessStackWidget::set_ids(pid_t pid, pid_t tid)
void ThreadStackWidget::set_ids(pid_t pid, pid_t tid)
{
if (m_pid == pid && m_tid == tid)
return;
@ -53,7 +53,7 @@ void ProcessStackWidget::set_ids(pid_t pid, pid_t tid)
refresh();
}
void ProcessStackWidget::refresh()
void ThreadStackWidget::refresh()
{
auto file = Core::File::construct(String::format("/proc/%d/stacks/%d", m_pid, m_tid));
if (!file->open(Core::IODevice::ReadOnly)) {

View File

@ -29,16 +29,16 @@
#include <LibGUI/TextEditor.h>
#include <LibGUI/Widget.h>
class ProcessStackWidget final : public GUI::Widget {
C_OBJECT(ProcessStackWidget)
class ThreadStackWidget final : public GUI::Widget {
C_OBJECT(ThreadStackWidget)
public:
virtual ~ProcessStackWidget() override;
virtual ~ThreadStackWidget() override;
void set_ids(pid_t pid, pid_t tid);
void refresh();
private:
ProcessStackWidget();
ThreadStackWidget();
pid_t m_pid { -1 };
pid_t m_tid { -1 };

View File

@ -31,7 +31,7 @@
#include "ProcessFileDescriptorMapWidget.h"
#include "ProcessMemoryMapWidget.h"
#include "ProcessModel.h"
#include "ProcessStackWidget.h"
#include "ThreadStackWidget.h"
#include "ProcessUnveiledPathsWidget.h"
#include <LibCore/Timer.h>
#include <LibGUI/AboutDialog.h>
@ -316,7 +316,7 @@ int main(int argc, char** argv)
auto& memory_map_widget = process_tab_widget.add_tab<ProcessMemoryMapWidget>("Memory map");
auto& open_files_widget = process_tab_widget.add_tab<ProcessFileDescriptorMapWidget>("Open files");
auto& unveiled_paths_widget = process_tab_widget.add_tab<ProcessUnveiledPathsWidget>("Unveiled paths");
auto& stack_widget = process_tab_widget.add_tab<ProcessStackWidget>("Stack");
auto& stack_widget = process_tab_widget.add_tab<ThreadStackWidget>("Stack");
process_table_view.on_selection = [&](auto&) {
auto pid = selected_id(ProcessModel::Column::PID);