aboutsummaryrefslogtreecommitdiff
path: root/gdb/make-target-delegates.py
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-07-27 13:32:38 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2023-07-27 13:33:03 -0400
commitb871f5ee3374590a4206da3ca14a32c4e68d0355 (patch)
treefb5cfd7cff4945c6e43f259e50f539ce742a0598 /gdb/make-target-delegates.py
parent2f01a2b9eaa44cdf5d7c9ec926705831f8ce4c16 (diff)
downloadgdb-b871f5ee3374590a4206da3ca14a32c4e68d0355.zip
gdb-b871f5ee3374590a4206da3ca14a32c4e68d0355.tar.gz
gdb-b871f5ee3374590a4206da3ca14a32c4e68d0355.tar.bz2
gdb: remove trailing empty line in target-delegates.c
In a review [1], I pointed out that applying the patch, git would say: .git/rebase-apply/patch:147: new blank line at EOF. However, since the empty line is in target-delegates.c (a generated file), there's nothing the author can do about it. To avoid this comment coming up again in the future, change make-target-delegates.py to avoid the trailing empty line. Do this by making it output empty lines before each entity, not after. Since this needs removing a newline output in gdbcopyright, adjust ada-unicode.py and gdbarch.py to avoid changes in the files they generate. [1] https://inbox.sourceware.org/gdb-patches/20230427210113.45380-1-jhb@FreeBSD.org/T/#m083598405bef19157f67c9d97846d3dd90dc7d1c Change-Id: Ic4c648f06443b432168cb76603402c918aa6e5d2 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/make-target-delegates.py')
-rwxr-xr-xgdb/make-target-delegates.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py
index c8e5a94..704d3f1 100755
--- a/gdb/make-target-delegates.py
+++ b/gdb/make-target-delegates.py
@@ -199,6 +199,7 @@ def write_declaration(f: TextIO, name: str, return_type: str, argtypes: List[str
# Write out a delegation function.
def write_delegator(f: TextIO, name: str, return_type: str, argtypes: List[str]):
+ print("", file=f)
names = write_function_header(
f, False, "target_ops::" + name, return_type, argtypes
)
@@ -208,7 +209,7 @@ def write_delegator(f: TextIO, name: str, return_type: str, argtypes: List[str])
print("this->beneath ()->" + name + " (", file=f, end="")
print(", ".join(names), file=f, end="")
print(");", file=f)
- print("}\n", file=f)
+ print("}", file=f)
# Write out a default function.
@@ -220,6 +221,7 @@ def write_tdefault(
return_type: str,
argtypes: List[str],
):
+ print("", file=f)
name = "dummy_target::" + name
names = write_function_header(f, False, name, return_type, argtypes)
if style == "FUNC":
@@ -238,7 +240,7 @@ def write_tdefault(
pass
else:
raise RuntimeError("unrecognized style: " + style)
- print("}\n", file=f)
+ print("}", file=f)
def munge_type(typename: str):
@@ -263,6 +265,7 @@ def munge_type(typename: str):
def write_debugmethod(
f: TextIO, content: str, name: str, return_type: str, argtypes: List[str]
):
+ print("", file=f)
debugname = "debug_target::" + name
names = write_function_header(f, False, debugname, return_type, argtypes)
if return_type != "void":
@@ -305,7 +308,7 @@ def write_debugmethod(
if return_type != "void":
print(" return result;", file=f)
- print("}\n", file=f)
+ print("}", file=f)
def print_class(
@@ -314,6 +317,7 @@ def print_class(
delegators: List[str],
entries: Dict[str, Entry],
):
+ print("", file=f)
print("struct " + class_name + " : public target_ops", file=f)
print("{", file=f)
print(" const target_info &info () const override;", file=f)
@@ -326,7 +330,7 @@ def print_class(
entry = entries[name]
write_declaration(f, name, entry.return_type, entry.argtypes)
- print("};\n", file=f)
+ print("};", file=f)
delegators: List[str] = []