From 97f00e367c8222cda51bc7c0e9d3073a487a5976 Mon Sep 17 00:00:00 2001 From: Bernhard Heckel Date: Thu, 15 Dec 2016 14:04:11 +0100 Subject: [PATCH] Darwin: Fix gdb compilation. Due to changes introduced by commit 4d01a485d29732b19743e8b138897f3509e071b0 ('struct expression *' -> gdb::unique_xmalloc_ptr) compilation is broken on Darwin. ../gdb/darwin-nat-info.c:733:8: error: assigning to 'struct expression *' from incompatible type 'expression_up' (aka 'std::__1::unique_ptr >') expr = parse_expression (exp); Beside compilation, memory leak was solved as 'make_clean_up' was not called in previous version. 2016-12-16 Bernhard Heckel gdb/Changelog: * darwin-nat-info.c (info_mach_region_command): Use expression_up. --- gdb/ChangeLog | 4 ++++ gdb/darwin-nat-info.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e25f025eebe..0f4e3a949e1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-12-16 Bernhard Heckel + + * darwin-nat-info.c (info_mach_region_command): Use expression_up. + 2016-12-12 Yao Qi PR tdep/20955 diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c index 314d265f7e3..0262026e331 100644 --- a/gdb/darwin-nat-info.c +++ b/gdb/darwin-nat-info.c @@ -725,13 +725,12 @@ info_mach_regions_recurse_command (char *args, int from_tty) static void info_mach_region_command (char *exp, int from_tty) { - struct expression *expr; struct value *val; mach_vm_address_t address; struct inferior *inf; - expr = parse_expression (exp); - val = evaluate_expression (expr); + expression_up expr = parse_expression (exp); + val = evaluate_expression (expr.get ()); if (TYPE_CODE (value_type (val)) == TYPE_CODE_REF) { val = value_ind (val); -- 2.30.2