Currently we use os::print_hex_dump for printing Instruction sections in the hserr file. The function could be slightly improved, .e.g. by showing directly the pc .
The instructions section would for example look like this, with a small helper '=>' pointing to the pc. Makes the output more readable.
Example taken from Linux x86_64.
Instructions: (pc=0x00007f65c8588760)
0x00007f65c8588660: e9 2f ff ff ff 0f 1f 00 31 d2 be 01 00 00 00 48
0x00007f65c8588670: 89 df e8 79 e8 e0 ff e9 0a ff ff ff 0f 1f 40 00
0x00007f65c8588680: 48 89 df e8 98 18 98 ff e9 cf fe ff ff 0f 1f 00
0x00007f65c8588690: 49 8d 7c 24 ff ff 15 f5 77 54 00 e9 36 ff ff ff
0x00007f65c85886a0: 49 8d 7c 24 fe ff 15 65 29 54 00 e9 26 ff ff ff
0x00007f65c85886b0: 55 48 89 e5 41 56 41 55 49 89 cd 41 54 49 89 d4
0x00007f65c85886c0: 53 48 8d 9f 40 fc ff ff 8b 83 68 04 00 00 2d ad
0x00007f65c85886d0: de 00 00 83 f8 01 0f 86 24 01 00 00 48 8d 05 8d
0x00007f65c85886e0: 86 58 00 80 38 00 c7 83 44 04 00 00 06 00 00 00
0x00007f65c85886f0: 75 05 f0 83 04 24 00 48 8b 83 48 04 00 00 a8 01
0x00007f65c8588700: 0f 85 e2 00 00 00 8b 83 40 04 00 00 a8 0c 0f 85
0x00007f65c8588710: c4 00 00 00 c7 83 44 04 00 00 06 00 00 00 48 8d
0x00007f65c8588720: bb 68 05 00 00 45 31 f6 e8 63 6b 90 ff 84 c0 75
0x00007f65c8588730: 3b 31 c0 4d 85 e4 74 1e 4c 89 e0 83 e0 03 48 83
0x00007f65c8588740: f8 01 0f 84 c8 00 00 00 48 83 f8 02 0f 84 ce 00
0x00007f65c8588750: 00 00 49 8b 04 24 49 01 c5 c6 83 70 04 00 00 01
=>0x00007f65c8588760: 45 0f b6 75 00 c6 83 70 04 00 00 00 4c 8b a3 98
0x00007f65c8588770: 01 00 00 49 8b 44 24 10 48 83 38 00 74 0d 4c 89
0x00007f65c8588780: e7 e8 9a 5d 90 ff 49 8b 44 24 10 49 8b 54 24 08
0x00007f65c8588790: 48 8d bb a0 03 00 00 48 89 42 18 49 8b 44 24 08
0x00007f65c85887a0: 49 8b 54 24 18 48 89 50 20 49 8b 44 24 08 49 8b
0x00007f65c85887b0: 54 24 20 48 89 50 28 e8 54 3c 80 ff c7 83 44 04
0x00007f65c85887c0: 00 00 04 00 00 00 44 89 f0 5b 41 5c 41 5d 41 5e
0x00007f65c85887d0: 5d c3 66 0f 1f 44 00 00 48 89 df e8 b0 24 98 ff
0x00007f65c85887e0: e9 2f ff ff ff 0f 1f 00 31 d2 be 01 00 00 00 48
0x00007f65c85887f0: 89 df e8 f9 e6 e0 ff e9 0a ff ff ff 0f 1f 40 00
0x00007f65c8588800: 48 89 df e8 18 17 98 ff e9 cf fe ff ff 0f 1f 00
0x00007f65c8588810: 49 8d 7c 24 ff ff 15 75 76 54 00 e9 36 ff ff ff
0x00007f65c8588820: 49 8d 7c 24 fe ff 15 e5 27 54 00 e9 26 ff ff ff
0x00007f65c8588830: 55 48 89 e5 41 55 41 54 49 89 d4 53 48 8d 9f 40
0x00007f65c8588840: fc ff ff 48 83 ec 08 8b 83 68 04 00 00 2d ad de
0x00007f65c8588850: 00 00 83 f8 01 0f 86 65 01 00 00 48 8d 05 0e 85
Visual Studio - generated instructions output seems to have some kind of 'filler bytes' cc cc cc ... cc between methods; we could highlight those too to make method start/ends clearer (but I am not sure if those 'fillers' are always used by VS across versions and opt-levels).
The instructions section would for example look like this, with a small helper '=>' pointing to the pc. Makes the output more readable.
Example taken from Linux x86_64.
Instructions: (pc=0x00007f65c8588760)
0x00007f65c8588660: e9 2f ff ff ff 0f 1f 00 31 d2 be 01 00 00 00 48
0x00007f65c8588670: 89 df e8 79 e8 e0 ff e9 0a ff ff ff 0f 1f 40 00
0x00007f65c8588680: 48 89 df e8 98 18 98 ff e9 cf fe ff ff 0f 1f 00
0x00007f65c8588690: 49 8d 7c 24 ff ff 15 f5 77 54 00 e9 36 ff ff ff
0x00007f65c85886a0: 49 8d 7c 24 fe ff 15 65 29 54 00 e9 26 ff ff ff
0x00007f65c85886b0: 55 48 89 e5 41 56 41 55 49 89 cd 41 54 49 89 d4
0x00007f65c85886c0: 53 48 8d 9f 40 fc ff ff 8b 83 68 04 00 00 2d ad
0x00007f65c85886d0: de 00 00 83 f8 01 0f 86 24 01 00 00 48 8d 05 8d
0x00007f65c85886e0: 86 58 00 80 38 00 c7 83 44 04 00 00 06 00 00 00
0x00007f65c85886f0: 75 05 f0 83 04 24 00 48 8b 83 48 04 00 00 a8 01
0x00007f65c8588700: 0f 85 e2 00 00 00 8b 83 40 04 00 00 a8 0c 0f 85
0x00007f65c8588710: c4 00 00 00 c7 83 44 04 00 00 06 00 00 00 48 8d
0x00007f65c8588720: bb 68 05 00 00 45 31 f6 e8 63 6b 90 ff 84 c0 75
0x00007f65c8588730: 3b 31 c0 4d 85 e4 74 1e 4c 89 e0 83 e0 03 48 83
0x00007f65c8588740: f8 01 0f 84 c8 00 00 00 48 83 f8 02 0f 84 ce 00
0x00007f65c8588750: 00 00 49 8b 04 24 49 01 c5 c6 83 70 04 00 00 01
=>0x00007f65c8588760: 45 0f b6 75 00 c6 83 70 04 00 00 00 4c 8b a3 98
0x00007f65c8588770: 01 00 00 49 8b 44 24 10 48 83 38 00 74 0d 4c 89
0x00007f65c8588780: e7 e8 9a 5d 90 ff 49 8b 44 24 10 49 8b 54 24 08
0x00007f65c8588790: 48 8d bb a0 03 00 00 48 89 42 18 49 8b 44 24 08
0x00007f65c85887a0: 49 8b 54 24 18 48 89 50 20 49 8b 44 24 08 49 8b
0x00007f65c85887b0: 54 24 20 48 89 50 28 e8 54 3c 80 ff c7 83 44 04
0x00007f65c85887c0: 00 00 04 00 00 00 44 89 f0 5b 41 5c 41 5d 41 5e
0x00007f65c85887d0: 5d c3 66 0f 1f 44 00 00 48 89 df e8 b0 24 98 ff
0x00007f65c85887e0: e9 2f ff ff ff 0f 1f 00 31 d2 be 01 00 00 00 48
0x00007f65c85887f0: 89 df e8 f9 e6 e0 ff e9 0a ff ff ff 0f 1f 40 00
0x00007f65c8588800: 48 89 df e8 18 17 98 ff e9 cf fe ff ff 0f 1f 00
0x00007f65c8588810: 49 8d 7c 24 ff ff 15 75 76 54 00 e9 36 ff ff ff
0x00007f65c8588820: 49 8d 7c 24 fe ff 15 e5 27 54 00 e9 26 ff ff ff
0x00007f65c8588830: 55 48 89 e5 41 55 41 54 49 89 d4 53 48 8d 9f 40
0x00007f65c8588840: fc ff ff 48 83 ec 08 8b 83 68 04 00 00 2d ad de
0x00007f65c8588850: 00 00 83 f8 01 0f 86 65 01 00 00 48 8d 05 0e 85
Visual Studio - generated instructions output seems to have some kind of 'filler bytes' cc cc cc ... cc between methods; we could highlight those too to make method start/ends clearer (but I am not sure if those 'fillers' are always used by VS across versions and opt-levels).
- links to
-
Commit(master) openjdk/jdk/b9e65f98
-
Review(master) openjdk/jdk/20419