mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-5176: Hovering on addresses in the Listing now show offsets in both
decimal and hexadecimal
This commit is contained in:
parent
c5b753e881
commit
69ee044f29
1 changed files with 11 additions and 4 deletions
|
@ -4,9 +4,9 @@
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -178,12 +178,19 @@ public class ProgramAddressRelationshipListingHover extends AbstractConfigurable
|
||||||
if (reference != null) {
|
if (reference != null) {
|
||||||
sb.append(italic(reference)).append(" ");
|
sb.append(italic(reference)).append(" ");
|
||||||
}
|
}
|
||||||
sb.append(formatOffset(offset));
|
sb.append(formatHexOffset(offset));
|
||||||
|
sb.append("</td>");
|
||||||
|
sb.append("<td style=\"text-align: right;\">");
|
||||||
|
sb.append(formatDecimalOffset(offset));
|
||||||
sb.append("</td></tr>");
|
sb.append("</td></tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String formatOffset(long offset) {
|
private static String formatHexOffset(long offset) {
|
||||||
return String.format("+%xh", offset);
|
return String.format("+%xh", offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String formatDecimalOffset(long offset) {
|
||||||
|
return String.format("(+%d)", offset);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue