* Re: Use yylloc instead of yyloc
[not found] ` <20091112001404.GI3235-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
@ 2009-11-12 3:42 ` Jon Loeliger
[not found] ` <E1N8QaJ-00031X-GU-CYoMK+44s/E@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jon Loeliger @ 2009-11-12 3:42 UTC (permalink / raw)
To: David Gibson; +Cc: Lukasz Wojcik, devicetree-discuss-mnsaURCQ41sdnm+yROfE0A
> Jon, fix for the typo the FreeBSD folks noticed. Please apply.
>
> yylloc is the correct way to get token positioning information. yyloc
> is a bison internal variable that only works by accident.
>
> Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
>
> Index: dtc/dtc-parser.y
> ===================================================================
> --- dtc.orig/dtc-parser.y 2009-11-12 11:11:15.000000000 +1100
> +++ dtc/dtc-parser.y 2009-11-12 11:11:20.000000000 +1100
> @@ -175,7 +175,7 @@ propdata:
>
> if ($6 != 0)
> if (fseek(file->file, $6, SEEK_SET) != 0)
> - srcpos_error(&yyloc,
> + srcpos_error(&yylloc,
> "Couldn't seek to offset %
> llu in \"%s\": %s",
> (unsigned long long)$6,
> $4.val,
>
>
Applied.
jdl
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Use yylloc instead of yyloc
[not found] ` <E1N8QaJ-00031X-GU-CYoMK+44s/E@public.gmane.org>
@ 2009-11-13 13:10 ` Lukasz Wojcik
[not found] ` <4AFD5AD6.6060906-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Wojcik @ 2009-11-13 13:10 UTC (permalink / raw)
To: Jon Loeliger; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A
Jon Loeliger wrote:
>> Jon, fix for the typo the FreeBSD folks noticed. Please apply.
>>
>> yylloc is the correct way to get token positioning information. yyloc
>> is a bison internal variable that only works by accident.
>>
>> Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
>>
>> Index: dtc/dtc-parser.y
>> ===================================================================
>> --- dtc.orig/dtc-parser.y 2009-11-12 11:11:15.000000000 +1100
>> +++ dtc/dtc-parser.y 2009-11-12 11:11:20.000000000 +1100
>> @@ -175,7 +175,7 @@ propdata:
>>
>> if ($6 != 0)
>> if (fseek(file->file, $6, SEEK_SET) != 0)
>> - srcpos_error(&yyloc,
>> + srcpos_error(&yylloc,
>> "Couldn't seek to offset %
>> llu in \"%s\": %s",
>> (unsigned long long)$6,
>> $4.val,
>>
>>
>>
>
> Applied.
>
> jdl
>
Thanks a lot for your quick fix. I have one observation to share though:
After applying newest fix, i did the tests around incbin feature. I have
modified original incbin.dts (from ./tests/ subdir) as follows :
---diff---
5c5
< incbin-partial = /incbin/("incbin.bin", 0xfffffffffffffff,
0xffffffffffffffff);
---
> incbin-partial = /incbin/("incbin.bin", 13, 17);
---eofdiff---
Trying to run following command:
./dtc -O dtb -o incbin.dtb -b 0 -p 1024 incbin.dts
..produces output:
Error: incbin.dts 5:1 - 1:1 Couldn't seek to offset 1152921504606846975
in "incbin.bin": Invalid argument
I'm just wondering where exactly does location 5:1 - 1:1 point. It seems to
be a bit unclear. Wouldn't it be enough to just specify line number ? Thanks
again.
Lukasz.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Use yylloc instead of yyloc
[not found] ` <4AFD5AD6.6060906-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
@ 2009-11-15 12:39 ` David Gibson
0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2009-11-15 12:39 UTC (permalink / raw)
To: Lukasz Wojcik; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A
On Fri, Nov 13, 2009 at 02:10:46PM +0100, Lukasz Wojcik wrote:
> Jon Loeliger wrote:
> >>Jon, fix for the typo the FreeBSD folks noticed. Please apply.
> >>
> >>yylloc is the correct way to get token positioning information. yyloc
> >>is a bison internal variable that only works by accident.
> >>
> >>Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
> >>
> >>Index: dtc/dtc-parser.y
> >>===================================================================
> >>--- dtc.orig/dtc-parser.y 2009-11-12 11:11:15.000000000 +1100
> >>+++ dtc/dtc-parser.y 2009-11-12 11:11:20.000000000 +1100
> >>@@ -175,7 +175,7 @@ propdata:
> >> if ($6 != 0)
> >> if (fseek(file->file, $6, SEEK_SET) != 0)
> >>- srcpos_error(&yyloc,
> >>+ srcpos_error(&yylloc,
> >> "Couldn't seek to offset %
> >>llu in \"%s\": %s",
> >> (unsigned long long)$6,
> >> $4.val,
> >>
> >>
> >
> >Applied.
> >
> >jdl
> Thanks a lot for your quick fix. I have one observation to share though:
> After applying newest fix, i did the tests around incbin feature. I have
> modified original incbin.dts (from ./tests/ subdir) as follows :
>
> ---diff---
> 5c5
> < incbin-partial = /incbin/("incbin.bin", 0xfffffffffffffff,
> 0xffffffffffffffff);
> ---
> > incbin-partial = /incbin/("incbin.bin", 13, 17);
>
> ---eofdiff---
Um.. I can't really read plain-mode diffs, which way around is that
change?
> Trying to run following command:
>
> ./dtc -O dtb -o incbin.dtb -b 0 -p 1024 incbin.dts
>
> ..produces output:
>
> Error: incbin.dts 5:1 - 1:1 Couldn't seek to offset
> 1152921504606846975 in "incbin.bin": Invalid argument
>
> I'm just wondering where exactly does location 5:1 - 1:1 point. It seems to
> be a bit unclear. Wouldn't it be enough to just specify line number ? Thanks
> again.
I believe that's line 5, column 1 to line 1 column 1. Clearly the
ending position is wrong - I don't think we properly initialize the
ending position information anywhere. I have a patch in my queue that
does that, and also makes the display format more consistent with what
gcc and bison use. That series of patches hasn't been merged because
it conflicts with some other stuff Jon was working on. Maybe we
should revisit it though.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-15 12:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091112001404.GI3235@yookeroo.seuss>
[not found] ` <20091112001404.GI3235-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-11-12 3:42 ` Use yylloc instead of yyloc Jon Loeliger
[not found] ` <E1N8QaJ-00031X-GU-CYoMK+44s/E@public.gmane.org>
2009-11-13 13:10 ` Lukasz Wojcik
[not found] ` <4AFD5AD6.6060906-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
2009-11-15 12:39 ` David Gibson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.