8135292: Remove duplicate code in <OS>Address.java in SA

Reviewed-by: cjplummer, amenkov
This commit is contained in:
Jayashree Huttanagoudar 2022-06-27 11:52:42 +00:00 committed by Severin Gehwolf
parent 7905788e96
commit ddb55ede2c
11 changed files with 18 additions and 47 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -292,11 +292,6 @@ class BsdAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -525,7 +525,7 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
/** From the BsdDebugger interface */
public long getAddressValue(Address addr) {
if (addr == null) return 0;
return ((BsdAddress) addr).getValue();
return addr.asLongValue();
}
/** From the BsdDebugger interface */

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
@ -279,10 +279,6 @@ class DummyAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

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
@ -73,7 +73,7 @@ public class DummyDebugger extends DebuggerBase {
public long getAddressValue(Address addr) {
if (addr == null) return 0;
return ((DummyAddress) addr).getValue();
return addr.asLongValue();
}
public String getOS() {
@ -142,7 +142,7 @@ public class DummyDebugger extends DebuggerBase {
if (addr == null) {
val = "0";
} else {
val = Long.toHexString(addr.getValue());
val = Long.toHexString(addr.asLongValue());
}
for (int i = 0; i < ((2 * machDesc.getAddressSize()) - val.length()); i++) {
buf.append('0');

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -293,11 +293,6 @@ public class LinuxAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -582,7 +582,7 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
/** From the LinuxDebugger interface */
public long getAddressValue(Address addr) {
if (addr == null) return 0;
return ((LinuxAddress) addr).getValue();
return addr.asLongValue();
}
/** From the LinuxDebugger interface */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -287,11 +287,6 @@ class ProcAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -285,11 +285,6 @@ class RemoteAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -303,7 +303,7 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
public long getAddressValue(Address addr) throws DebuggerException {
if (addr == null) return 0;
return ((RemoteAddress) addr).getValue();
return addr.asLongValue();
}
public Address newAddress(long value) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -297,11 +297,6 @@ class WindbgAddress implements Address {
// Internals only below this point
//
long getValue() {
return addr;
}
private static void check(boolean arg, String failMessage) {
if (!arg) {
System.err.println(failMessage + ": FAILED");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -412,7 +412,7 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
/** From the Debugger interface */
public long getAddressValue(Address addr) {
if (addr == null) return 0;
return ((WindbgAddress) addr).getValue();
return addr.asLongValue();
}
/** From the WindbgDebugger interface */
@ -473,7 +473,7 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
if (dll != null) {
WindbgAddress addr = (WindbgAddress) dll.lookupSymbol(symbol);
if (addr != null) {
return addr.getValue();
return addr.asLongValue();
}
}
return 0L;