diff options
author | Pedro Alves <palves@redhat.com> | 2017-03-27 11:56:28 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-03-27 11:56:28 +0100 |
commit | d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa (patch) | |
tree | 4b02c2c22c8aab9c8827eb924a020ba8001607e1 /gdb/xml-syscall.c | |
parent | 79b1d3cb362385c38af9cfb44c0c87b939711fbc (diff) | |
download | gdb-d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa.zip gdb-d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa.tar.gz gdb-d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa.tar.bz2 |
gdb: Make ldirname return a std::string
Eliminates several uses of cleanups.
Tested on x86_64 Fedora 23 with Python 2 and 3.
gdb/ChangeLog
2017-03-27 Pedro Alves <palves@redhat.com>
* dwarf2read.c (struct file_and_directory): New.
(dwarf2_get_dwz_file): Adjust to use std::string.
(dw2_get_file_names_reader): Adjust to use file_and_directory.
(find_file_and_directory): Adjust to return a file_and_directory
object.
(read_file_scope): Adjust to use file_and_directory. Remove
make_cleanup/do_cleanups calls.
(open_and_init_dwp_file): Adjust to use std::string. Remove
make_cleanup/do_cleanups calls.
* python/python.c (do_start_initialization): Adjust to ldirname
returning a std::string.
* utils.c (ldirname): Now returns a std::string.
* utils.h (ldirname): Change return type to std::string.
* xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname
returning a std::string.
* xml-tdesc.c (file_read_description_xml): Likewise.
Diffstat (limited to 'gdb/xml-syscall.c')
-rw-r--r-- | gdb/xml-syscall.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index 1e42b8d..a436418 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -363,7 +363,6 @@ static struct syscalls_info * xml_init_syscalls_info (const char *filename) { char *full_file; - char *dirname; struct syscalls_info *syscalls_info; struct cleanup *back_to; @@ -373,12 +372,9 @@ xml_init_syscalls_info (const char *filename) back_to = make_cleanup (xfree, full_file); - dirname = ldirname (filename); - if (dirname != NULL) - make_cleanup (xfree, dirname); - syscalls_info = syscall_parse_xml (full_file, - xml_fetch_content_from_file, dirname); + xml_fetch_content_from_file, + (void *) ldirname (filename).c_str ()); do_cleanups (back_to); return syscalls_info; |