mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
@@ -382,8 +382,14 @@ void ScriptDebuggerRemote::_get_output() {
|
||||
packet_peer_stream->put_var(output_strings.size());
|
||||
|
||||
while (output_strings.size()) {
|
||||
const OutputString &output_string = output_strings.front()->get();
|
||||
|
||||
Array msg_data;
|
||||
msg_data.push_back(output_string.message);
|
||||
msg_data.push_back(output_string.type);
|
||||
|
||||
packet_peer_stream->put_var(msg_data);
|
||||
|
||||
packet_peer_stream->put_var(output_strings.front()->get());
|
||||
output_strings.pop_front();
|
||||
}
|
||||
locking = false;
|
||||
@@ -1157,10 +1163,15 @@ void ScriptDebuggerRemote::_print_handler(void *p_this, const String &p_string,
|
||||
if (overflowed)
|
||||
s += "[...]";
|
||||
|
||||
sdr->output_strings.push_back(s);
|
||||
OutputString output_string;
|
||||
output_string.message = s;
|
||||
output_string.type = p_error ? MESSAGE_TYPE_ERROR : MESSAGE_TYPE_LOG;
|
||||
sdr->output_strings.push_back(output_string);
|
||||
|
||||
if (overflowed) {
|
||||
sdr->output_strings.push_back("[output overflow, print less text!]");
|
||||
output_string.message = "[output overflow, print less text!]";
|
||||
output_string.type = MESSAGE_TYPE_ERROR;
|
||||
sdr->output_strings.push_back(output_string);
|
||||
}
|
||||
}
|
||||
sdr->mutex->unlock();
|
||||
|
||||
@@ -92,7 +92,12 @@ class ScriptDebuggerRemote : public ScriptDebugger {
|
||||
Array callstack;
|
||||
};
|
||||
|
||||
List<String> output_strings;
|
||||
struct OutputString {
|
||||
String message;
|
||||
int type;
|
||||
};
|
||||
|
||||
List<OutputString> output_strings;
|
||||
List<Message> messages;
|
||||
int max_messages_per_frame;
|
||||
int n_messages_dropped;
|
||||
@@ -151,6 +156,11 @@ class ScriptDebuggerRemote : public ScriptDebugger {
|
||||
bool skip_breakpoints;
|
||||
|
||||
public:
|
||||
enum MessageType {
|
||||
MESSAGE_TYPE_LOG,
|
||||
MESSAGE_TYPE_ERROR,
|
||||
};
|
||||
|
||||
struct ResourceUsage {
|
||||
|
||||
String path;
|
||||
|
||||
Reference in New Issue
Block a user