public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Update gdbarch.py with latest changes in gdbarch.c
@ 2023-01-11 17:45 Thiago Jung Bauermann
  2023-01-11 18:42 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Jung Bauermann @ 2023-01-11 17:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

Commit 2b16913cdca2 ("gdb: make gdbarch_alloc take ownership of the tdep")
changed gdbarch.c without updating gdbarch.py.  As a result, running
gdbarch.py reverts those changes and causes the build to fail.

So change gdbarch.py to generate the current version of gdbarch.c.
---
 gdb/gdbarch.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
index d2bf86039d11..7dc79386940f 100755
--- a/gdb/gdbarch.py
+++ b/gdb/gdbarch.py
@@ -286,7 +286,7 @@ with open("gdbarch.c", "w") as f:
         print(f"  {c.type} {c.name};", file=f)
     print(file=f)
     print("  /* target specific vector.  */", file=f)
-    print("  struct gdbarch_tdep_base *tdep = nullptr;", file=f)
+    print("  gdbarch_tdep_up tdep;", file=f)
     print("  gdbarch_dump_tdep_ftype *dump_tdep = nullptr;", file=f)
     print(file=f)
     print("  /* per-architecture data-pointers.  */", file=f)
@@ -316,13 +316,13 @@ with open("gdbarch.c", "w") as f:
     print(file=f)
     print("struct gdbarch *", file=f)
     print("gdbarch_alloc (const struct gdbarch_info *info,", file=f)
-    print("	       struct gdbarch_tdep_base *tdep)", file=f)
+    print("	       gdbarch_tdep_up tdep)", file=f)
     print("{", file=f)
     print("  struct gdbarch *gdbarch;", file=f)
     print("", file=f)
     print("  gdbarch = new struct gdbarch;", file=f)
     print(file=f)
-    print("  gdbarch->tdep = tdep;", file=f)
+    print("  gdbarch->tdep = std::move (tdep);", file=f)
     print(file=f)
     for c in filter(info, components):
         print(f"  gdbarch->{c.name} = info->{c.name};", file=f)

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

* Re: [PATCH] gdb: Update gdbarch.py with latest changes in gdbarch.c
  2023-01-11 17:45 [PATCH] gdb: Update gdbarch.py with latest changes in gdbarch.c Thiago Jung Bauermann
@ 2023-01-11 18:42 ` Simon Marchi
  2023-01-11 19:49   ` Thiago Jung Bauermann
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2023-01-11 18:42 UTC (permalink / raw)
  To: Thiago Jung Bauermann, gdb-patches



On 1/11/23 12:45, Thiago Jung Bauermann via Gdb-patches wrote:
> Commit 2b16913cdca2 ("gdb: make gdbarch_alloc take ownership of the tdep")
> changed gdbarch.c without updating gdbarch.py.  As a result, running
> gdbarch.py reverts those changes and causes the build to fail.
> 
> So change gdbarch.py to generate the current version of gdbarch.c.

Heh, how silly of me.  This is ok, thanks for fixing:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

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

* Re: [PATCH] gdb: Update gdbarch.py with latest changes in gdbarch.c
  2023-01-11 18:42 ` Simon Marchi
@ 2023-01-11 19:49   ` Thiago Jung Bauermann
  0 siblings, 0 replies; 3+ messages in thread
From: Thiago Jung Bauermann @ 2023-01-11 19:49 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches


Hello Simon,

Simon Marchi <simark@simark.ca> writes:

> On 1/11/23 12:45, Thiago Jung Bauermann via Gdb-patches wrote:
>> Commit 2b16913cdca2 ("gdb: make gdbarch_alloc take ownership of the tdep")
>> changed gdbarch.c without updating gdbarch.py.  As a result, running
>> gdbarch.py reverts those changes and causes the build to fail.
>> 
>> So change gdbarch.py to generate the current version of gdbarch.c.
>
> Heh, how silly of me.  This is ok, thanks for fixing:
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>

Thank you for the quick review! Pushed.

-- 
Thiago

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

end of thread, other threads:[~2023-01-11 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 17:45 [PATCH] gdb: Update gdbarch.py with latest changes in gdbarch.c Thiago Jung Bauermann
2023-01-11 18:42 ` Simon Marchi
2023-01-11 19:49   ` Thiago Jung Bauermann

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