This is the mail archive of the mailing list for the glibc 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: Add x32 arch_prctl support

> > This is probably going to get a "might be used uninitialized" warning.
> Yes.  Should I silence it?

Whenever you can reorganize the code so as not to get such a warning,
without actually producing less optimal compiled code, then do.

> > Anyway, I think it's cleaner to pass an 'unsigned long long int' (or
> > uint64_t) to the syscall, since that's what it is in the kernel.
> > Might as well just make it:
> I thought about it and decided against it since it will require
> special treatment for x32 when it is used.

I don't understand.  Please elaborate.

> PTRACE_ARCH_PRCTL is x86 specific and is only used by GDB,
> GDB has #ifdef to define it, which will never be removed.  If we add
> it to ptrace.h, I have to add it a new ptrace for x86-64.  I don't think
> we should do it.

Well, it's unclean to have parts of the API that we don't properly
declare in our headers.  So generically I would want to clean this up.
But since it so happens that PTRACE_ARCH_PRCTL is obsolete with modern
kernels anyway, I don't think it's worth the trouble.

> >> +  switch ((int) request)
> >> +    {
> >
> > There's no need to cast to int when you have a default case anyway.
> I need it if PTRACE_ARCH_PRCTL isn't in x86-64 ptrace.h.

You mean the compiler complains about a case that is not part of the enum?

> That is true. However, since it is used in GDB today, I need it
> to support it for x32.

There is no legacy of a GDB compiled with -mx32 that must continue to work.
For an -m64 GDB, there is no problem and won't be one.


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