mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 15:17:13 +08:00
Remove a string copy from event_location_to_sals
The use of "const" showed that a string copy in event_location_to_sals was unnecessary. This patch removes it. ChangeLog 2018-04-05 Tom Tromey <tom@tromey.com> * linespec.c (event_location_to_sals) <case ADDRESS_LOCATION>: Remove a string copy.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2018-04-05 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* linespec.c (event_location_to_sals) <case ADDRESS_LOCATION>:
|
||||||
|
Remove a string copy.
|
||||||
|
|
||||||
2018-04-05 Tom Tromey <tom@tromey.com>
|
2018-04-05 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* linespec.c (filter_results): Use std::vector.
|
* linespec.c (filter_results): Use std::vector.
|
||||||
|
@ -3165,16 +3165,10 @@ event_location_to_sals (linespec_parser *parser,
|
|||||||
|
|
||||||
if (addr_string != NULL)
|
if (addr_string != NULL)
|
||||||
{
|
{
|
||||||
char *expr = xstrdup (addr_string);
|
addr = linespec_expression_to_pc (&addr_string);
|
||||||
const char *const_expr = expr;
|
|
||||||
struct cleanup *cleanup = make_cleanup (xfree, expr);
|
|
||||||
|
|
||||||
addr = linespec_expression_to_pc (&const_expr);
|
|
||||||
if (PARSER_STATE (parser)->canonical != NULL)
|
if (PARSER_STATE (parser)->canonical != NULL)
|
||||||
PARSER_STATE (parser)->canonical->location
|
PARSER_STATE (parser)->canonical->location
|
||||||
= copy_event_location (location);
|
= copy_event_location (location);
|
||||||
|
|
||||||
do_cleanups (cleanup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = convert_address_location_to_sals (PARSER_STATE (parser),
|
result = convert_address_location_to_sals (PARSER_STATE (parser),
|
||||||
|
Reference in New Issue
Block a user