This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: x86: fix x32 builds with inline asm


On Tuesday 08 January 2013 10:36:11 H.J. Lu wrote:
> On Tue, Jan 8, 2013 at 7:01 AM, Mike Frysinger wrote:
> > --- a/gdb/common/linux-ptrace.c
> > +++ b/gdb/common/linux-ptrace.c
> > @@ -103,21 +103,11 @@ linux_ptrace_test_ret_to_nx (void)
> >                  strerror (errno));
> >        else
> >         {
> > -#if defined __i386__
> > -         asm volatile ("pushl %0;"
> > -                       ".globl linux_ptrace_test_ret_to_nx_instr;"
> > -                       "linux_ptrace_test_ret_to_nx_instr:"
> > -                       "ret"
> > -                       : : "r" (return_address) : "%esp", "memory");
> > -#elif defined __x86_64__
> > -         asm volatile ("pushq %0;"
> > +         asm volatile ("push %0;"
> >                         ".globl linux_ptrace_test_ret_to_nx_instr;"
> >                         "linux_ptrace_test_ret_to_nx_instr:"
> >                         "ret"
> > -                       : : "r" (return_address) : "%rsp", "memory");
> > -#else
> > -# error "!__i386__ && !__x86_64__"
> > -#endif
> > +                       : : "r" (return_address) : "sp", "memory");
> >           gdb_assert_not_reached ("asm block did not terminate");
> >         }
> 
> I think we should keep
> 
> #else
> # error "!__i386__ && !__x86_64__"
> #endif

that #else case is currently impossible to hit because the whole func is 
protected by:
#if defined __i386__ || defined __x86_64__

i'm guessing the #else was there only to make sure that some asm test was 
performed, but since there is no conditional asm, that's no longer an issue
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]