GNU Binutils with patches for OS216
Révision | 6f0302493af0ace93943041c3374069c15c363f7 (tree) |
---|---|
l'heure | 2016-11-09 00:26:46 |
Auteur | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
Use ui_file_as_string in gdbarch.sh/gdbarch.c
gdb/ChangeLog:
2016-11-08 Pedro Alves <palves@redhat.com>
* gdbarch.sh (verify_gdbarch): Use ui_file_as_string and
std::string.
* gdbarch.c: Regenerate.
@@ -1,5 +1,11 @@ | ||
1 | 1 | 2016-11-08 Pedro Alves <palves@redhat.com> |
2 | 2 | |
3 | + * gdbarch.sh (verify_gdbarch): Use ui_file_as_string and | |
4 | + std::string. | |
5 | + * gdbarch.c: Regenerate. | |
6 | + | |
7 | +2016-11-08 Pedro Alves <palves@redhat.com> | |
8 | + | |
3 | 9 | * c-exp.y (OPERATOR NEW): Adjust to use ui_file_as_string and |
4 | 10 | std::string. |
5 | 11 |
@@ -500,7 +500,6 @@ verify_gdbarch (struct gdbarch *gdbarch) | ||
500 | 500 | struct ui_file *log; |
501 | 501 | struct cleanup *cleanups; |
502 | 502 | long length; |
503 | - char *buf; | |
504 | 503 | |
505 | 504 | log = mem_fileopen (); |
506 | 505 | cleanups = make_cleanup_ui_file_delete (log); |
@@ -697,12 +696,11 @@ verify_gdbarch (struct gdbarch *gdbarch) | ||
697 | 696 | /* Skip verify of gcc_target_options, invalid_p == 0 */ |
698 | 697 | /* Skip verify of gnu_triplet_regexp, invalid_p == 0 */ |
699 | 698 | /* Skip verify of addressable_memory_unit_size, invalid_p == 0 */ |
700 | - buf = ui_file_xstrdup (log, &length); | |
701 | - make_cleanup (xfree, buf); | |
702 | - if (length > 0) | |
699 | + std::string buf = ui_file_as_string (log); | |
700 | + if (!buf.empty ()) | |
703 | 701 | internal_error (__FILE__, __LINE__, |
704 | 702 | _("verify_gdbarch: the following are invalid ...%s"), |
705 | - buf); | |
703 | + buf.c_str ()); | |
706 | 704 | do_cleanups (cleanups); |
707 | 705 | } |
708 | 706 |
@@ -1878,7 +1878,6 @@ verify_gdbarch (struct gdbarch *gdbarch) | ||
1878 | 1878 | struct ui_file *log; |
1879 | 1879 | struct cleanup *cleanups; |
1880 | 1880 | long length; |
1881 | - char *buf; | |
1882 | 1881 | |
1883 | 1882 | log = mem_fileopen (); |
1884 | 1883 | cleanups = make_cleanup_ui_file_delete (log); |
@@ -1924,12 +1923,11 @@ do | ||
1924 | 1923 | fi |
1925 | 1924 | done |
1926 | 1925 | cat <<EOF |
1927 | - buf = ui_file_xstrdup (log, &length); | |
1928 | - make_cleanup (xfree, buf); | |
1929 | - if (length > 0) | |
1926 | + std::string buf = ui_file_as_string (log); | |
1927 | + if (!buf.empty ()) | |
1930 | 1928 | internal_error (__FILE__, __LINE__, |
1931 | 1929 | _("verify_gdbarch: the following are invalid ...%s"), |
1932 | - buf); | |
1930 | + buf.c_str ()); | |
1933 | 1931 | do_cleanups (cleanups); |
1934 | 1932 | } |
1935 | 1933 | EOF |