aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-03-10 15:31:36 +0000
committerAndrew Burgess <aburgess@redhat.com>2023-03-13 21:51:04 +0000
commita3e200efc1524368937a793e02614fecf8856168 (patch)
tree0e271fc6e9a766e01bdbd1d4b9c122ce46af7791 /gdb/c-exp.y
parentc317ea5723689a4304760ff9f095e5f6df915f8d (diff)
downloadgdb-a3e200efc1524368937a793e02614fecf8856168.zip
gdb-a3e200efc1524368937a793e02614fecf8856168.tar.gz
gdb-a3e200efc1524368937a793e02614fecf8856168.tar.bz2
gdbarch: remove some unneeded predefault="0" from gdbarch_components.py
I noticed that there are a bunch of 'predefault="0"' lines in gdbarch_components.py, and that some (just some, not all) of these are not needed. The gdbarch is already zero initialized, but these lines seem to exists so that we can know when to compare against "0" and when to compare against "NULL". At least, this seems to be useful in some places in the generated code. Specifically, if we remove the predefault="0" line from the max_insn_length component then we end up generating a line like: gdb_assert (gdbarch->max_insn_length != NULL); which doesn't compile as we compare a ULONGEST to NULL. In this commit I remove all the predefault="0" lines that I claim are obviously not needed. These are lines for components that are not Values (i.e. the component holds a function pointer anyway), or for Value components that hold a pointer type, in which case using NULL is fine. The only changes after this commit are some fields that have nullptr as their initial value, and gcore_bfd_target now compares to NULL not 0 in gdbarch_gcore_bfd_target_p, which, given the field is of type 'const char *', seems like an improvement. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/c-exp.y')
0 files changed, 0 insertions, 0 deletions