Re: [PATCH] [RFC] PR target/52813 and target/11807

Dimitar Dimitrov <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gdb.devel
Message-ID <3795301.LoOEyI2oHe@tpdeb>
On Mon, Dec 17 2018 20:15:02 EET Bernd Edlinger wrote:
> out of curiosity I looked at the clobber statement in
> gdb/nat/linux-ptrace.c:
> 
>            asm volatile ("pushq %0;"
>                          ".globl linux_ptrace_test_ret_to_nx_instr;"
>                          "linux_ptrace_test_ret_to_nx_instr:"
>                          "ret"
>                          : : "r" ((uint64_t) (uintptr_t) return_address)
>                          : "%rsp", "memory");
> 
> it turns out to be a far jump, instruction.

GDB functionality should not be affected if SP clobber is removed, even if the 
generated code is slightly different. Please see this comment:
http://sourceware.org/ml/gdb-patches/2018-12/msg00204.html

As I understand it, this particular code is never meant to return. It should 
either stop due to the NX mapping of return_address/%0, or hit the breakpoint 
placed at return_address/%0.

Regards,
Dimitar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.