summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-11-20 13:34:04 +0000
committerNick Alcock <nick.alcock@oracle.com>2020-11-20 13:34:05 +0000
commitae41200ba807f4342ae7ea5334a29cd6f519b02c (patch)
tree8f07eb4181e8e20ad4b91c0497fcae48252901d8 /include
parent139633c307eb6f5746ea04f94a0b6382e51bccb9 (diff)
libctf, include, binutils, gdb: rename CTF-opening functions
The functions that return ctf_dict_t's given a ctf_archive_t and a name are very clumsily named. It sounds like they return *archives*, not dictionaries, and the names are very long and clunky. Why do we have a ctf_arc_open_by_name when it opens a dictionary, not an archive, and when there is no way to open a dictionary in any other way? The answer is purely internal: the function is located in ctf-archive.c, and everything in there was called ctf_arc_*, and there is another way to open a dict (by offset in the archive), that is internal to ctf-archive.c and that nothing else can call. This is clearly bad naming. The internal organization of the source tree should not dictate public API names! So rename things (keeping the old, bad names for compatibility), and adjust all users. You now open a dict using ctf_dict_open, and open it giving ELF sections via ctf_dict_open_sections. binutils/ChangeLog 2020-11-20 Nick Alcock <nick.alcock@oracle.com> * objdump.c (dump_ctf): Use ctf_dict_open, not ctf_arc_open_by_name. * readelf.c (dump_section_as_ctf): Likewise. gdb/ChangeLog 2020-11-20 Nick Alcock <nick.alcock@oracle.com> * ctfread.c (elfctf_build_psymtabs): Use ctf_dict_open, not ctf_arc_open_by_name. include/ChangeLog 2020-11-20 Nick Alcock <nick.alcock@oracle.com> * ctf-api.h (ctf_arc_open_by_name): Rename to... (ctf_dict_open): ... this, keeping compatibility function. (ctf_arc_open_by_name_sections): Rename to... (ctf_dict_open_sections): ... this, keeping compatibility function. libctf/ChangeLog 2020-11-20 Nick Alcock <nick.alcock@oracle.com> * ctf-archive.c (ctf_arc_open_by_offset): Rename to... (ctf_dict_open_by_offset): ... this. Adjust callers. (ctf_arc_open_by_name_internal): Rename to... (ctf_dict_open_internal): ... this. Adjust callers. (ctf_arc_open_by_name_sections): Rename to... (ctf_dict_open_sections): ... this, keeping compatibility function. (ctf_arc_open_by_name): Rename to... (ctf_dict_open): ... this, keeping compatibility function. * libctf.ver: New functions added. * ctf-link.c (ctf_link_one_input_archive): Adjusted accordingly. (ctf_link_deduplicating_open_inputs): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/ctf-api.h18
2 files changed, 19 insertions, 6 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index e1fcc92836..11ec1f4c71 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,12 @@
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
+ * ctf-api.h (ctf_arc_open_by_name): Rename to...
+ (ctf_dict_open): ... this, keeping compatibility function.
+ (ctf_arc_open_by_name_sections): Rename to...
+ (ctf_dict_open_sections): ... this, keeping compatibility function.
+
+2020-11-20 Nick Alcock <nick.alcock@oracle.com>
+
* ctf-api.h (ctf_file_t): Rename to...
(ctf_dict_t): ... this. Keep ctf_file_t around for compatibility.
(struct ctf_file): Likewise rename to...
diff --git a/include/ctf-api.h b/include/ctf-api.h
index 60e06b39ee..38d7758a48 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -306,12 +306,12 @@ extern ctf_archive_t *ctf_arc_bufopen (const ctf_sect_t *,
const ctf_sect_t *,
int *);
extern void ctf_arc_close (ctf_archive_t *);
-extern ctf_dict_t *ctf_arc_open_by_name (const ctf_archive_t *,
- const char *, int *);
-extern ctf_dict_t *ctf_arc_open_by_name_sections (const ctf_archive_t *,
- const ctf_sect_t *,
- const ctf_sect_t *,
- const char *, int *);
+extern ctf_dict_t *ctf_dict_open (const ctf_archive_t *,
+ const char *, int *);
+extern ctf_dict_t *ctf_dict_open_sections (const ctf_archive_t *,
+ const ctf_sect_t *,
+ const ctf_sect_t *,
+ const char *, int *);
extern size_t ctf_archive_count (const ctf_archive_t *);
/* The next functions return or close real CTF files, or write out CTF archives,
@@ -511,6 +511,12 @@ struct ctf_file;
typedef struct ctf_dict ctf_file_t;
extern void ctf_file_close (ctf_file_t *);
extern ctf_dict_t *ctf_parent_file (ctf_dict_t *);
+extern ctf_dict_t *ctf_arc_open_by_name (const ctf_archive_t *,
+ const char *, int *);
+extern ctf_dict_t *ctf_arc_open_by_name_sections (const ctf_archive_t *,
+ const ctf_sect_t *,
+ const ctf_sect_t *,
+ const char *, int *);
#ifdef __cplusplus
}