libctf: Add iteration over non-root types
[deliverable/binutils-gdb.git] / libctf / ChangeLog
1 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
2
3 * ctf_types.c (ctf_type_iter_all): New.
4
5 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
6
7 * ctf-open.c (init_symtab): Check for overflow against the right
8 section.
9 (upgrade_header): Set cth_objtidxoff, cth_funcidxoff to zero-length.
10 (upgrade_types_v1): Note that these sections are not checked.
11 (flip_header): Endian-swap the header fields.
12 (flip_ctf): Endian-swap the sections.
13 (flip_objts): Update comment.
14 (ctf_bufopen): Check header offsets and alignment for validity.
15
16 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
17
18 * ctf-open-bfd.c: Add <assert.h>.
19 (ctf_bfdopen_ctfsect): Open string and symbol tables using
20 techniques borrowed from bfd_elf_sym_name.
21 (ctf_new_archive_internal): Improve comment.
22 * ctf-archive.c (ctf_arc_close): Do not free the ctfi_strsect.
23 * ctf-open.c (ctf_bufopen): Allow opening with a string section but
24 no symbol section, but not vice versa.
25
26 2019-07-08 Nick Alcock <nick.alcock@oracle.com>
27
28 * ctf-impl.h (ctf_file_t): New field ctf_openflags.
29 * ctf-open.c (ctf_bufopen): Set it. No longer dump header offsets.
30 * ctf-dump.c (dump_header): New function, dump the CTF header.
31 (ctf_dump): Call it.
32 (ctf_dump_header_strfield): New function.
33 (ctf_dump_header_sectfield): Likewise.
34
35 2019-07-06 Nick Alcock <nick.alcock@oracle.com>
36
37 * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
38 ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
39 * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
40 ctf_base: do not assume that it is always sizeof (ctf_header_t).
41 Print out ctf_cuname: only print out ctf_parname if set.
42 (ctf_free_base): Removed, ctf_base is no longer freed: free
43 ctf_dynbase instead.
44 (ctf_set_version): Fix spacing.
45 (upgrade_header): New, in-place header upgrading.
46 (upgrade_types): Rename to...
47 (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
48 longer track old and new headers separately. No longer allow for
49 header sizes explicitly: squeeze the headers out on upgrade (they
50 are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
51 ctf_buf explicitly. Use ctf_free, not ctf_free_base.
52 (upgrade_types): New, also handle ctf_parmax updating.
53 (flip_header): Flip ctf_cuname.
54 (flip_types): Flip BUF explicitly rather than deriving BUF from
55 BASE.
56 (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
57 required alignment of objtoff and funcoff. No longer store it in
58 the ctf_buf unless that buf is derived unmodified from the input.
59 Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
60 that duplicate fields in ctf_file: move allocation of ctf_file
61 further up instead. Call upgrade_header as needed. Move
62 version-specific ctf_parmax initialization into upgrade_types. More
63 concise error handling.
64 (ctf_file_close): No longer test for null pointers before freeing.
65 Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
66 ctf_free_base.
67 (ctf_cuname): New.
68 (ctf_cuname_set): New.
69 * ctf-create.c (ctf_update): Populate ctf_cuname.
70 (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
71 comment.
72 (ctf_write): Likewise.
73 (ctf_compress_write): Get the header from ctf_header, not ctf_base.
74 Fix the compression length: fp->ctf_size never counted the CTF
75 header. Simplify the compress call accordingly.
76
77 2019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
78
79 * ctf-endian.h: Don't assume htole64 and le64toh are always
80 present if HAVE_ENDIAN_H; also check if htole64 is defined.
81 [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
82 not bswap_identity_64.
83
84 2019-09-18 Alan Modra <amodra@gmail.com>
85
86 * ctf-open-bfd.c: Update throughout for bfd section macro changes.
87
88 2019-09-09 Phil Blundell <pb@pbcl.net>
89
90 binutils 2.33 branch created.
91
92 2019-07-18 Nick Alcock <nick.alcock@oracle.com>
93
94 * ctf-types.c (ctf_type_aname_raw): New.
95 (ctf_func_type_info): Likewise.
96 (ctf_func_type_args): Likewise.
97 * ctf-error.c (_ctf_errlist): Fix description.
98 * ctf-lookup.c: Fix file description.
99
100 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
101
102 * ctf-create.c (ctf_create): Fix off-by-one error.
103
104 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
105
106 * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
107 struct ctf_strs.
108 (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
109 (struct ctf_str_atom): New, disambiguated single string.
110 (struct ctf_str_atom_ref): New, points to some other location that
111 references this string's offset.
112 (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
113 Remove member ctf_dtvstrlen: we no longer track the total strlen
114 as we add strings.
115 (ctf_str_create_atoms): Declare new function in ctf-string.c.
116 (ctf_str_free_atoms): Likewise.
117 (ctf_str_add): Likewise.
118 (ctf_str_add_ref): Likewise.
119 (ctf_str_rollback): Likewise.
120 (ctf_str_purge_refs): Likewise.
121 (ctf_str_write_strtab): Likewise.
122 (ctf_realloc): Declare new function in ctf-util.c.
123
124 * ctf-open.c (ctf_bufopen): Create the atoms table.
125 (ctf_file_close): Destroy it.
126 * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
127 special-case the position of the parname string. Construct the
128 strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
129 rest of each buffer element is constructed, not via open-coding:
130 realloc the CTF buffer and append the strtab to it. No longer
131 maintain ctf_dtvstrlen. Sort the variable entry table later, after
132 strtab construction.
133 (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
134 (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
135 after buffer element construction instead.
136 (ctf_copy_lmembers): Likewise.
137 (ctf_copy_emembers): Likewise.
138 (ctf_create): No longer maintain the ctf_dtvstrlen.
139 (ctf_dtd_delete): Likewise.
140 (ctf_dvd_delete): Likewise.
141 (ctf_add_generic): Likewise.
142 (ctf_add_enumerator): Likewise.
143 (ctf_add_member_offset): Likewise.
144 (ctf_add_variable): Likewise.
145 (membadd): Likewise.
146 * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
147 if there are active ctf_str_num_refs.
148 (ctf_strraw): Move to ctf-string.c.
149 (ctf_strptr): Likewise.
150 * ctf-string.c: New file, strtab manipulation.
151
152 * Makefile.am (libctf_a_SOURCES): Add it.
153 * Makefile.in: Regenerate.
154
155 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
156
157 * ctf-impl.h (ctf_hash_iter_f): New.
158 (ctf_dynhash_iter): New declaration.
159 (ctf_dynhash_iter_remove): New declaration.
160 * ctf-hash.c (ctf_dynhash_iter): Define.
161 (ctf_dynhash_iter_remove): Likewise.
162 (ctf_hashtab_traverse): New.
163 (ctf_hashtab_traverse_remove): Likewise.
164 (struct ctf_traverse_cb_arg): Likewise.
165 (struct ctf_traverse_remove_cb_arg): Likewise.
166
167 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
168
169 * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
170
171 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
172
173 * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
174 (ctf_dump_funcs): Likewise.
175
176 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
177
178 * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
179 (ctf_fdopen): Check for endian-swapped raw CTF magic, and
180 little-endian CTF archive magic. Do not check the CTF version:
181 ctf_simple_open does that in endian-safe ways. Do not dereference
182 null pointers on open failure.
183
184 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
185
186 * ctf-open.c (get_vbytes_common): Return the new slice size.
187 (ctf_bufopen): Flip the endianness of the CTF-section header copy.
188 Remember to copy in the CTF data when opening an uncompressed
189 foreign-endian CTF file. Prune useless variable manipulation.
190
191 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
192
193 * ctf-open.c (ctf_types): Fail when unidentified type kinds are
194 seen.
195
196 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
197
198 * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
199 output.
200
201 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
202
203 * ctf-subr.c (_PAGESIZE): Remove.
204 (ctf_data_alloc): Likewise.
205 (ctf_data_free): Likewise.
206 (ctf_data_protect): Likewise.
207 * ctf-impl.h: Remove declarations.
208 * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
209 ctf_free, not ctf_data_free.
210 (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
211 the buffer again on compression error.
212 * ctf-open.c (ctf_set_base): No longer track the size: call
213 ctf_free, not ctf_data_free.
214 (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
215 (ctf_bufopen): Likewise. No longer call ctf_data_protect.
216
217 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
218
219 * ctf-create.c (ctf_dtd_insert): Pass on error returns from
220 ctf_dynhash_insert.
221 (ctf_dvd_insert): Likewise.
222 (ctf_add_generic): Likewise.
223 (ctf_add_variable): Likewise.
224 * ctf-impl.h: Adjust declarations.
225
226 2019-06-14 Alan Modra <amodra@gmail.com>
227
228 * configure: Regenerate.
229
230 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
231
232 * ctf-decls.h: Include <libiberty.h>.
233 * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
234
235 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
236
237 * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
238 (ctf_dump_objts): Likewise.
239 (ctf_dump_funcs): Likewise.
240 (ctf_dump_member): Likewise.
241 (ctf_dump_str): Likewise.
242
243 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
244
245 * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
246 * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
247
248 2019-06-05 Nick Alcock <nick.alcock@oracle.com>
249
250 * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
251 (ctf_arc_open_by_offset): Likewise.
252 * ctf-create.c (ctf_add_type): Likewise.
253
254 2019-06-04 Tom Tromey <tromey@adacore.com>
255
256 * ctf-create.c (ctf_add_encoded, ctf_add_slice)
257 (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
258
259 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
260
261 * configure.ac: Check for O_CLOEXEC.
262 * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
263 * config.h.in: Regenerate.
264 * configure: Likewise.
265
266 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
267
268 * qsort_r.c: Rename to...
269 * ctf-qsort_r.c: ... this.
270 (_quicksort): Define to ctf_qsort_r.
271 * ctf-decls.h (qsort_r): Remove.
272 (ctf_qsort_r): Add.
273 (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
274 (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
275 * Makefile.am (libctf_a_LIBADD): Remove.
276 (libctf_a_SOURCES): New, add ctf-qsort_r.c.
277 * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
278 * ctf-create.c (ctf_update): Likewise.
279 * configure.ac: Check for BSD versus GNU qsort_r signature.
280 * Makefile.in: Regenerate.
281 * config.h.in: Likewise.
282 * configure: Likewise.
283
284 2019-06-03 Nick Alcock <nick.alcock@oracle.com>
285
286 * ctf-dump.c (ctf_dump_funcs): Free in the right place.
287
288 2019-05-29 Nick Alcock <nick.alcock@oracle.com>
289
290 * Makefile.am (ZLIB): New.
291 (ZLIBINC): Likewise.
292 (AM_CFLAGS): Use them.
293 (libctf_a_LIBADD): New, for LIBOBJS.
294 * configure.ac: Check for zlib, endian.h, and qsort_r.
295 * ctf-endian.h: New, providing htole64 and le64toh.
296 * swap.h: Code style fixes.
297 (bswap_identity_64): New.
298 * qsort_r.c: New, from gnulib (with one added #include).
299 * ctf-decls.h: New, providing a conditional qsort_r declaration,
300 and unconditional definitions of MIN and MAX.
301 * ctf-impl.h: Use it. Do not use <sys/errno.h>.
302 (ctf_set_errno): Now returns unsigned long.
303 * ctf-util.c (ctf_set_errno): Adjust here too.
304 * ctf-archive.c: Use ctf-endian.h.
305 (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
306 cts_flags and cts_offset.
307 (ctf_arc_write): Drop debugging dependent on the size of off_t.
308 * ctf-create.c: Provide a definition of roundup if not defined.
309 (ctf_create): Drop cts_type, cts_flags and cts_offset.
310 (ctf_add_reftype): Do not check if type IDs are below zero.
311 (ctf_add_slice): Likewise.
312 (ctf_add_typedef): Likewise.
313 (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
314 when known error-free. Drop CTF_ERR usage for functions returning
315 int.
316 (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
317 int.
318 (ctf_add_variable): Likewise.
319 (enumcmp): Likewise.
320 (enumadd): Likewise.
321 (membcmp): Likewise.
322 (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
323 when known error-free.
324 * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
325 returning int: use CTF_ERR for functions returning ctf_type_id.
326 (ctf_dump_label): Likewise.
327 (ctf_dump_objts): Likewise.
328 * ctf-labels.c (ctf_label_topmost): Likewise.
329 (ctf_label_iter): Likewise.
330 (ctf_label_info): Likewise.
331 * ctf-lookup.c (ctf_func_args): Likewise.
332 * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
333 (ctf_bufopen): Likewise. Use zlib types as needed.
334 * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
335 returning int.
336 (ctf_enum_iter): Likewise.
337 (ctf_type_size): Likewise.
338 (ctf_type_align): Likewise. Cast to size_t where appropriate.
339 (ctf_type_kind_unsliced): Likewise.
340 (ctf_type_kind): Likewise.
341 (ctf_type_encoding): Likewise.
342 (ctf_member_info): Likewise.
343 (ctf_array_info): Likewise.
344 (ctf_enum_value): Likewise.
345 (ctf_type_rvisit): Likewise.
346 * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
347 cts_offset.
348 (ctf_simple_open): Likewise.
349 (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
350 * Makefile.in: Regenerate.
351 * aclocal.m4: Likewise.
352 * config.h: Likewise.
353 * configure: Likewise.
354
355 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
356
357 * configure.in: Check for bfd_section_from_elf_index.
358 * configure: Regenerate.
359 * config.h.in [HAVE_BFD_ELF]: Likewise.
360 * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
361 abfd is potentially unused now.
362
363 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
364
365 * Makefile.am: New.
366 * Makefile.in: Regenerated.
367 * config.h.in: Likewise.
368 * aclocal.m4: Likewise.
369 * configure: Likewise.
370
371 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
372
373 * ctf-dump.c: New.
374
375 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
376
377 * ctf-labels.c: New.
378
379 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
380
381 * ctf-impl.h (_libctf_version): New declaration.
382 * ctf-subr.c (_libctf_version): Define it.
383 (ctf_version): New.
384
385 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
386
387 * ctf-create.c (enumcmp): New.
388 (enumadd): Likewise.
389 (membcmp): Likewise.
390 (membadd): Likewise.
391 (ctf_add_type): Likewise.
392
393 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
394
395 * ctf-lookup.c (isqualifier): New.
396 (ctf_lookup_by_name): Likewise.
397 (struct ctf_lookup_var_key): Likewise.
398 (ctf_lookup_var): Likewise.
399 (ctf_lookup_variable): Likewise.
400 (ctf_lookup_symbol_name): Likewise.
401 (ctf_lookup_by_symbol): Likewise.
402 (ctf_func_info): Likewise.
403 (ctf_func_args): Likewise.
404
405 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
406
407 * ctf-decl.c: New file.
408 * ctf-types.c: Likewise.
409 * ctf-impl.h: New declarations.
410
411 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
412
413 * ctf-open-bfd.c: New file.
414 * ctf-open.c (ctf_close): New.
415 * ctf-impl.h: Include bfd.h.
416 (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
417 (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
418 ctfi_bfd_close.
419 (ctf_bfdopen_ctfsect): New declaration.
420 (_CTF_SECTION): likewise.
421
422 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
423
424 * ctf-archive.c: New.
425 * ctf-impl.h (ctf_archive_internal): New type.
426 (ctf_arc_open_internal): New declaration.
427 (ctf_arc_bufopen): Likewise.
428 (ctf_arc_close_internal): Likewise.
429
430 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
431
432 * ctf-open.c: New file.
433 * swap.h: Likewise.
434
435 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
436
437 * ctf-create.c: New file.
438 * ctf-lookup.c: New file.
439
440 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
441
442 * ctf-impl.h: New definitions and declarations for type creation
443 and lookup.
444
445 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
446
447 * ctf-hash.c: New file.
448 * ctf-impl.h: New declarations.
449
450 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
451
452 * ctf-error.c: New file.
453
454 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
455
456 * ctf-util.c: New file.
457 * elf.h: Likewise.
458 * ctf-impl.h: Include it, and add declarations.
459
460 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
461
462 * ctf-impl.h: New file.
463 * ctf-subr.c: New file.
464
465 \f
466 Local Variables:
467 mode: change-log
468 left-margin: 8
469 fill-column: 76
470 version-control: never
471 End:
This page took 0.056878 seconds and 4 git commands to generate.