* [PATCH] gdb: fix sparc build failure of linux-nat
@ 2021-04-25 20:03 Sergei Trofimovich via Gdb-patches
2021-04-25 23:55 ` Simon Marchi via Gdb-patches
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich via Gdb-patches @ 2021-04-25 20:03 UTC (permalink / raw)
To: gdb-patches; +Cc: Sergei Trofimovich
From: Sergei Trofimovich <siarheit@google.com>
On sparc build failed as:
```
gdb/sparc-linux-nat.c: In member function
'virtual void sparc_linux_nat_target::fetch_registers(regcache*, int)':
gdb/sparc-linux-nat.c:36:37:
error: cannot convert 'regcache*' to 'process_stratum_target*'
36 | { sparc_fetch_inferior_registers (regcache, regnum); }
| ^~~~~~~~
| |
| regcache*
```
The fix adopts gdb/sparc-nat.h API change in d1e93af64a6
("gdb: set current thread in sparc_{fetch,collect}_inferior_registers").
gdb/ChangeLog:
* sparc-linux-nat.c (sparc_linux_nat_target): fix sparc build
by passing `process_stratum_target*` parameter.
---
gdb/sparc-linux-nat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
index c644d441228..33a17afa21e 100644
--- a/gdb/sparc-linux-nat.c
+++ b/gdb/sparc-linux-nat.c
@@ -33,10 +33,10 @@ class sparc_linux_nat_target final : public linux_nat_target
public:
/* Add our register access methods. */
void fetch_registers (struct regcache *regcache, int regnum) override
- { sparc_fetch_inferior_registers (regcache, regnum); }
+ { sparc_fetch_inferior_registers (this, regcache, regnum); }
void store_registers (struct regcache *regcache, int regnum) override
- { sparc_store_inferior_registers (regcache, regnum); }
+ { sparc_store_inferior_registers (this, regcache, regnum); }
};
static sparc_linux_nat_target the_sparc_linux_nat_target;
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: fix sparc build failure of linux-nat
2021-04-25 20:03 [PATCH] gdb: fix sparc build failure of linux-nat Sergei Trofimovich via Gdb-patches
@ 2021-04-25 23:55 ` Simon Marchi via Gdb-patches
2021-04-26 6:27 ` Sergei Trofimovich via Gdb-patches
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-04-25 23:55 UTC (permalink / raw)
To: Sergei Trofimovich, gdb-patches; +Cc: Sergei Trofimovich
On 2021-04-25 4:03 p.m., Sergei Trofimovich via Gdb-patches wrote:
> From: Sergei Trofimovich <siarheit@google.com>
>
> On sparc build failed as:
>
> ```
> gdb/sparc-linux-nat.c: In member function
> 'virtual void sparc_linux_nat_target::fetch_registers(regcache*, int)':
> gdb/sparc-linux-nat.c:36:37:
> error: cannot convert 'regcache*' to 'process_stratum_target*'
> 36 | { sparc_fetch_inferior_registers (regcache, regnum); }
> | ^~~~~~~~
> | |
> | regcache*
> ```
>
> The fix adopts gdb/sparc-nat.h API change in d1e93af64a6
> ("gdb: set current thread in sparc_{fetch,collect}_inferior_registers").
>
> gdb/ChangeLog:
>
> * sparc-linux-nat.c (sparc_linux_nat_target): fix sparc build
> by passing `process_stratum_target*` parameter.
> ---
> gdb/sparc-linux-nat.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
> index c644d441228..33a17afa21e 100644
> --- a/gdb/sparc-linux-nat.c
> +++ b/gdb/sparc-linux-nat.c
> @@ -33,10 +33,10 @@ class sparc_linux_nat_target final : public linux_nat_target
> public:
> /* Add our register access methods. */
> void fetch_registers (struct regcache *regcache, int regnum) override
> - { sparc_fetch_inferior_registers (regcache, regnum); }
> + { sparc_fetch_inferior_registers (this, regcache, regnum); }
>
> void store_registers (struct regcache *regcache, int regnum) override
> - { sparc_store_inferior_registers (regcache, regnum); }
> + { sparc_store_inferior_registers (this, regcache, regnum); }
> };
>
> static sparc_linux_nat_target the_sparc_linux_nat_target;
>
Thanks, this is OK, and sorry about the breakage. If you don't have
push access, tell me and I'll push it for you (but there's one commit
where you are the committer, so I presume you have push access).
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: fix sparc build failure of linux-nat
2021-04-25 23:55 ` Simon Marchi via Gdb-patches
@ 2021-04-26 6:27 ` Sergei Trofimovich via Gdb-patches
0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich via Gdb-patches @ 2021-04-26 6:27 UTC (permalink / raw)
To: Simon Marchi; +Cc: Sergei Trofimovich, gdb-patches
On Sun, 25 Apr 2021 19:55:53 -0400
Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2021-04-25 4:03 p.m., Sergei Trofimovich via Gdb-patches wrote:
> > From: Sergei Trofimovich <siarheit@google.com>
> >
> > On sparc build failed as:
> >
> > ```
> > gdb/sparc-linux-nat.c: In member function
> > 'virtual void sparc_linux_nat_target::fetch_registers(regcache*, int)':
> > gdb/sparc-linux-nat.c:36:37:
> > error: cannot convert 'regcache*' to 'process_stratum_target*'
> > 36 | { sparc_fetch_inferior_registers (regcache, regnum); }
> > | ^~~~~~~~
> > | |
> > | regcache*
> > ```
> >
> > The fix adopts gdb/sparc-nat.h API change in d1e93af64a6
> > ("gdb: set current thread in sparc_{fetch,collect}_inferior_registers").
> >
> > gdb/ChangeLog:
> >
> > * sparc-linux-nat.c (sparc_linux_nat_target): fix sparc build
> > by passing `process_stratum_target*` parameter.
> > ---
> > gdb/sparc-linux-nat.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
> > index c644d441228..33a17afa21e 100644
> > --- a/gdb/sparc-linux-nat.c
> > +++ b/gdb/sparc-linux-nat.c
> > @@ -33,10 +33,10 @@ class sparc_linux_nat_target final : public linux_nat_target
> > public:
> > /* Add our register access methods. */
> > void fetch_registers (struct regcache *regcache, int regnum) override
> > - { sparc_fetch_inferior_registers (regcache, regnum); }
> > + { sparc_fetch_inferior_registers (this, regcache, regnum); }
> >
> > void store_registers (struct regcache *regcache, int regnum) override
> > - { sparc_store_inferior_registers (regcache, regnum); }
> > + { sparc_store_inferior_registers (this, regcache, regnum); }
> > };
> >
> > static sparc_linux_nat_target the_sparc_linux_nat_target;
> >
>
> Thanks, this is OK, and sorry about the breakage. If you don't have
> push access, tell me and I'll push it for you (but there's one commit
> where you are the committer, so I presume you have push access).
Ah, that's fine. Pushed as:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c290cb01fa
(also included the gdb/ChangeLog bit).
--
Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-26 6:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 20:03 [PATCH] gdb: fix sparc build failure of linux-nat Sergei Trofimovich via Gdb-patches
2021-04-25 23:55 ` Simon Marchi via Gdb-patches
2021-04-26 6:27 ` Sergei Trofimovich via Gdb-patches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox