]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Darwin: Fix gdb compilation.
authorBernhard Heckel <bernhard.heckel@intel.com>
Thu, 15 Dec 2016 13:04:11 +0000 (14:04 +0100)
committerBernhard Heckel <bernhard.heckel@intel.com>
Fri, 16 Dec 2016 12:39:52 +0000 (13:39 +0100)
Due to changes introduced by
commit 4d01a485d29732b19743e8b138897f3509e071b0
('struct expression *' -> gdb::unique_xmalloc_ptr<expression>)
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<expression, gdb::xfree_deleter<expression> >')
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  <bernhard.heckel@intel.com>

gdb/Changelog:
* darwin-nat-info.c (info_mach_region_command): Use expression_up.

gdb/ChangeLog
gdb/darwin-nat-info.c

index e25f025eebe330073818a144ad30ff94ec25f58f..0f4e3a949e1cddb703cac8ea1eee240f1cde410b 100644 (file)
@@ -1,3 +1,7 @@
+2016-12-16  Bernhard Heckel  <bernhard.heckel@intel.com>
+
+       * darwin-nat-info.c (info_mach_region_command): Use expression_up.
+
 2016-12-12  Yao Qi  <yao.qi@linaro.org>
 
        PR tdep/20955
index 314d265f7e3d0d134936fc50fde9fa5eb7eef470..0262026e331df3decf3dcae71cc4dccd50ff2969 100644 (file)
@@ -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);