8293037: Remove DebuggerBase.writeBytes() and related code from SA

Reviewed-by: amenkov, kevinw
This commit is contained in:
Chris Plummer 2022-08-30 16:24:51 +00:00
parent 343333abcf
commit f285cea9a6
7 changed files with 2 additions and 118 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -132,7 +132,4 @@ public interface Debugger extends SymbolLookup, ThreadAccess {
public ReadResult readBytesFromProcess(long address, long numBytes)
throws DebuggerException;
public void writeBytesToProcess(long address, long numBytes, byte[] data)
throws UnmappedAddressException, DebuggerException;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -232,15 +232,6 @@ public abstract class DebuggerBase implements Debugger {
}
}
/** May be called by subclasses directly but may not be overridden */
protected final void writeBytes(long address, long numBytes, byte[] data)
throws UnmappedAddressException, DebuggerException {
if (cache != null) {
cache.clear(address, numBytes);
}
writeBytesToProcess(address, numBytes, data);
}
public boolean readJBoolean(long address)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
@ -385,78 +376,6 @@ public abstract class DebuggerBase implements Debugger {
}
}
public void writeJBoolean(long address, boolean value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jbooleanSize);
byte[] data = utils.jbooleanToData(value);
writeBytes(address, jbooleanSize, data);
}
public void writeJByte(long address, byte value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jbyteSize);
byte[] data = utils.jbyteToData(value);
writeBytes(address, jbyteSize, data);
}
public void writeJChar(long address, char value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jcharSize);
byte[] data = utils.jcharToData(value);
writeBytes(address, jcharSize, data);
}
public void writeJDouble(long address, double value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jdoubleSize);
byte[] data = utils.jdoubleToData(value);
writeBytes(address, jdoubleSize, data);
}
public void writeJFloat(long address, float value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jfloatSize);
byte[] data = utils.jfloatToData(value);
writeBytes(address, jfloatSize, data);
}
public void writeJInt(long address, int value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jintSize);
byte[] data = utils.jintToData(value);
writeBytes(address, jintSize, data);
}
public void writeJLong(long address, long value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jlongSize);
byte[] data = utils.jlongToData(value);
writeBytes(address, jlongSize, data);
}
public void writeJShort(long address, short value)
throws UnmappedAddressException, UnalignedAddressException {
checkJavaConfigured();
utils.checkAlignment(address, jshortSize);
byte[] data = utils.jshortToData(value);
writeBytes(address, jshortSize, data);
}
public void writeCInteger(long address, long numBytes, long value)
throws UnmappedAddressException, UnalignedAddressException {
checkConfigured();
utils.checkAlignment(address, numBytes);
byte[] data = utils.cIntegerToData(numBytes, value);
writeBytes(address, numBytes, data);
}
protected long readAddressValue(long address)
throws UnmappedAddressException, UnalignedAddressException {
return readCInteger(address, machDesc.getAddressSize(), true);
@ -481,11 +400,6 @@ public abstract class DebuggerBase implements Debugger {
return value;
}
protected void writeAddressValue(long address, long value)
throws UnmappedAddressException, UnalignedAddressException {
writeCInteger(address, machDesc.getAddressSize(), value);
}
/** Can be called by subclasses but can not be overridden */
protected final void checkConfigured() {
if (machDesc == null) {

View File

@ -603,12 +603,6 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
}
}
public void writeBytesToProcess(long address, long numBytes, byte[] data)
throws UnmappedAddressException, DebuggerException {
// FIXME
throw new DebuggerException("Unimplemented");
}
/** this functions used for core file reading and called from native attach0,
it returns an array of long integers as
[thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for

View File

@ -126,11 +126,6 @@ public class DummyDebugger extends DebuggerBase {
throw new DebuggerException("Unimplemented");
}
public void writeBytesToProcess(long a, long b, byte[] buf)
throws DebuggerException {
throw new DebuggerException("Unimplemented");
}
//----------------------------------------------------------------------
// Package-internal routines
//

View File

@ -660,12 +660,6 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
}
}
public void writeBytesToProcess(long address, long numBytes, byte[] data)
throws UnmappedAddressException, DebuggerException {
// FIXME
throw new DebuggerException("Unimplemented");
}
static {
System.loadLibrary("saproc");
init0();

View File

@ -412,10 +412,6 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
}
}
public void writeBytesToProcess(long a, long b, byte[] c) {
throw new DebuggerException("Unimplemented!");
}
public String execCommandOnServer(String command, Map<String, Object> options) {
try {
return remoteDebugger.execCommandOnServer(command, options);

View File

@ -501,12 +501,6 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
return null;
}
public void writeBytesToProcess(long address, long numBytes, byte[] data)
throws UnmappedAddressException, DebuggerException {
// FIXME
throw new DebuggerException("Unimplemented");
}
private static String imagePath;
private static String symbolPath;
private static boolean useNativeLookup;