On Sat, 27 Jun 2026 04:06:20 GMT, Chris Plummer <[email protected]> wrote:

>> Yes, we can move it to near the insantiate of `MachineDescriptorAArch64` in 
>> case of live attach, but I think it is better to place it in similar place 
>> for core attaching for consistency. We have to get the status of PAC from 
>> coredump after attaching in case of the core because we have to consider to 
>> analyze coredump produced by PAC-enabled machine on PAC-disabled machine.
>
> I was actually implying moving it for a core file attach also. This just 
> doesn't seem like the proper place for CPU dependent code.

Is the following code appropriate?
Introduce `attachInternal()` in `LinuxDebuggerLocal` to call `attach0()`, then 
`LinuxAARCH64DebuggerLocal` overrides it to check PAC.


@Override
protected void attachInternal(int pid) throws DebuggerException) {
  super.attachInternal(pid); // call "attach0()" in super class 
(LinuxDebuggerLocal)
  if (pacEnabled()) {
    ((MachineDescriptionAArch64)d.getMachineDescription()).enablePAC();
  }
}

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31669#discussion_r3486244401

Reply via email to