public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* I compile gdbserver for RISCV on gdb10.1 version, and there is a error
@ 2020-11-13  2:43 hilihui
  2020-11-13 13:13 ` Simon Marchi
  0 siblings, 1 reply; 6+ messages in thread
From: hilihui @ 2020-11-13  2:43 UTC (permalink / raw)
  To: gdb

../../gdbserver/linux-riscv-low.cc:170:42: error: invalid application of 'sizeof' to incomplete type '__riscv_mc_q_ext_state'     sizeof (struct __riscv_mc_q_ext_state), OPTIONAL_REGS,                                          ^It seems that  "__riscv_mc_q_ext_state" is not defined. How to resolve this question? Thanks!

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

* Re: I compile gdbserver for RISCV on gdb10.1 version, and there is a error
  2020-11-13  2:43 I compile gdbserver for RISCV on gdb10.1 version, and there is a error hilihui
@ 2020-11-13 13:13 ` Simon Marchi
  2020-11-14  3:08   ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2020-11-13 13:13 UTC (permalink / raw)
  To: hilihui, gdb

On 2020-11-12 9:43 p.m., hilihui@sina.com wrote:
> ../../gdbserver/linux-riscv-low.cc:170:42: error: invalid application of 'sizeof' to incomplete type '__riscv_mc_q_ext_state'     sizeof (struct __riscv_mc_q_ext_state), OPTIONAL_REGS,                                          ^It seems that  "__riscv_mc_q_ext_state" is not defined. How to resolve this question? Thanks!
> 

In glibc, this type is provided here:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/sys/ucontext.h;h=a4e49fe37a1397fa1babeb0dcefb77341f1e7ad1;hb=HEAD#l65

And it appears to have been there since the beginning of the RISC-V support.

What libc is your system using?

Simon

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

* Re: I compile gdbserver for RISCV on gdb10.1 version, and there is a error
  2020-11-13 13:13 ` Simon Marchi
@ 2020-11-14  3:08   ` Jim Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Wilson @ 2020-11-14  3:08 UTC (permalink / raw)
  To: Simon Marchi; +Cc: hilihui, gdb

On Fri, Nov 13, 2020 at 5:13 AM Simon Marchi <simark@simark.ca> wrote:

> On 2020-11-12 9:43 p.m., hilihui@sina.com wrote:
> > ../../gdbserver/linux-riscv-low.cc:170:42: error: invalid application of
> 'sizeof' to incomplete type '__riscv_mc_q_ext_state'     sizeof (struct
> __riscv_mc_q_ext_state), OPTIONAL_REGS,
>       ^It seems that  "__riscv_mc_q_ext_state" is not defined. How to
> resolve this question? Thanks!
> >
>
> In glibc, this type is provided here:
>
>
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/sys/ucontext.h;h=a4e49fe37a1397fa1babeb0dcefb77341f1e7ad1;hb=HEAD#l65
>
> And it appears to have been there since the beginning of the RISC-V
> support.
>

Since the beginning of upstream support, yes.  But it was an academic
project for years before it was upstreamed and some people are stuck with
old stuff because they forked a while back and never upgraded.  Or maybe
haven't upgraded yet.  The ETH Zurich pulp project for instance.

> What libc is your system using?
>

He sent me private mail too.  I suspect he is missing the linux kernel
RISC-V specific ptrace support also.  That came after the glibc support.

Jim

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

* Re: I compile gdbserver for RISCV on gdb10.1 version, and there is a error
  2020-11-20 20:37     ` Jim Wilson
@ 2020-11-21 17:03       ` Rodney M. Bates
  0 siblings, 0 replies; 6+ messages in thread
From: Rodney M. Bates @ 2020-11-21 17:03 UTC (permalink / raw)
  To: gdb



On 11/20/20 2:37 PM, Jim Wilson wrote:
> On Fri, Nov 20, 2020 at 7:48 AM Rodney M. Bates <rodney_bates@lcwb.coop>
> wrote:
> 
>> On 11/16/20 3:55 PM, Jim Wilson wrote:
>>> If you have an old linux kernel, gdb will not work due to bugs in the
>> linux
>>> kernel ptrace support.  I submitted two patches to fix two problems in
>> Fall
>>> 2018.  Then there was a third patch to add support for FP registers but
>> you
>>> only need that one if you want to look at FP registers.  You definitely
>>
>> How old a Linux kernel has these bugs?
>>
> 
> Fall 2018.  I don't know linux kernel version numbers.  You can look it
> up.  Certainly 4.15 won't work without patches.  But another person pointed
> at a patched 4.15 tree that has the two most important patches.
> 

OK, thanks.

> Jim
> 

-- 
Rodney Bates
rodney.m.bates@acm.org

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

* Re: I compile gdbserver for RISCV on gdb10.1 version, and there is a error
  2020-11-20 15:47   ` Rodney M. Bates
@ 2020-11-20 20:37     ` Jim Wilson
  2020-11-21 17:03       ` Rodney M. Bates
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2020-11-20 20:37 UTC (permalink / raw)
  To: rodney.m.bates; +Cc: gdb

On Fri, Nov 20, 2020 at 7:48 AM Rodney M. Bates <rodney_bates@lcwb.coop>
wrote:

> On 11/16/20 3:55 PM, Jim Wilson wrote:
> > If you have an old linux kernel, gdb will not work due to bugs in the
> linux
> > kernel ptrace support.  I submitted two patches to fix two problems in
> Fall
> > 2018.  Then there was a third patch to add support for FP registers but
> you
> > only need that one if you want to look at FP registers.  You definitely
>
> How old a Linux kernel has these bugs?
>

Fall 2018.  I don't know linux kernel version numbers.  You can look it
up.  Certainly 4.15 won't work without patches.  But another person pointed
at a patched 4.15 tree that has the two most important patches.

Jim

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

* Re: I compile gdbserver for RISCV on gdb10.1 version, and there is a error
  2020-11-16 21:55 ` Jim Wilson
@ 2020-11-20 15:47   ` Rodney M. Bates
  2020-11-20 20:37     ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Rodney M. Bates @ 2020-11-20 15:47 UTC (permalink / raw)
  To: gdb



On 11/16/20 3:55 PM, Jim Wilson wrote:
> On Mon, Nov 16, 2020 at 5:38 AM <hilihui@sina.com> wrote:
> 
>> So do you mean that the gdb for RISCV on some project is not supported,
>> because these projects still use the old linux kernel system.
>>
>> Now i am working on "https://github.com/pulp-platform/ariane-sdk"
>> project, and the project still use the old linux kernel system, so the gdb
>> on the platform is not available.
>>
> 
> If you have an old linux kernel, gdb will not work due to bugs in the linux
> kernel ptrace support.  I submitted two patches to fix two problems in Fall
> 2018.  Then there was a third patch to add support for FP registers but you
> only need that one if you want to look at FP registers.  You definitely

How old a Linux kernel has these bugs?

> need the first two patches in the kernel.
> 
> Jim
> 

-- 
Rodney Bates
rodney.m.bates@acm.org

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

end of thread, other threads:[~2020-11-21 17:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  2:43 I compile gdbserver for RISCV on gdb10.1 version, and there is a error hilihui
2020-11-13 13:13 ` Simon Marchi
2020-11-14  3:08   ` Jim Wilson
     [not found] <20201116133833.1659C5D000A6@webmail.sinamail.sina.com.cn>
2020-11-16 21:55 ` Jim Wilson
2020-11-20 15:47   ` Rodney M. Bates
2020-11-20 20:37     ` Jim Wilson
2020-11-21 17:03       ` Rodney M. Bates

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).