Restore test-cp-name-parser build
Commit c8b23b3f89
("Add constructor and destructor to
demangle_parse_info") a while ago broke the "test-cp-name-parser"
build:
$ make test-cp-name-parser
[...]
src/gdb/cp-name-parser.y: In function ‘int main(int, char**)’:
src/gdb/cp-name-parser.y:2190:9: error: cannot convert ‘std::unique_ptr<demangle_parse_info>’ to ‘demangle_parse_info*’ in assignment
result = cp_demangled_name_to_comp (str2, &errmsg);
^
src/gdb/cp-name-parser.y:2199:38: error: ‘cp_demangled_name_parse_free’ was not declared in this scope
cp_demangled_name_parse_free (result);
^
src/gdb/cp-name-parser.y:2211:14: error: cannot convert ‘std::unique_ptr<demangle_parse_info>’ to ‘demangle_parse_info*’ in assignment
result = cp_demangled_name_to_comp (argv[arg], &errmsg);
^
src/gdb/cp-name-parser.y:2219:43: error: ‘cp_demangled_name_parse_free’ was not declared in this scope
cp_demangled_name_parse_free (result);
^
Makefile:2107: recipe for target 'test-cp-name-parser.o' failed
make: *** [test-cp-name-parser.o] Error 1
This commit restores it.
gdb/ChangeLog:
2017-03-14 Pedro Alves <palves@redhat.com>
* cp-name-parser.y (cp_demangled_name_to_comp): Update comment.
(main): Use std::unique_ptr. Remove calls to
cp_demangled_name_parse_free.
This commit is contained in:
parent
9c7272f083
commit
8a6200ba86
@ -1,3 +1,9 @@
|
||||
2017-03-14 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* cp-name-parser.y (cp_demangled_name_to_comp): Update comment.
|
||||
(main): Use std::unique_ptr. Remove calls to
|
||||
cp_demangled_name_parse_free.
|
||||
|
||||
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
|
||||
|
||||
* alpha-bsd-nat.c (alphabsd_fetch_inferior_registers,
|
||||
|
@ -2057,10 +2057,9 @@ cp_merge_demangle_parse_infos (struct demangle_parse_info *dest,
|
||||
}
|
||||
|
||||
/* Convert a demangled name to a demangle_component tree. On success,
|
||||
a structure containing the root of the new tree is returned; it must
|
||||
be freed by calling cp_demangled_name_parse_free. On error, NULL is
|
||||
returned, and an error message will be set in *ERRMSG (which does
|
||||
not need to be freed). */
|
||||
a structure containing the root of the new tree is returned. On
|
||||
error, NULL is returned, and an error message will be set in
|
||||
*ERRMSG (which does not need to be freed). */
|
||||
|
||||
struct std::unique_ptr<demangle_parse_info>
|
||||
cp_demangled_name_to_comp (const char *demangled_name, const char **errmsg)
|
||||
@ -2161,7 +2160,6 @@ main (int argc, char **argv)
|
||||
char buf[65536];
|
||||
int arg;
|
||||
const char *errmsg;
|
||||
struct demangle_parse_info *result;
|
||||
|
||||
arg = 1;
|
||||
if (argv[arg] && strcmp (argv[arg], "--debug") == 0)
|
||||
@ -2187,7 +2185,9 @@ main (int argc, char **argv)
|
||||
printf ("%s\n", buf);
|
||||
continue;
|
||||
}
|
||||
result = cp_demangled_name_to_comp (str2, &errmsg);
|
||||
|
||||
std::unique_ptr<demangle_parse_info> result
|
||||
= cp_demangled_name_to_comp (str2, &errmsg);
|
||||
if (result == NULL)
|
||||
{
|
||||
fputs (errmsg, stderr);
|
||||
@ -2196,7 +2196,6 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
cp_print (result->tree);
|
||||
cp_demangled_name_parse_free (result);
|
||||
|
||||
free (str2);
|
||||
if (c)
|
||||
@ -2208,7 +2207,8 @@ main (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
result = cp_demangled_name_to_comp (argv[arg], &errmsg);
|
||||
std::unique_ptr<demangle_parse_info> result
|
||||
= cp_demangled_name_to_comp (argv[arg], &errmsg);
|
||||
if (result == NULL)
|
||||
{
|
||||
fputs (errmsg, stderr);
|
||||
@ -2216,7 +2216,6 @@ main (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
cp_print (result->tree);
|
||||
cp_demangled_name_parse_free (result);
|
||||
putchar ('\n');
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user