Hi,
I am using libvorbis-1.0.1 and I am trying to debug the example decoder
(examples/decoder_example.c) using gdb. I have compiled the source tree
for debug and can single step through the program.
However i am facing the following problem (which I think is more of C
than vorbis)
1. after single steppig I finally arrive at the function shown below
(in file lib/info.c)
static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
196 codec_setup_info *ci=vi->codec_setup;
197 if(!ci)return(OV_EFAULT);
198
199 vi->version=oggpack_read(opb,32);
200 if(vi->version!=0)return(OV_EVERSION);
201
202 vi->channels=oggpack_read(opb,8);
203 vi->rate=oggpack_read(opb,32);
204
205 vi->bitrate_upper=oggpack_read(opb,32);
206 vi->bitrate_nominal=oggpack_read(opb,32);
207 vi->bitrate_lower=oggpack_read(opb,32);
208
209 ci->blocksizes[0]=1<<oggpack_read(opb,4);
210 ci->blocksizes[1]=1<<oggpack_read(opb,4);
211
212 if(vi->rate<1)goto err_out;
213 if(vi->channels<1)goto err_out;
214 if(ci->blocksizes[0]<8)goto err_out;
215 if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
216
217 if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
218
219 return(0);
220 err_out:
221 vorbis_info_clear(vi);
222 return(OV_EBADHEADER);
223 }
after single stepping till line 208, i am able to print vi->channels,
version, bitrates etc.
However i am NOT able to print the value of ci->blocksizes[0], [1].
I tried all combinations as listed below
gdb) print ci->blocksizes[1]
No symbol "ci" in current context.
(gdb) print vi->blocksizes[1]
There is no member named blocksizes.
(gdb) print (codec_setup_info)vi->codec_setup.blocksizes[1]
Attempt to dereference a generic pointer.
(gdb) print (codec_setup_info)vi->codec_setup->blocksizes[1]
Attempt to dereference a generic pointer.
Any idea how to access this variable.
Thanks in advance,
Shasnk