gdb: small cleanups in dwarf2_psymtab constructors
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 7 Apr 2020 15:48:46 +0000 (11:48 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 7 Apr 2020 15:48:46 +0000 (11:48 -0400)
commit9f4e76a4b3f61d8182a4a7afe0e479ea7e3093a3
treeaf42c644f2a3ef32fc160b14680dc9f133fa17f1
parent25c11acac349bf6e77a233c7604bf8e04b8a1424
gdb: small cleanups in dwarf2_psymtab constructors

I noticed that only one of the two dwarf2_psymtab constructors are
actually used.  The one that is used accepts an `addr` parameter (the
base text offset), but its sole caller passes a constant, 0.  We want to
keep calling the three-arguments standard_psymtab constructor form,
however, since it differs from the two-arguments form in subtle ways.

Also, I believe the dwarf2_per_cu_data associated to the created
dwarf2_psymtab should be passed as a constructor argument.  That will
help me in a future patchset, to convince myself that the `per_cu_data`
field can't be NULL.

So this patch:

- Removes the two-parameters constructor of dwarf2_psymtab, as it is
  unused.
- Removes the `addr` parameter of the remaining constructor, passing 0
  directly to the base class' constructor.
- Adds a `per_cu` parameter, to assign the `per_cu_data` field at
  construction.

gdb/ChangeLog:

* dwarf2/read.h (struct dwarf2_psymtab): Remove two-parameters
constructor.  Remove `addr` parameter from other constructor and
add `per_cu` parameter.
* dwarf2/read.c (create_partial_symtab): Update.
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/dwarf2/read.h