mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 03:53:21 +02:00
[273114] Wrap lines of more than 100 characters, in our GDB traces
This commit is contained in:
parent
698d5bb0ba
commit
3bc0e2a9d1
2 changed files with 20 additions and 8 deletions
|
@ -125,7 +125,12 @@ public class GdbPlugin extends Plugin {
|
||||||
|
|
||||||
public static void debug(String message) {
|
public static void debug(String message) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
System.out.print(message);
|
while (message.length() > 100) {
|
||||||
|
String partial = message.substring(0, 100);
|
||||||
|
message = message.substring(100);
|
||||||
|
System.out.println(partial + "\\"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
System.out.print(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -554,9 +554,13 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getMITracingStream() != null) {
|
if (getMITracingStream() != null) {
|
||||||
try {
|
try {
|
||||||
getMITracingStream().write(GdbPlugin.getDebugTime().getBytes());
|
String message = GdbPlugin.getDebugTime() + " " + str; //$NON-NLS-1$
|
||||||
getMITracingStream().write(' ');
|
while (message.length() > 100) {
|
||||||
getMITracingStream().write(str.getBytes());
|
String partial = message.substring(0, 100) + "\\\n"; //$NON-NLS-1$
|
||||||
|
message = message.substring(100);
|
||||||
|
getMITracingStream().write(partial.getBytes());
|
||||||
|
}
|
||||||
|
getMITracingStream().write(message.getBytes());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// The tracing stream could be closed at any time
|
// The tracing stream could be closed at any time
|
||||||
// since the user can set a preference to turn off
|
// since the user can set a preference to turn off
|
||||||
|
@ -604,10 +608,13 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getMITracingStream() != null) {
|
if (getMITracingStream() != null) {
|
||||||
try {
|
try {
|
||||||
getMITracingStream().write(GdbPlugin.getDebugTime().getBytes());
|
String message = GdbPlugin.getDebugTime() + " " + finalLine + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
getMITracingStream().write(' ');
|
while (message.length() > 100) {
|
||||||
getMITracingStream().write(finalLine.getBytes());
|
String partial = message.substring(0, 100) + "\\\n"; //$NON-NLS-1$
|
||||||
getMITracingStream().write('\n');
|
message = message.substring(100);
|
||||||
|
getMITracingStream().write(partial.getBytes());
|
||||||
|
}
|
||||||
|
getMITracingStream().write(message.getBytes());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// The tracing stream could be closed at any time
|
// The tracing stream could be closed at any time
|
||||||
// since the user can set a preference to turn off
|
// since the user can set a preference to turn off
|
||||||
|
|
Loading…
Add table
Reference in a new issue