libctf: reimplement many _iter iterators in terms of _next
[deliverable/binutils-gdb.git] / libctf / ChangeLog
CommitLineData
ac36e134
NA
12021-03-02 Nick Alcock <nick.alcock@oracle.com>
2
3 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
4 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
5 (ctf_type_iter): Reimplement in terms of ctf_type_next.
6 (ctf_type_iter_all): Likewise.
7 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
8 * ctf-archive.c (ctf_archive_iter_internal): Remove.
9 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
10
eaa2913a
NA
112021-03-02 Nick Alcock <nick.alcock@oracle.com>
12
13 * ctf-archive.c (ctf_archive_next): Set the name of parents in
14 single-member archives.
15
8255cf42
AM
162021-02-26 Alan Modra <amodra@gmail.com>
17
18 * Makefile.in: Regenerate.
19
93993f67
AM
202021-02-21 Alan Modra <amodra@gmail.com>
21
22 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
23 and AC_CANONICAL_BUILD.
24 * configure: Regenerate.
25 * Makefile.in: Regenerate.
26
f4f60336
NA
272021-02-17 Nick Alcock <nick.alcock@oracle.com>
28
29 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
30 <ctf_symhash_latest>: Likewise.
31 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
32 <ctfi_symnamedicts>: New.
33 <ctfi_syms>: Remove.
34 (ctf_lookup_symbol_name): Remove.
35 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
36 parent properly. Make static.
37 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
38 cached in the crossdict cache's ctf_symhash (if available), or
39 this dict's (otherwise).
40 (ctf_try_lookup_indexed): Allow the symname to be passed in.
41 (ctf_lookup_by_symbol): Turn into a wrapper around...
42 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
43 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
44 name lookup in dynamic dicts without reported symbols, which have
45 no symtab or dynsymidx but where name lookup should still work.
46 (ctf_lookup_by_symbol_name): New, another wrapper.
47 * ctf-archive.c (enosym): Note that this is present in
48 ctfi_symnamedicts too.
49 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
50 ctfi_symnamedicts.
51 (ctf_arc_flush_caches): Likewise.
52 (ctf_dict_open_cached): Memoize the first cached dict in the
53 crossdict cache.
54 (ctf_arc_lookup_symbol): Turn into a wrapper around...
55 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
56 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
57 still cache the dicts those lookups succeed in). Add
58 lookup-by-name support, with dicts of successful lookups cached in
59 ctfi_symnamedicts. Refactor the caching code a bit.
60 (ctf_arc_lookup_symbol_name): New, another wrapper.
61 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
62 * libctf.ver (LIBCTF_1.2): New version. Add
63 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
64 * testsuite/libctf-lookup/enum-symbol.c (main): Use
65 ctf_arc_lookup_symbol rather than looking up the name ourselves.
66 Fish it out repeatedly, to make sure that symbol caching isn't
67 broken.
68 (symidx_64): Remove.
69 (symidx_32): Remove.
70 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
71 in an unlinked object file (indexed symtypetab sections only).
72 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
73 (try_maybe_reporting): Check symbol types via
74 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
75 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
76 lookups in a multi-dict archive.
77
c3bf9dc5
AM
782021-02-20 Alan Modra <amodra@gmail.com>
79
80 * testsuite/config/default.exp (ld_L_opt): Define.
81 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
82 ld-lib.exp.
83 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
84 (compile_one_cc, check_ctf_available): Delete.
85
758f5907
NA
862021-02-03 Nick Alcock <nick.alcock@oracle.com>
87
88 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
89 * configure: Regenerated.
90
cbd8f5bb
NA
912021-02-03 Nick Alcock <nick.alcock@oracle.com>
92
93 * configure.ac (EXPECT): Check for, in order to define...
94 (TCL_TRY): ... this, if Tcl supports try/catch.
95 * Makefile.am (TCL_TRY): Run the testsuite only if set.
96 * configure: Regenerated.
97 * Makefile.in: Likewise.
98
95148614
NA
992021-02-02 Nick Alcock <nick.alcock@oracle.com>
100
101 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
102 favour of LIBINTL.
103 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
104 include $(LIBINTL).
105 (check-DEJAGNU): Pass down to tests as well.
106 * configure: Regenerated.
107 * Makefile.in: Likewise.
108
ee87f50b
NA
1092021-01-27 Nick Alcock <nick.alcock@oracle.com>
110
111 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
112 (ctf_str_add_ref): Likewise.
113 (ctf_str_add_external): Likewise.
114 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
115 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
116 against NULL name.
117 (ctf_dedup_maybe_synthesize_forward): Likewise.
118
5dacd11d
NA
1192021-01-27 Nick Alcock <nick.alcock@oracle.com>
120
121 * ctf-create.c (ctf_serialize): Fix shadowing.
122
caa17049
NA
1232021-01-27 Nick Alcock <nick.alcock@oracle.com>
124
125 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
126 (ctf_add_forward): Likewise.
127 (ctf_add_typedef): Likewise.
128
78f28b89
NA
1292021-01-27 Nick Alcock <nick.alcock@oracle.com>
130
131 * ctf-open.c (init_types): Rip out code to check anonymous typedef
132 nodes.
133 * ctf-create.c (ctf_add_reftype): Likewise.
134 * ctf-lookup.c (refresh_pptrtab): Likewise.
135
35a01a04
NA
1362021-01-27 Nick Alcock <nick.alcock@oracle.com>
137
138 * ctf-impl.c (_libctf_nonnull_): Add parameters.
139 (LCTF_LINKING): New flag.
140 (ctf_dict_t) <ctf_link_flags>: Mention it.
141 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
142 (ctf_write): Likewise, including in child dictionaries.
143 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
144 are no reported symbols.
145 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
146 the variable has been reported as a symbol by the linker.
147 (symtypetab_skippable): Mention relationship between SYMFP and the
148 flags.
149 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
150 were reported and force-indexing is off (i.e., we are doing a
151 final link).
152 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
153 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
154 case). Turn sorting off if this is a non-final link. Only delete
155 nonstatic vars if we are filtering symbols and the linker has
156 reported some.
157 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
158 New test of variable and symtypetab section population when
159 ld -r is used.
160 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
161 Likewise, when ld of an executable is used.
162 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
163 Likewise, when ld -shared alone is used.
164 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
165 Lookup programs for the above.
166 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
167 test, testing survival of symbols across ctf_write paths.
168 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
169 nonshared, suppressing linking of the SOURCE with -shared.
170
26503e2f
NA
1712021-01-19 Nick Alcock <nick.alcock@oracle.com>
172
173 * ctf-create.c (membadd): Transform ""-named members into
174 NULL-named ones.
175 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
176
e05a3e5a
NA
1772021-01-19 Nick Alcock <nick.alcock@oracle.com>
178
179 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
180 base type if looking up a nonexistent pointer type.
181 * testsuite/libctf-regression/pptrtab*: Test it.
182
5347ed60
AM
1832021-01-13 Alan Modra <amodra@gmail.com>
184
185 * Makefile.in: Regenerate.
186
d546b610
L
1872021-01-12 H.J. Lu <hongjiu.lu@intel.com>
188
189 PR binutils/26792
190 * configure.ac: Use GNU_MAKE_JOBSERVER.
191 * aclocal.m4: Regenerated.
192 * configure: Likewise.
193
83b33c6c
L
1942021-01-11 H.J. Lu <hongjiu.lu@intel.com>
195
196 PR ld/27173
197 * configure: Regenerated.
198
a4966cd9
L
1992021-01-09 H.J. Lu <hongjiu.lu@intel.com>
200
201 * configure: Regenerated.
202
055bc77a
NC
2032021-01-09 Nick Clifton <nickc@redhat.com>
204
205 * 2.36 release branch crated.
206
64307045
AM
2072021-01-09 Alan Modra <amodra@gmail.com>
208
209 * configure: Regenerate.
210
f4782128
ST
2112021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
212
213 * configure: Regenerate.
214
0814dbfb
NA
2152021-01-05 Nick Alcock <nick.alcock@oracle.com>
216
217 * testsuite/libctf-lookup/struct-iteration.c (main):
218 ctf_member_count returns an int.
219
70d3120f
NA
2202021-01-05 Nick Alcock <nick.alcock@oracle.com>
221
222 * Makefile.am (BASEDIR): New.
223 (BFDDIR): Likewise.
224 (check-DEJAGNU): Add development.exp to prerequisites.
225 (development.exp): New.
226 (CONFIG_STATUS_DEPENDENCIES): New.
227 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
228 (DISTCLEANFILES): Likewise.
229 * Makefile.in: Regenerated.
230 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
231 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
232 * testsuite/libctf-regression/regression.exp: Likewise.
233
b4b6ea46
NA
2342021-01-05 Nick Alcock <nick.alcock@oracle.com>
235
236 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
237 properly.
238
abe4ca69
NA
2392021-01-05 Nick Alcock <nick.alcock@oracle.com>
240
241 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
242 <ctf_pptrtab_len>: New.
243 <ctf_pptrtab_typemax>: New.
244 * ctf-create.c (ctf_serialize): Update accordingly.
245 (ctf_add_reftype): Note that we don't need to update pptrtab here,
246 despite updating ptrtab.
247 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
248 (ctf_import): Likewise.
249 (ctf_import_unref): Likewise.
250 * ctf-lookup.c (grow_pptrtab): New.
251 (refresh_pptrtab): New, update a pptrtab.
252 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
253 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
254 use it in addition to the parent's ptrtab when parent dicts are
255 searched.
256 * testsuite/libctf-regression/regression.exp: New testsuite for
257 regression tests.
258 * testsuite/libctf-regression/pptrtab*: New test.
259 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
260 writable CTF dicts.
261 * testsuite/libctf-writable/pptrtab*: New test.
262
8769046e
NA
2632021-01-05 Nick Alcock <nick.alcock@oracle.com>
264
265 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
266
6c3a3877
NA
2672021-01-05 Nick Alcock <nick.alcock@oracle.com>
268
269 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
270 <ctn_next>: ... here.
271 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
272 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
273 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
274 (ctf_member_next): ... this. Support recursive unnamed member
275 iteration (off by default).
276 (ctf_member_info): Look up members in unnamed sub-structs.
277 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
278 (ctf_dedup_emit_struct_members): Likewise.
279 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
280 members, and a normal member after the end.
281 * testsuite/libctf-lookup/struct-iteration.c: Verify that
282 ctf_member_count is consistent with the number of successful returns
283 from a non-recursive ctf_member_next.
284 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
285 over struct members.
286 * testsuite/libctf-lookup/struct-lookup.c: New test.
287 * testsuite/libctf-lookup/struct-lookup.lk: New test.
288
abed0b07
NA
2892021-01-05 Nick Alcock <nick.alcock@oracle.com>
290
291 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
292 (ctf_link_write): Call it.
293
9bc76971
NA
2942021-01-05 Nick Alcock <nick.alcock@oracle.com>
295
296 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
297 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
298 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
299
c59e30ed
NA
3002021-01-05 Nick Alcock <nick.alcock@oracle.com>
301
302 * Makefile.am (EXPECT): New.
303 (RUNTEST): Likewise.
304 (RUNTESTFLAGS): Likewise.
305 (CC_FOR_TARGET): Likewise.
306 (check-DEJAGNU): Likewise.
307 (AUTOMAKE_OPTIONS): Add dejagnu.
308 * Makefile.in: Regenerated.
309 * testsuite/config/default.exp: New.
310 * testsuite/lib/ctf-lib.exp: Likewise.
311 * testsuite/libctf-lookup/enum.lk: New test.
312 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
313 * testsuite/libctf-lookup/enum.c: New lookup test.
314 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
315 * testsuite/libctf-lookup/lookup.exp: New.
316
1038406a
NA
3172021-01-05 Nick Alcock <nick.alcock@oracle.com>
318
319 * configure.ac (BFD_LIBADD): Remove.
320 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
321 (SHARED_LIBADD): Rename to...
322 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
323 linking statically.
324 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
325 libctf uses libintl.
326 (libctf_la_LIBADD): Reference libbfd.la directly, not via
327 BFD_LIBADD.
328 (libctf_la_DEPENDENCIES): Remove.
329 * Makefile.in: Regenerate.
330 * configure: Likewise.
331
37002871
NA
3322021-01-05 Nick Alcock <nick.alcock@oracle.com>
333
334 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
335 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
336 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
337 (CTF_FT_REFS): New.
338 (CTF_FT_BITFIELD): Likewise.
339 (CTF_FT_ID): Likewise.
340 (ctf_dump_member): Do not do indentation here. Migrate the
341 type-printing parts of this into...
342 (ctf_dump_format_type): ... here, to be shared by all type printers.
343 Get the errno value for non-representable types right. Do not print
344 bitfield info for non-bitfields. Improve the format and indentation
345 of other type output. Shuffle spacing around to make all indentation
346 either 'width of column' or 4 chars.
347 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
348 (ctf_dump_objts): Likewise. Spacing shuffle.
349 (ctf_dump_var): Likewise.
350 (type_hex_digits): Migrate down in the file, to above its new user.
351 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
352 ctf_dump_format_type. Don't trim off excess linefeeds now we no
353 longer generate them. Dump enumerated types.
354
ffeece6a
NA
3552021-01-05 Nick Alcock <nick.alcock@oracle.com>
356
357 * ctf-types.c (ctf_type_resolve): Improve comment.
358 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
359 Emit errors into the right dict.
360 (ctf_type_align): Likewise.
361 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
362 when adding a member without explicit offset when this member, or
363 the previous member, is incomplete.
364 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
365 forwards.
366 (ctf_dump_member): Do not try to print their alignment.
367
91e7ce2f
NA
3682021-01-05 Nick Alcock <nick.alcock@oracle.com>
369
370 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
371 (ctf_dump_format_type): Don't emit the size for function objects.
372 Dump the element type of arrays like we dump the pointed-to type of
373 pointers, etc.
374
57f97d0e
NA
3752021-01-05 Nick Alcock <nick.alcock@oracle.com>
376
377 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
378 (ctf_dump_header): Add 0x to the hex magic number.
379 (ctf_dump_str): Add 0x to the hex string offsets.
380 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
381 (ctf_dump_type): Adjust. Free it when we're done.
382 (type_hex_digits): New.
383 (ctf_dump_member): Align output depending on the width of the type
384 ID being generated. Use printf padding, not a loop, to generate
385 indentation.
386
b09ad6ea
NA
3872021-01-05 Nick Alcock <nick.alcock@oracle.com>
388
389 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
390
a7c23ac9
NB
3912021-01-04 Nicolas Boulenguez <nicolas@debian.org>
392
393 PR 27117
394 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
395 ACLOCAL_AMFLAGS -I dirs.
396 * configure: Regenerate.
397
250d07de
AM
3982021-01-01 Alan Modra <amodra@gmail.com>
399
400 Update year range in copyright notice of all files.
401
c2795844
AM
402For older changes see ChangeLog-2020
403\f
404Copyright (C) 2021 Free Software Foundation, Inc.
60da9d95 405
c2795844
AM
406Copying and distribution of this file, with or without modification,
407are permitted in any medium without royalty provided the copyright
408notice and this notice are preserved.
60da9d95 409
60da9d95
NA
410Local Variables:
411mode: change-log
412left-margin: 8
c2795844 413fill-column: 74
60da9d95
NA
414version-control: never
415End:
This page took 0.130164 seconds and 4 git commands to generate.