public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch, nios2] Update Linux parts for new syscall ABI
@ 2013-12-01  8:20 Chung-Lin Tang
  2013-12-02  3:23 ` Joel Brobecker
  2013-12-03  3:07 ` Joel Brobecker
  0 siblings, 2 replies; 10+ messages in thread
From: Chung-Lin Tang @ 2013-12-01  8:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Sandra Loosemore

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

This patch updates the nios2-linux code for the new Linux generic system
call interface. Mainly removing (non-rt) sigreturn related definitions,
and updating the rt_sigreturn syscall NR.

Will commit after Sandra's approval.

Thanks,
Chung-Lin

2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>

        gdb/
        * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
        (nios2_linux_sigreturn_tramp_frame): Remove.
        (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
        number.
        (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
        (nios2_linux_init_abi):
        Remove registration of nios2_linux_sigreturn_tramp_frame.

[-- Attachment #2: x.diff --]
[-- Type: text/plain, Size: 3209 bytes --]

diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index fe29e7a..2051d45 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -97,33 +97,6 @@ nios2_regset_from_core_section (struct gdbarch *gdbarch,
    FUNC is the address of the instruction TRAMP[0] in memory.  */
 
 static void
-nios2_linux_sigreturn_init (const struct tramp_frame *self,
-			    struct frame_info *next_frame,
-			    struct trad_frame_cache *this_cache,
-			    CORE_ADDR func)
-{
-  CORE_ADDR base = func + 16;
-  int i;
-
-  for (i = 0; i < 8; i++)
-    trad_frame_set_reg_addr (this_cache, i + 8, base + i * 4);
-  for (i = 0; i < 7; i++)
-    trad_frame_set_reg_addr (this_cache, i + 1, base + (i + 8) * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_RA_REGNUM, base + 16 * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_FP_REGNUM, base + 17 * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_SP_REGNUM, base + 18 * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_GP_REGNUM, base + 19 * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_ESTATUS_REGNUM, base + 20 * 4);
-  trad_frame_set_reg_addr (this_cache, NIOS2_PC_REGNUM, base + 21 * 4);
-
-  /* Save a frame ID.  */
-  trad_frame_set_id (this_cache, frame_id_build (base, func));
-}
-
-/* Initialize a trad-frame cache corresponding to the tramp-frame.
-   FUNC is the address of the instruction TRAMP[0] in memory.  */
-
-static void
 nios2_linux_rt_sigreturn_init (const struct tramp_frame *self,
 			       struct frame_info *next_frame,
 			       struct trad_frame_cache *this_cache,
@@ -144,24 +117,12 @@ nios2_linux_rt_sigreturn_init (const struct tramp_frame *self,
   trad_frame_set_id (this_cache, frame_id_build (base, func));
 }
 
-static struct tramp_frame nios2_linux_sigreturn_tramp_frame =
-{
-  SIGTRAMP_FRAME,
-  4,
-  {
-    { 0x00800004 | (119 << 6), -1 },  /* movi r2,__NR_sigreturn */
-    { 0x003b683a, -1 },               /* trap */
-    { TRAMP_SENTINEL_INSN }
-  },
-  nios2_linux_sigreturn_init
-};
-
 static struct tramp_frame nios2_linux_rt_sigreturn_tramp_frame =
 {
   SIGTRAMP_FRAME,
   4,
   {
-    { 0x00800004 | (173 << 6), -1 },  /* movi r2,__NR_rt_sigreturn */
+    { 0x00800004 | (139 << 6), -1 },  /* movi r2,__NR_rt_sigreturn */
     { 0x003b683a, -1 },               /* trap */
     { TRAMP_SENTINEL_INSN }
   },
@@ -179,8 +140,7 @@ nios2_linux_syscall_next_pc (struct frame_info *frame)
 
   /* If we are about to make a sigreturn syscall, use the unwinder to
      decode the signal frame.  */
-  if (syscall_nr == 119 /* sigreturn */
-      || syscall_nr == 173 /* rt_sigreturn */)
+  if (syscall_nr == 139 /* rt_sigreturn */)
     return frame_unwind_caller_pc (frame);
 
   return pc + NIOS2_OPCODE_SIZE;
@@ -209,8 +169,6 @@ nios2_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                         nios2_regset_from_core_section);
   /* Linux signal frame unwinders.  */
   tramp_frame_prepend_unwinder (gdbarch,
-                                &nios2_linux_sigreturn_tramp_frame);
-  tramp_frame_prepend_unwinder (gdbarch,
                                 &nios2_linux_rt_sigreturn_tramp_frame);
 
   tdep->syscall_next_pc = nios2_linux_syscall_next_pc;

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-01  8:20 [patch, nios2] Update Linux parts for new syscall ABI Chung-Lin Tang
@ 2013-12-02  3:23 ` Joel Brobecker
  2013-12-02  4:46   ` Chung-Lin Tang
  2013-12-03  3:07 ` Joel Brobecker
  1 sibling, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2013-12-02  3:23 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gdb-patches, Sandra Loosemore

> This patch updates the nios2-linux code for the new Linux generic system
> call interface. Mainly removing (non-rt) sigreturn related definitions,
> and updating the rt_sigreturn syscall NR.
> 
> Will commit after Sandra's approval.

I am sorry to be so procedural, but while Sandra input would probably
be more valuable than most, Sandra is not yet listed as maintainer
in GDB. She can therefore not approve patches for commit in the official
repository yet. It should all be documented in gdb/MAINTAINERS.

> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
> 
>         gdb/
>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
>         (nios2_linux_sigreturn_tramp_frame): Remove.
>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
>         number.
>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
>         (nios2_linux_init_abi):
>         Remove registration of nios2_linux_sigreturn_tramp_frame.

My concern with your patch is that it seems to eliminate support for
the previous syscall ABI, which means a break in compatibility. Unless
we really have no other choice, I don't think we would want that.

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02  3:23 ` Joel Brobecker
@ 2013-12-02  4:46   ` Chung-Lin Tang
  2013-12-02  7:44     ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Chung-Lin Tang @ 2013-12-02  4:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Sandra Loosemore

On 13/12/2 11:23 AM, Joel Brobecker wrote:
>> This patch updates the nios2-linux code for the new Linux generic system
>> call interface. Mainly removing (non-rt) sigreturn related definitions,
>> and updating the rt_sigreturn syscall NR.
>>
>> Will commit after Sandra's approval.
> 
> I am sorry to be so procedural, but while Sandra input would probably
> be more valuable than most, Sandra is not yet listed as maintainer
> in GDB. She can therefore not approve patches for commit in the official
> repository yet. It should all be documented in gdb/MAINTAINERS.

Is Sandra not nios2 maintainer, or is she just not yet added to the
MAINTAINERS file?

>> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
>>
>>         gdb/
>>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
>>         (nios2_linux_sigreturn_tramp_frame): Remove.
>>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
>>         number.
>>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
>>         (nios2_linux_init_abi):
>>         Remove registration of nios2_linux_sigreturn_tramp_frame.
> 
> My concern with your patch is that it seems to eliminate support for
> the previous syscall ABI, which means a break in compatibility. Unless
> we really have no other choice, I don't think we would want that.

This is a coordinated change, Altera will be using the new syscall ABI
when they upstream the kernel port.

Thanks,
Chung-Lin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02  4:46   ` Chung-Lin Tang
@ 2013-12-02  7:44     ` Joel Brobecker
  2013-12-02  8:38       ` Chung-Lin Tang
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2013-12-02  7:44 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gdb-patches, Sandra Loosemore

> Is Sandra not nios2 maintainer, or is she just not yet added to the
> MAINTAINERS file?

She is not maintainer as far as I know (yet?).

> >> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
> >>
> >>         gdb/
> >>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
> >>         (nios2_linux_sigreturn_tramp_frame): Remove.
> >>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
> >>         number.
> >>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
> >>         (nios2_linux_init_abi):
> >>         Remove registration of nios2_linux_sigreturn_tramp_frame.
> > 
> > My concern with your patch is that it seems to eliminate support for
> > the previous syscall ABI, which means a break in compatibility. Unless
> > we really have no other choice, I don't think we would want that.
> 
> This is a coordinated change, Altera will be using the new syscall ABI
> when they upstream the kernel port.

I understand that. But is it conceivable that someone might be wanting
to use the new GDB while still running on the old kernel, with the old
software convention? How about the transition period? A break in
compatibility is very unfriendly for the average user, and needs
to be carefully considered.

I don't have any personal interest in this, other than trying to serve
the interest of the potential users. If it's deemed too hard or useless
by the nios community, then I won't object.

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02  7:44     ` Joel Brobecker
@ 2013-12-02  8:38       ` Chung-Lin Tang
  2013-12-02 16:20         ` Sandra Loosemore
  0 siblings, 1 reply; 10+ messages in thread
From: Chung-Lin Tang @ 2013-12-02  8:38 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Sandra Loosemore

On 13/12/2 3:44 PM, Joel Brobecker wrote:
>> Is Sandra not nios2 maintainer, or is she just not yet added to the
>> MAINTAINERS file?
> 
> She is not maintainer as far as I know (yet?).

Then I guess something was missed during the port submission? Is nios2
currently (technically) maintainer-less? ^^;;

>>>> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
>>>>
>>>>         gdb/
>>>>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
>>>>         (nios2_linux_sigreturn_tramp_frame): Remove.
>>>>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
>>>>         number.
>>>>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
>>>>         (nios2_linux_init_abi):
>>>>         Remove registration of nios2_linux_sigreturn_tramp_frame.
>>>
>>> My concern with your patch is that it seems to eliminate support for
>>> the previous syscall ABI, which means a break in compatibility. Unless
>>> we really have no other choice, I don't think we would want that.
>>
>> This is a coordinated change, Altera will be using the new syscall ABI
>> when they upstream the kernel port.
> 
> I understand that. But is it conceivable that someone might be wanting
> to use the new GDB while still running on the old kernel, with the old
> software convention? How about the transition period? A break in
> compatibility is very unfriendly for the average user, and needs
> to be carefully considered.

nios2 support will only appear in the next 7.7 release. We're trying to
ensure only new-ABI support appears in formal FSF releases across all
toolchain components.

> I don't have any personal interest in this, other than trying to serve
> the interest of the potential users. If it's deemed too hard or useless
> by the nios community, then I won't object.

I can't personally judge what the community will react. However, our
work with Altera is to move everything towards the new syscall ABI. The
upstreamed ports of GCC and glibc will also be entirely new-ABI.

Thanks,
Chung-Lin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02  8:38       ` Chung-Lin Tang
@ 2013-12-02 16:20         ` Sandra Loosemore
  2013-12-03  3:01           ` Joel Brobecker
  2013-12-10  6:55           ` Yao Qi
  0 siblings, 2 replies; 10+ messages in thread
From: Sandra Loosemore @ 2013-12-02 16:20 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: Joel Brobecker, gdb-patches

On 12/02/2013 01:37 AM, Chung-Lin Tang wrote:
> On 13/12/2 3:44 PM, Joel Brobecker wrote:
>>> Is Sandra not nios2 maintainer, or is she just not yet added to the
>>> MAINTAINERS file?
>>
>> She is not maintainer as far as I know (yet?).
>
> Then I guess something was missed during the port submission? Is nios2
> currently (technically) maintainer-less? ^^;;

FWIW, I did volunteer to be nios2 maintainer when I submitted the port. 
  I don't know if accepting the port automatically made me maintainer, 
or not.  If there is a separate process for naming maintainers, I'd be 
fine with Chung-Lin being named a co-maintainer too since he knows as 
much about this code as I do.

> nios2 support will only appear in the next 7.7 release. We're trying to
> ensure only new-ABI support appears in formal FSF releases across all
> toolchain components.
>
>> I don't have any personal interest in this, other than trying to serve
>> the interest of the potential users. If it's deemed too hard or useless
>> by the nios community, then I won't object.
>
> I can't personally judge what the community will react. However, our
> work with Altera is to move everything towards the new syscall ABI. The
> upstreamed ports of GCC and glibc will also be entirely new-ABI.

Given that nios2 GCC, glibc, and Linux kernel ports are not upstream 
yet, I think "the community" is primarily using the complete toolchains 
packaged by Altera or Mentor Graphics, which already include a GDB that 
works with the other old-ABI components packaged with those toolchains. 
  Altera wants to switch completely to the new ABI, and there will be no 
old-ABI compatibility support in future versions of GCC, glibc, or 
Linux; why is it needed in GDB?

-Sandra

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02 16:20         ` Sandra Loosemore
@ 2013-12-03  3:01           ` Joel Brobecker
  2013-12-10  6:55           ` Yao Qi
  1 sibling, 0 replies; 10+ messages in thread
From: Joel Brobecker @ 2013-12-03  3:01 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: Chung-Lin Tang, gdb-patches

> Given that nios2 GCC, glibc, and Linux kernel ports are not upstream
> yet, I think "the community" is primarily using the complete
> toolchains packaged by Altera or Mentor Graphics, which already
> include a GDB that works with the other old-ABI components packaged
> with those toolchains.  Altera wants to switch completely to the new
> ABI, and there will be no old-ABI compatibility support in future
> versions of GCC, glibc, or Linux; why is it needed in GDB?

I wasn't saying that this was needed for GDB, just that it usually
is very unfriendly to break compatibility if users (what I called
the "community" for lack of better words) are allowed to mix and
match the various elements of the system. When I see such a deliberate
break, I always prefer to make sure that this is OK, so I asked.
In your case, you are explaining why this is not a problem, and
I see your point. But it is important, IMO, to have that explained,
if only for the public record.

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-01  8:20 [patch, nios2] Update Linux parts for new syscall ABI Chung-Lin Tang
  2013-12-02  3:23 ` Joel Brobecker
@ 2013-12-03  3:07 ` Joel Brobecker
  2013-12-20 13:16   ` Chung-Lin Tang
  1 sibling, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2013-12-03  3:07 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gdb-patches, Sandra Loosemore

> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
> 
>         gdb/
>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
>         (nios2_linux_sigreturn_tramp_frame): Remove.
>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
>         number.
>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
>         (nios2_linux_init_abi):
>         Remove registration of nios2_linux_sigreturn_tramp_frame.

This is OK for me, but I think a change of this kind requires a NEWS
entry as well, to document on which systems the new GDB will be working.

-- 
Joel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-02 16:20         ` Sandra Loosemore
  2013-12-03  3:01           ` Joel Brobecker
@ 2013-12-10  6:55           ` Yao Qi
  1 sibling, 0 replies; 10+ messages in thread
From: Yao Qi @ 2013-12-10  6:55 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: Chung-Lin Tang, Joel Brobecker, gdb-patches

On 12/03/2013 12:19 AM, Sandra Loosemore wrote:
> FWIW, I did volunteer to be nios2 maintainer when I submitted the port.
>    I don't know if accepting the port automatically made me maintainer,
> or not.  If there is a separate process for naming maintainers, I'd be
> fine with Chung-Lin being named a co-maintainer too since he knows as
> much about this code as I do.

As a GDB person, I'd like to give a hand with it, if Sandra and
Chung-Lin prefer working more on gcc/glibc stuff.

I skimmed the nios2-*.[ch] and the port looks quite neat.  I can make
use of my tic6x porting experience to help nios2 port.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch, nios2] Update Linux parts for new syscall ABI
  2013-12-03  3:07 ` Joel Brobecker
@ 2013-12-20 13:16   ` Chung-Lin Tang
  0 siblings, 0 replies; 10+ messages in thread
From: Chung-Lin Tang @ 2013-12-20 13:16 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Sandra Loosemore, Qi, Yao, Stan Shebs

On 2013/12/3 11:06 AM, Joel Brobecker wrote:
>> 2013-12-01  Chung-Lin Tang  <cltang@codesourcery.com>
>>
>>         gdb/
>>         * nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
>>         (nios2_linux_sigreturn_tramp_frame): Remove.
>>         (nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
>>         number.
>>         (nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
>>         (nios2_linux_init_abi):
>>         Remove registration of nios2_linux_sigreturn_tramp_frame.
> 
> This is OK for me, but I think a change of this kind requires a NEWS
> entry as well, to document on which systems the new GDB will be working.

I have committed/pushed this to master. As for a NEWS entry, we already
have an announcement for nios2*-linux. If you feel it would be more
appropriate, I can append a "(generic syscall ABI)" besides it, to be
more clear on the supported systems.

As for the issue of nios2 port maintainer, Yao already volunteered
earlier, or if someone more familiar with nios2 details is desired, I
can fill in the task.

Thanks,
Chung-Lin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-20 13:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-01  8:20 [patch, nios2] Update Linux parts for new syscall ABI Chung-Lin Tang
2013-12-02  3:23 ` Joel Brobecker
2013-12-02  4:46   ` Chung-Lin Tang
2013-12-02  7:44     ` Joel Brobecker
2013-12-02  8:38       ` Chung-Lin Tang
2013-12-02 16:20         ` Sandra Loosemore
2013-12-03  3:01           ` Joel Brobecker
2013-12-10  6:55           ` Yao Qi
2013-12-03  3:07 ` Joel Brobecker
2013-12-20 13:16   ` Chung-Lin Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).