[PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Iain Buclaw
Third times a charm.

Rebased this against master, in particular to make it compatible with
the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
hand, but I don't think I'm doing anything that may trigger build
warnings.  Pierre, maybe you want to confirm?

I've also gotten round to completing the d-exp expression parser
rewrite - or at least to a nice stable point.  Will be submitting that
in patch #2.

Regards
Iain

---

dlang-namespace-3.patch (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Pierre-Marie de Rodat
Hello,

On 08/03/2015 08:00 PM, Iain Buclaw wrote:
> Rebased this against master, in particular to make it compatible with
> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
> hand, but I don't think I'm doing anything that may trigger build
> warnings.  Pierre, maybe you want to confirm?

Well, I don't have easy access to one neither. ;-) I had a very quick
look at your patch and it seems that all usage of block_symbol variables
are dominated by at least one affectation (sym = lookup...), so I guess
the problem Ulrich and Steve noticed should not arise here.

... except maybe in one place: in find_symbol_in_baseclass, the returned
value is uninitialized if we don't enter the FOR loop (is that only
possible in practice?). So what about providing {NULL, NULL} as an
ininialization value to "sym", there?

--
Pierre-Marie de Rodat
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Iain Buclaw
On 4 August 2015 at 10:27, Pierre-Marie de Rodat <[hidden email]> wrote:

> Hello,
>
> On 08/03/2015 08:00 PM, Iain Buclaw wrote:
>>
>> Rebased this against master, in particular to make it compatible with
>> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
>> hand, but I don't think I'm doing anything that may trigger build
>> warnings.  Pierre, maybe you want to confirm?
>
>
> Well, I don't have easy access to one neither. ;-) I had a very quick look
> at your patch and it seems that all usage of block_symbol variables are
> dominated by at least one affectation (sym = lookup...), so I guess the
> problem Ulrich and Steve noticed should not arise here.
>
> ... except maybe in one place: in find_symbol_in_baseclass, the returned
> value is uninitialized if we don't enter the FOR loop (is that only possible
> in practice?). So what about providing {NULL, NULL} as an ininialization
> value to "sym", there?
>
> --
> Pierre-Marie de Rodat

Nice catch!  Yes, that seems reasonable.  I think in the original it
was initialized to NULL...

Regards
Iain.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Doug Evans-5
In reply to this post by Iain Buclaw
Iain Buclaw <[hidden email]> writes:

> Third times a charm.
>
> Rebased this against master, in particular to make it compatible with
> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
> hand, but I don't think I'm doing anything that may trigger build
> warnings.  Pierre, maybe you want to confirm?
>
> I've also gotten round to completing the d-exp expression parser
> rewrite - or at least to a nice stable point.  Will be submitting that
> in patch #2.
>
> Regards
> Iain
>
> ---
>
> ---
> 2015-08-03  Iain Buclaw  <[hidden email]>
>
> * Makefile.in (SFILES): Add d-namespace.c.
> (COMMON_OBS): Add d-namespace.o.
> * d-lang.c (d_language_defn): Use d_lookup_symbol_nonlocal as the
> la_lookup_symbol_nonlocal callback function pointer.
> * d-lang.h (d_lookup_symbol_nonlocal): New declaration.
> (d_lookup_nested_symbol): New declaration.
> * d-namespace.c: New file.

Hi.
LGTM (with the one nit fixed that Pierre-Marie pointed out).
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Iain Buclaw
On 13 August 2015 at 06:01, Doug Evans <[hidden email]> wrote:

> Iain Buclaw <[hidden email]> writes:
>> Third times a charm.
>>
>> Rebased this against master, in particular to make it compatible with
>> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
>> hand, but I don't think I'm doing anything that may trigger build
>> warnings.  Pierre, maybe you want to confirm?
>>
>> I've also gotten round to completing the d-exp expression parser
>> rewrite - or at least to a nice stable point.  Will be submitting that
>> in patch #2.
>>
>> Regards
>> Iain
>>
>> ---
>>
>> ---
>> 2015-08-03  Iain Buclaw  <[hidden email]>
>>
>>       * Makefile.in (SFILES): Add d-namespace.c.
>>       (COMMON_OBS): Add d-namespace.o.
>>       * d-lang.c (d_language_defn): Use d_lookup_symbol_nonlocal as the
>>       la_lookup_symbol_nonlocal callback function pointer.
>>       * d-lang.h (d_lookup_symbol_nonlocal): New declaration.
>>       (d_lookup_nested_symbol): New declaration.
>>       * d-namespace.c: New file.
>
> Hi.
> LGTM (with the one nit fixed that Pierre-Marie pointed out).

