From: Matt Rice <ratmice@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Michael Snyder <msnyder@vmware.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: disable objective-c stuff when theres no objective-c cu.
Date: Sun, 17 Oct 2010 21:57:00 -0000 [thread overview]
Message-ID: <AANLkTin636eKHZ=aVGokV=z+obgPRatRr8Db=F4qTea_@mail.gmail.com> (raw)
In-Reply-To: <20101017201252.GA22566@host1.dyn.jankratochvil.net>
On Sun, Oct 17, 2010 at 1:12 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Wed, 06 Oct 2010 15:12:06 +0200, Matt Rice wrote:
>> what I mean is that 'break' is not related to the current language,
>> but the language which we want to be the current language
>> when the breakpoint is hit. and so 'set language' to use language
>> specific breakpoints is arguably wrong because the current language
>> may not be the language of the breakpoint we want set.
>
> OK, I understand that Obj-C is special that it (a) is mixed with C/C++ and
> even possibly having C/C++ main(), (b) requiring Obj-C specific support to
> just figure out where to place a breakpoint.
>
> That `objc:' breakpoint prefix etc. could be nice but a more conservative
> change IMO also makes sense. I can imagine it could be inconvenient for Obj-C
> development (which I do not know myself, though).
I tend to agree, with the conservative approach,
requiring objc: sometimes could lead to an inconsistent user experience
I prefer this approach because of the minimal user impact, yet we get
the bulk of objc_decode
out of the way of non-objc users.
>> doesn't seem as though reading language symfiles frobs the current
>> language afaict.
>
> It really does not.
>
>
> + set_language_has_cu_loaded(subfile->language);
>
> here should be a space: `...loaded (subfile->...'
k, will fix that
> +/* A mask for languages that want to enable specific behaviours if (not when)
> + a compilation unit of that language has been loaded. */
> +#define CU_LOADED_C_LANG_MASK 0x1 << 0
> +#define CU_LOADED_CPLUS_LANG_MASK 0x1 << 1
>
> Do I miss something why don't you use enum language like (1 << language_objc)?
> nr_languages == 14 so it fits fine into a bitmask. BTW such #define right
> hand sides should be in parentheses (for operator priority surprises during
> their use).
before i spin a new patch, lets resolve this, the reason I used a
define instead of an enum
was because I vaguely reember weird differences wrt c and c++ enum use
as numerical values.
Not sure if this case is actually hit by that, I just figured that
define was relatively future-proof,
if a bit ugly, i should probably actually try it with c++.
I definitely prefer enum to what i did here. so yeah, there was a
reason but its possibly
irrelevent and/or unecessary.
> +static unsigned int cu_languages_loaded_mask;
>
> One can imagine this mask may (possibly in the future) modify user-visible
> behavior due to a different code paths being executed due to it - which is
> also its purpose.
>
> Loading program A, kill, loading program B would behave differently than just
> loading program B with fresh GDB.
>
> I would place such mask into `struct objfile'. Checking its content then
> means iterating ALL_OBJFILES but I would find it acceptable. (Some
> accelerations of such scheme are also possible - when performance is a goal of
> this patch anyway.) This would make the GDB behavior more deterministic IMO.
ahh, I had totally spaced on this and the multi-process impact of this
change, thanks
will look into this.
> +unsigned int
> +language_has_cu_loaded (enum language lang)
> +{
> + unsigned int lang_mask = mask_for_language (lang);
> + return cu_languages_loaded_mask & lang_mask;
> +}
>
> As it returns boolean it should be just `int' and I would make it normalized
> to 0-or-1.
k
prev parent reply other threads:[~2010-10-17 21:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 22:37 Matt Rice
2010-10-05 23:31 ` Michael Snyder
2010-10-05 23:35 ` Matt Rice
2010-10-06 2:30 ` Matt Rice
2010-10-06 8:51 ` Jan Kratochvil
2010-10-06 10:03 ` Matt Rice
2010-10-06 13:12 ` Matt Rice
2010-10-06 17:06 ` Joel Brobecker
2010-10-06 17:54 ` Matt Rice
2010-10-17 20:13 ` Jan Kratochvil
2010-10-17 21:57 ` Matt Rice [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='AANLkTin636eKHZ=aVGokV=z+obgPRatRr8Db=F4qTea_@mail.gmail.com' \
--to=ratmice@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=msnyder@vmware.com \
/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