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