Thanks.  Will also tweak the includes to use the new namespace.h too.

I'll push this and the other in tonight.

Regards
Iain
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Yao Qi
In reply to this post by Iain Buclaw
Iain Buclaw <[hidden email]> writes:

> Third times a charm.
>
> Rebased this against master, in particular to make it compatible with
> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
> hand, but I don't think I'm doing anything that may trigger build
> warnings.  Pierre, maybe you want to confirm?
>
> I've also gotten round to completing the d-exp expression parser
> rewrite - or at least to a nice stable point.  Will be submitting that
> in patch #2.

Hi Iain,
This patch causes a regression shown by buildbot
https://sourceware.org/ml/gdb-testers/2015-q3/msg07398.html

python print(gdb.lookup_type('ucent').name)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
gdb.error: No type named ucent.
Error while executing Python code.
(gdb) FAIL: gdb.python/py-lookup-type.exp: lookup type ucent using language d

can you take a look?

--
Yao (齐尧)
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Iain Buclaw
On 3 September 2015 at 16:13, Yao Qi <[hidden email]> wrote:

> Iain Buclaw <[hidden email]> writes:
>
>> Third times a charm.
>>
>> Rebased this against master, in particular to make it compatible with
>> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
>> hand, but I don't think I'm doing anything that may trigger build
>> warnings.  Pierre, maybe you want to confirm?
>>
>> I've also gotten round to completing the d-exp expression parser
>> rewrite - or at least to a nice stable point.  Will be submitting that
>> in patch #2.
>
> Hi Iain,
> This patch causes a regression shown by buildbot
> https://sourceware.org/ml/gdb-testers/2015-q3/msg07398.html
>
> python print(gdb.lookup_type('ucent').name)
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> gdb.error: No type named ucent.
> Error while executing Python code.
> (gdb) FAIL: gdb.python/py-lookup-type.exp: lookup type ucent using language d
>
> can you take a look?
>


Will do, I didn't realise that the python testsuite called into language D.

Iain
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Iain Buclaw
In reply to this post by Yao Qi
On 3 September 2015 at 16:13, Yao Qi <[hidden email]> wrote:

> Iain Buclaw <[hidden email]> writes:
>
>> Third times a charm.
>>
>> Rebased this against master, in particular to make it compatible with
>> the recent block_symbol additions.  I don't have a GCC-4.1 compiler at
>> hand, but I don't think I'm doing anything that may trigger build
>> warnings.  Pierre, maybe you want to confirm?
>>
>> I've also gotten round to completing the d-exp expression parser
>> rewrite - or at least to a nice stable point.  Will be submitting that
>> in patch #2.
>
> Hi Iain,
> This patch causes a regression shown by buildbot
> https://sourceware.org/ml/gdb-testers/2015-q3/msg07398.html
>
> python print(gdb.lookup_type('ucent').name)
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> gdb.error: No type named ucent.
> Error while executing Python code.
> (gdb) FAIL: gdb.python/py-lookup-type.exp: lookup type ucent using language d
>
> can you take a look?
>
> --
> Yao (齐尧)

Hi Yao,

Committed the fix for this, built on current head and tested
'check-gdb.python' before pushing in.  Everything looks good from
here.

Regards
Iain.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v3 1/2] D: Support looking up symbols in the current and imported modules

Yao Qi
Iain Buclaw <[hidden email]> writes:

> Committed the fix for this, built on current head and tested
> 'check-gdb.python' before pushing in.  Everything looks good from
> here.

Great, thanks!

--
Yao (齐尧)