Re: [Openocd-development] compiler warnings with dsp5680xx.c
On Wed, Jun 29, 2011 at 3:43 PM, Andreas Fritiofson wrote: > > > On Wed, Jun 29, 2011 at 9:17 PM, Rodrigo Rosa > wrote: >> >> On Wed, Jun 29, 2011 at 12:44 AM, Øyvind Harboe >> wrote: >> > This is disturbing. Why switch to global variables? >> > >> > +static uint32_t data_read_dummy; >> > static int jtag_data_write(struct target * target, uint32_t instr,int >> > num_bits, uint32_t * data_read){ >> > int retval; >> > - uint32_t data_read_dummy; >> > >> >> i did this to have mem to dump the data read at the time the queue is >> flushed >> i do not care about this data, but i need somewhere to dump it >> (otherwise it'll segfault). multiple instances of the target would not >> cause trouble, since i do not care about this data, so it could be >> overwritten and it would no break anything. > > It should be safe to pass null as read pointer if you want to discard the > data from the scan. This is also explicitly stated in dsp5680xx_drscan(). > However, jtag_data_write does use the data: > if(data_read != NULL) > *data_read = data_read_dummy; > This doesn't seem right, because the queue hasn't been executed yet and so > data_read_dummy has a bogus value. Bug? > /Andreas jtag_data_write calls dsp5680xx_drscan, and dsp5680xx_drscan executes the queue. when dsp5680xx_drscan does execute the queue then the data that is read is bogus. i only disabled flushing the queue when i'm in write loops, where i do not care about the data read out the the drscan. all the read commands work correctly, and the writing commands that use the data always execute the queue (context.flush==1) the dsp568013 return the value of the status register when you execute any instruction, that's why i added the possibility of pulling out the data from a write command (to avoid reading the register explicitly) thanks. -- Rodrigo. ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
The warnings are gone. I saw some more followup to your patches. Could you work over that feedback and push a fix to a branch in your fork and post a message when it's ready? Thanks! We may be moving to "pull requests" soon -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
On Wed, Jun 29, 2011 at 9:17 PM, Rodrigo Rosa wrote: > On Wed, Jun 29, 2011 at 12:44 AM, Øyvind Harboe > wrote: > > This is disturbing. Why switch to global variables? > > > > +static uint32_t data_read_dummy; > > static int jtag_data_write(struct target * target, uint32_t instr,int > > num_bits, uint32_t * data_read){ > > int retval; > > - uint32_t data_read_dummy; > > > > i did this to have mem to dump the data read at the time the queue is > flushed > i do not care about this data, but i need somewhere to dump it > (otherwise it'll segfault). multiple instances of the target would not > cause trouble, since i do not care about this data, so it could be > overwritten and it would no break anything. It should be safe to pass null as read pointer if you want to discard the data from the scan. This is also explicitly stated in dsp5680xx_drscan(). However, jtag_data_write does use the data: if(data_read != NULL) *data_read = data_read_dummy; This doesn't seem right, because the queue hasn't been executed yet and so data_read_dummy has a bogus value. Bug? /Andreas ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
patches 1,2,3,4 get the target to the state it was before it was disabled, but with the warnings fixed. why were the warnings not showing up when i originally submitted the patch? the dsp5680xx has been around for at least a month... i'm worried about not being able to get the compiler to show me the warnings yours shows, it will be hard to avoid introducing new warnings if i cannot see them... i will see if i can modify some settings to get the warnings to pop up thanks. On Wed, Jun 29, 2011 at 2:00 PM, Øyvind Harboe wrote: > Could you create a branch in your fork and post something when it's ready? > > Thanks! > > > > -- > Øyvind Harboe - Can Zylin Consulting help on your project? > US toll free 1-866-980-3434 / International +47 51 87 40 27 > http://www.zylin.com/ > -- Rodrigo. ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
Could you create a branch in your fork and post something when it's ready? Thanks! -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
i messed something up during the last changes, this patch fixes it. i'll be doing a lot of testing during the next days. sorry for the trouble... On Wed, Jun 29, 2011 at 1:13 PM, Rodrigo Rosa wrote: > On Wed, Jun 29, 2011 at 12:20 PM, Øyvind Harboe > wrote: Seperate patch? Does this have anything to do with fixing warnings? - counter = FLUSH_COUNT_FLASH; + counter = FLUSH_COUNT_READ_WRITE; >>> >>> nothing to do with warnings, but it doesn't really affect anything, >>> since both constants are defined to the same value (i'm was >>> experimenting with them some time ago) >> >> Fixing warnings should be in a separate patch really.l >> > > it split the first of the two commits: > git rebase -i origin/master > --> chose "edit" on the commit i wanted to modify. > git reset HEAD^ > --> now the changes from the selected commit are not staged > --> changed stuff > git add > git commit > --> first part done > --> change more stuff > git add > git commit > --> done splitting commit > git rebase --continue > git format-patch origin/master > > pretty cool :) > > > > do you have any clue about what i'm doing wrong? What warnings you get depend on what compiler you're using. try CFLAGS="-O3 -g" configure xx >>> >>> i do not get the warnings. >>> i've been reading a bit, and those warnings should only appear if >>> -Wcast-align is set. >>> i tried >>> ./configure --enable-mantainer-mode --enable-ft2232-libftdi >>> CFLAGS="-O3 -g -Wcast-align" >>> but still no warnings... >>> what flags are you using? >> >> I don't know precisely why some target compilers have more than >> others. nios2-elf-gcc gives genuine warnings that I would have liked >> to see from x86 as well. Gcc versions? Something in the target definition >> defaults? >> >> -- >> Øyvind Harboe - Can Zylin Consulting help on your project? >> US toll free 1-866-980-3434 / International +47 51 87 40 27 >> http://www.zylin.com/ >> > > > > -- > Rodrigo. > -- Rodrigo. 0004-fix-write-error.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
On Wed, Jun 29, 2011 at 12:20 PM, Øyvind Harboe wrote: >>> Seperate patch? Does this have anything to do with fixing warnings? >>> >>> - counter = FLUSH_COUNT_FLASH; >>> + counter = FLUSH_COUNT_READ_WRITE; >>> >> >> nothing to do with warnings, but it doesn't really affect anything, >> since both constants are defined to the same value (i'm was >> experimenting with them some time ago) > > Fixing warnings should be in a separate patch really.l > it split the first of the two commits: git rebase -i origin/master --> chose "edit" on the commit i wanted to modify. git reset HEAD^ --> now the changes from the selected commit are not staged --> changed stuff git add git commit --> first part done --> change more stuff git add git commit --> done splitting commit git rebase --continue git format-patch origin/master pretty cool :) do you have any clue about what i'm doing wrong? >>> >>> What warnings you get depend on what compiler you're using. >>> >>> try >>> >>> CFLAGS="-O3 -g" configure xx >>> >> >> i do not get the warnings. >> i've been reading a bit, and those warnings should only appear if >> -Wcast-align is set. >> i tried >> ./configure --enable-mantainer-mode --enable-ft2232-libftdi >> CFLAGS="-O3 -g -Wcast-align" >> but still no warnings... >> what flags are you using? > > I don't know precisely why some target compilers have more than > others. nios2-elf-gcc gives genuine warnings that I would have liked > to see from x86 as well. Gcc versions? Something in the target definition > defaults? > > -- > Øyvind Harboe - Can Zylin Consulting help on your project? > US toll free 1-866-980-3434 / International +47 51 87 40 27 > http://www.zylin.com/ > -- Rodrigo. 0001-fix-warnings.patch Description: Binary data 0002-fix-wrong-reference.patch Description: Binary data 0003-re-enable-dsp5680xx-target.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
>> Seperate patch? Does this have anything to do with fixing warnings? >> >> - counter = FLUSH_COUNT_FLASH; >> + counter = FLUSH_COUNT_READ_WRITE; >> > > nothing to do with warnings, but it doesn't really affect anything, > since both constants are defined to the same value (i'm was > experimenting with them some time ago) Fixing warnings should be in a separate patch really.l >>> do you have any clue about what i'm doing wrong? >> >> What warnings you get depend on what compiler you're using. >> >> try >> >> CFLAGS="-O3 -g" configure xx >> > > i do not get the warnings. > i've been reading a bit, and those warnings should only appear if > -Wcast-align is set. > i tried > ./configure --enable-mantainer-mode --enable-ft2232-libftdi > CFLAGS="-O3 -g -Wcast-align" > but still no warnings... > what flags are you using? I don't know precisely why some target compilers have more than others. nios2-elf-gcc gives genuine warnings that I would have liked to see from x86 as well. Gcc versions? Something in the target definition defaults? -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
On Wed, Jun 29, 2011 at 12:44 AM, Øyvind Harboe wrote: > This is disturbing. Why switch to global variables? > > +static uint32_t data_read_dummy; > static int jtag_data_write(struct target * target, uint32_t instr,int > num_bits, uint32_t * data_read){ > int retval; > - uint32_t data_read_dummy; > i did this to have mem to dump the data read at the time the queue is flushed i do not care about this data, but i need somewhere to dump it (otherwise it'll segfault). multiple instances of the target would not cause trouble, since i do not care about this data, so it could be overwritten and it would no break anything. i can work out a better solution if it is important. > Seperate patch? Does this have anything to do with fixing warnings? > > - counter = FLUSH_COUNT_FLASH; > + counter = FLUSH_COUNT_READ_WRITE; > nothing to do with warnings, but it doesn't really affect anything, since both constants are defined to the same value (i'm was experimenting with them some time ago) >> do you have any clue about what i'm doing wrong? > > What warnings you get depend on what compiler you're using. > > try > > CFLAGS="-O3 -g" configure xx > i do not get the warnings. i've been reading a bit, and those warnings should only appear if -Wcast-align is set. i tried ./configure --enable-mantainer-mode --enable-ft2232-libftdi CFLAGS="-O3 -g -Wcast-align" but still no warnings... what flags are you using? > > -- > Øyvind Harboe - Can Zylin Consulting help on your project? > US toll free 1-866-980-3434 / International +47 51 87 40 27 > http://www.zylin.com/ > thanks -- Rodrigo. ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
This is disturbing. Why switch to global variables? +static uint32_t data_read_dummy; static int jtag_data_write(struct target * target, uint32_t instr,int num_bits, uint32_t * data_read){ int retval; - uint32_t data_read_dummy; Seperate patch? Does this have anything to do with fixing warnings? - counter = FLUSH_COUNT_FLASH; + counter = FLUSH_COUNT_READ_WRITE; > do you have any clue about what i'm doing wrong? What warnings you get depend on what compiler you're using. try CFLAGS="-O3 -g" configure xx -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
Thanks for the fast response! Better, but one more: libtool: compile: nios2-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I/home/oyvind/workspace/zy1000/build/../openocd/src/target -I../.. -I/home/oyvind/workspace/zy1000/build/../openocd/src -I../../src -DPKGDATADIR=\"/opt/zy1000/share/openocd\" -DPKGLIBDIR=\"/opt/zy1000/lib/openocd\" -O3 -g -I/home/oyvind/nios2-linux/uClinux-dist/staging/usr/include -I/opt/zy1000/include -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT dsp5680xx.lo -MD -MP -MF .deps/dsp5680xx.Tpo -c /home/oyvind/workspace/zy1000/build/../openocd/src/target/dsp5680xx.c -o dsp5680xx.o cc1: warnings being treated as errors /home/oyvind/workspace/zy1000/build/../openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': /home/oyvind/workspace/zy1000/build/../openocd/src/target/dsp5680xx.c:815: warning: cast increases required alignment of target type -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
ok, now i've tested everything and it works ok. as i said on the other mail, i modified the read functions and got rid of the casting warnings. the first patch has the changes to get rid of the warnings, and the second patch re-enables the target. thanks On Tue, Jun 28, 2011 at 8:22 PM, Rodrigo Rosa wrote: > i've been doing some testing and i realized i missed several important things. > please ignore the previous patch. > i am preparing a correct one. > > thanks. > > On Tue, Jun 28, 2011 at 4:51 PM, Rodrigo Rosa > wrote: >> hi >> >> i modified the read functions and got rid of the casting warnings. >> been trying the changes, and everything seems to work ok. >> >> the first patch has the changes to get rid of the warnings, and the >> second patch re-enables the target. >> >> salú! >> >> On Tue, Jun 28, 2011 at 9:31 AM, Øyvind Harboe >> wrote: >>> dsp5680xx.c generates warnings. Could someone submit a patch to fix this? >>> >>> I'll disable this source file meanwhile. >>> >>> openocd/src/target/dsp5680xx.c: In function 'eonce_rx_upper_data': >>> openocd/src/target/dsp5680xx.c:252: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c: In function 'eonce_rx_lower_data': >>> openocd/src/target/dsp5680xx.c:268: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c: In function 'eonce_pc_store': >>> openocd/src/target/dsp5680xx.c:508: warning: dereferencing type-punned >>> pointer will break strict-aliasing rules >>> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_read': >>> openocd/src/target/dsp5680xx.c:736: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c:737: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': >>> openocd/src/target/dsp5680xx.c:823: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write': >>> openocd/src/target/dsp5680xx.c:938: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c:941: warning: cast increases required >>> alignment of target type >>> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_f_wr': >>> openocd/src/target/dsp5680xx.c:1355: warning: cast increases required >>> alignment of target type >>> >>> >>> -- >>> Øyvind Harboe - Can Zylin Consulting help on your project? >>> US toll free 1-866-980-3434 / International +47 51 87 40 27 >>> http://www.zylin.com/ >>> ___ >>> Openocd-development mailing list >>> Openocd-development@lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/openocd-development >>> >> >> >> >> -- >> Rodrigo. >> > > > > -- > Rodrigo. > -- Rodrigo. 0001-fix-warnings.patch Description: Binary data 0002-enable-dsp5680xx.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
i've been doing some testing and i realized i missed several important things. please ignore the previous patch. i am preparing a correct one. thanks. On Tue, Jun 28, 2011 at 4:51 PM, Rodrigo Rosa wrote: > hi > > i modified the read functions and got rid of the casting warnings. > been trying the changes, and everything seems to work ok. > > the first patch has the changes to get rid of the warnings, and the > second patch re-enables the target. > > salú! > > On Tue, Jun 28, 2011 at 9:31 AM, Øyvind Harboe > wrote: >> dsp5680xx.c generates warnings. Could someone submit a patch to fix this? >> >> I'll disable this source file meanwhile. >> >> openocd/src/target/dsp5680xx.c: In function 'eonce_rx_upper_data': >> openocd/src/target/dsp5680xx.c:252: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c: In function 'eonce_rx_lower_data': >> openocd/src/target/dsp5680xx.c:268: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c: In function 'eonce_pc_store': >> openocd/src/target/dsp5680xx.c:508: warning: dereferencing type-punned >> pointer will break strict-aliasing rules >> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_read': >> openocd/src/target/dsp5680xx.c:736: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c:737: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': >> openocd/src/target/dsp5680xx.c:823: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write': >> openocd/src/target/dsp5680xx.c:938: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c:941: warning: cast increases required >> alignment of target type >> openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_f_wr': >> openocd/src/target/dsp5680xx.c:1355: warning: cast increases required >> alignment of target type >> >> >> -- >> Øyvind Harboe - Can Zylin Consulting help on your project? >> US toll free 1-866-980-3434 / International +47 51 87 40 27 >> http://www.zylin.com/ >> ___ >> Openocd-development mailing list >> Openocd-development@lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/openocd-development >> > > > > -- > Rodrigo. > -- Rodrigo. ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] compiler warnings with dsp5680xx.c
hi i modified the read functions and got rid of the casting warnings. been trying the changes, and everything seems to work ok. the first patch has the changes to get rid of the warnings, and the second patch re-enables the target. salú! On Tue, Jun 28, 2011 at 9:31 AM, Øyvind Harboe wrote: > dsp5680xx.c generates warnings. Could someone submit a patch to fix this? > > I'll disable this source file meanwhile. > > openocd/src/target/dsp5680xx.c: In function 'eonce_rx_upper_data': > openocd/src/target/dsp5680xx.c:252: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c: In function 'eonce_rx_lower_data': > openocd/src/target/dsp5680xx.c:268: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c: In function 'eonce_pc_store': > openocd/src/target/dsp5680xx.c:508: warning: dereferencing type-punned > pointer will break strict-aliasing rules > openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_read': > openocd/src/target/dsp5680xx.c:736: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c:737: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': > openocd/src/target/dsp5680xx.c:823: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write': > openocd/src/target/dsp5680xx.c:938: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c:941: warning: cast increases required > alignment of target type > openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_f_wr': > openocd/src/target/dsp5680xx.c:1355: warning: cast increases required > alignment of target type > > > -- > Øyvind Harboe - Can Zylin Consulting help on your project? > US toll free 1-866-980-3434 / International +47 51 87 40 27 > http://www.zylin.com/ > ___ > Openocd-development mailing list > Openocd-development@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/openocd-development > -- Rodrigo. 0001-fix-warnings.patch Description: Binary data 0002-re-enable-dsp5680xx.patch Description: Binary data ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
[Openocd-development] compiler warnings with dsp5680xx.c
dsp5680xx.c generates warnings. Could someone submit a patch to fix this? I'll disable this source file meanwhile. openocd/src/target/dsp5680xx.c: In function 'eonce_rx_upper_data': openocd/src/target/dsp5680xx.c:252: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'eonce_rx_lower_data': openocd/src/target/dsp5680xx.c:268: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'eonce_pc_store': openocd/src/target/dsp5680xx.c:508: warning: dereferencing type-punned pointer will break strict-aliasing rules openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_read': openocd/src/target/dsp5680xx.c:736: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c:737: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': openocd/src/target/dsp5680xx.c:823: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write': openocd/src/target/dsp5680xx.c:938: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c:941: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_f_wr': openocd/src/target/dsp5680xx.c:1355: warning: cast increases required alignment of target type -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development