Hi Vinay

I am facing the same problem, I am reading protobuf data from a coredump 
and I need to decode it to see what values it has, and I am getting the 
same error ("Failed to parse input."). Did you find out a way out?

Thanks!
Tarun

On Wednesday, 7 August 2013 16:22:58 UTC-7, Vinay Wagh wrote:
>
> Hi, 
>
> I am debugging a core file in gdb and I have the raw encoded data of a 
> message. I want to decode this message to see the values. I tried using 
> --decode_raw with no success. Here is what I am doing
>
> (gdb) p $12->send_ctx_.parts[0]
> $23 = {_ = "0?)\224\002\177", '\000' <repeats 25 times>, "\200"}
> (gdb) p $12->send_ctx_.parts[1]
> $24 = {_ = "\000M0\224\002\177", '\000' <repeats 25 times>, "\200"}
>
> parts is an array of serialized messages. Now I try
>
> vagrant@dev-01:~$ protoc --decode_raw 
> 0?)\224\002\177
> Failed to parse input.
>
> I tried adding that data in a file and tried giving that as input
>
> protoc --decode_raw < ~/data.txt 
> Failed to parse input.
>
> I thought maybe I need to \000 repeated 25 times followed by a \200 so I 
> tried with that as well and still no luck. I then tried to use the decode 
> instead of decode_raw option by specifying the proto path and the proto 
> file and the message name but it still did not work. 
>
> I then tried to encode some data and decode it back to see if it works. I 
> entered the values in text form in a file
> error:OUT_OF_MEMORY,object_id:123,size:4096
>
> these are all valid values. I then ran the --encode option specifying the 
> proto path and file
>
> protoc --proto_path=/path_to_proto_dir /path_to_proto_dir/proto_file.proto 
> --encode=MessageName < ~/proto.txt
> ?{? 
>
> I copied the text as is in to a file and rand --decode on it and it fails 
> with 'Failed to parse input". What am I missing ? How do I use the 
> decode_raw or decode option ? Is there a format the data has to be in for 
> it to be decoded ?
>
> Thanks,
> Vinay
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to