How to track fileds of metadata with p4dbg?

I’m confused that it didn’t work when I tried to set a watch point on a filed of metadata. My input and output are as follows. udp_Rp is one of fileds in metadata.

P4DBG: w udp_Rp 
Error: Unknow field name 'udp_Rp'

How do I fix it?

if it’s a field of metadata, I think you should use the syntax:

w meta.udp_Rp 

Thank you. But I tried this and it still showed the same error as before.

This answer may not be of interest to you, and if so, my apologies, and hopefully someone else can help you in your use of p4dbg. I personally have not used p4dbg, so have no knowledge about it with which to answer your direct question.

I would recommend that you consider the option of using the bmv2 switch logs for debugging your P4 program. It is not an interactive debugger, I know, but it can give you a wealth of information about the behavior of your P4 programs. In particular, you should be able to search through those logs for the string “udp_Rp” to find all occurrences of assignments to it, and see when they happened relative to other statements in your P4 program.

1 Like

The bmv2 switch log is helpful, like you said. I’ve already develop my programs with those logs since I used p4 language. I’m exploring a new way that can actually make the development more effective, and that’s why I raised this question. Anyway, thanks for your answer. It means a lot.