Skip to content

Conversation

@hxrshxz
Copy link

@hxrshxz hxrshxz commented Oct 19, 2025

Fixes #1294

Description

  • Adds ability to gather system diagnostics from a running sketch through the debugger.

Copilot AI review requested due to automatic review settings October 19, 2025 11:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a diagnostics gathering feature to the debugger that allows developers to collect system information, memory statistics, and sketch runtime details from a running Processing sketch. The feature is accessible through a new menu item in the Debug menu and displays results in a formatted dialog with export capabilities.

Key Changes:

  • New diagnostics collection system that gathers system properties, memory usage, sketch details, and display information
  • Debug menu integration with "Gather Diagnostics" option that invokes the feature via JDWP
  • Dialog interface for viewing, copying, and exporting diagnostic data

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
DiagnosticsDialog.java New dialog UI for displaying formatted diagnostics with copy/export functionality
Debugger.java Adds menu item and implements remote diagnostics gathering via debugger connection
PDiagnostics.java Core diagnostics collection logic that gathers system, memory, and sketch information
PApplet.java Adds getDiagnostics() public method to enable remote invocation from debugger
PDE.properties Adds localization string for the new menu item

@Stefterv
Copy link
Collaborator

Stefterv commented Oct 21, 2025

Hi @hxrshxz Thank you so much for this work!

A few things:

  • Rather than communicating over JSON and writing a custom writer and parser, lets use the build-in communication in the Debug connection
  • The debug connection is active even when the debugger is not connected in Java mode, so this is not limited to running a sketch with the Debugger active
  • Rather than adding a whole new screen, let's just add it to the clipboard content that already exists when you click the version number

@hxrshxz
Copy link
Author

hxrshxz commented Dec 16, 2025

Hi @benfry, thank you for the feedback. I've updated the PR to address your points:

  1. Direct JDWP Access: Switched to reading PApplet fields directly via JDI, removing the need for JSON or custom protocols.
  2. Universal Diagnostics: Implemented a static Debugger.getDiagnostics(Runner) that works for both Run and Debug modes without requiring an active debug session.
  3. Clipboard Integration: Simply appends sketch diagnostics to the existing version-click clipboard action. No new UI elements were added.

really sorry for taking so lonng

Screencast.from.2025-12-17.01-46-10.mp4

@hxrshxz hxrshxz marked this pull request as draft December 16, 2025 20:14
@hxrshxz hxrshxz marked this pull request as ready for review December 16, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gathering System Diagnostics from a sketch over the debug connection

2 participants