From: Pedro Alves <palves@redhat.com>
To: Bernhard Heckel <bernhard.heckel@intel.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH obv] Darwin: Fix gdb compilation.
Date: Fri, 16 Dec 2016 11:32:00 -0000 [thread overview]
Message-ID: <e4cfa41f-1f5a-d6d5-d0d6-be2ccc04e1cb@redhat.com> (raw)
In-Reply-To: <1481883230-17279-1-git-send-email-bernhard.heckel@intel.com>
On 12/16/2016 10:13 AM, Bernhard Heckel wrote:
> 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);
>
> 2016-12-16 Bernhard Heckel <bernhard.heckel@intel.com>
>
> gdb/Changelog:
> * darwin-nat-info.c (info_mach_region_command): Use expression_up.
OK, please push if you haven't yet.
> 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);
>
Note this fixes a leak as well -- nothing was deleting exp before.
Thanks,
Pedro Alves
prev parent reply other threads:[~2016-12-16 11:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 10:14 Bernhard Heckel
2016-12-16 11:32 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4cfa41f-1f5a-d6d5-d0d6-be2ccc04e1cb@redhat.com \
--to=palves@redhat.com \
--cc=bernhard.heckel@intel.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox