proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

rework DBGLEVEL management

Open doegox opened this issue 5 years ago • 11 comments

MF_DBGLEVEL can only be set by hf mf dbg N but it's used across many other technos.

  • iso14443b
  • iso15693
  • iclass
  • felica
  • lfops
  • i2c
  • fpgaloader
  • flashmem

We should make the hf mf dbg (and alias hf mfu dbg) a more global command, and make distinction with data setdebugmode

doegox avatar Jun 02 '19 22:06 doegox

yes, hw debug vs client debug

I started using MF_DBG everywhere on the deviceside since it was a mess before. data debug is also a bad name, It should be client debug, not just related to LF data debugging.

iceman1001 avatar Jun 03 '19 08:06 iceman1001

I changed hf mf/mfu dbg to hw dbg. I touched slightly the description of data setdebuglevel. Do we want to move/rename setdebuglevel? If so how/where?

doegox avatar Jun 06 '19 09:06 doegox

that is a good question. we don't have a client command set, I guess thats why its under data.

For consistency I am all for a rename from setdebuglevel -> clientdbg treated in the way we did the transition of list. Keeping old cmds but they redirect to new place.

What is your take?

iceman1001 avatar Jun 06 '19 12:06 iceman1001

I removed entirely hf mf/mfu dbg but we can reintroduce them if you prefer. If we do so, I prefer we print a warning with the new command rather than being a transparent alias, otherwise people will never learn to change their habits.

For setdebuglevel I'm not sure I understood. data setdebuglevel => data clientdbg + keeping data setdebuglevel ?

doegox avatar Jun 06 '19 12:06 doegox

for mf/mfu dbg , nay, time to let ppl understand its different, keep them removed.

data setdebuglevel -> hw clientdbg ...

iceman1001 avatar Jun 06 '19 13:06 iceman1001

how about clientdbg or dbg in root command?

iceman1001 avatar Jun 06 '19 13:06 iceman1001

yeah in root that's what I thought of too. dbg is too confusing with hw dbg inho.

pm3 --> clientdbg ?
pm3 --> verbose ?

doegox avatar Jun 06 '19 13:06 doegox

if Verbose, it could be hooked up to the commands that uses "verbose" or "silent" as parameter :)

iceman1001 avatar Jun 06 '19 16:06 iceman1001

or pm3 --> dbg c pm3 --> dbg d

debug client debug device which can be shortend using the shortner to debug c or de h :)

iceman1001 avatar Jun 06 '19 16:06 iceman1001

Regarding https://github.com/RfidResearchGroup/proxmark3/commit/2cbe43f269e47cb36817d6b42bb2c76014364e53#commitcomment-34659273 ( all dpbrint* commands should be guarded with DBGLEVEL ifs.) I see two options:

  • Add DBGLEVEL test in front of each Dbprintf. Tedious and still a risk to forget the next one.
  • Add a dbglevel parameter to the Dbprintf so it's never forgotten, but this implies the same amount of code changes
  • Add a DBGLEVEL>NONE in Dbprintf itself, so we're sure just setting DBGLEVEL=NONE will disable all Dbprintf.
  • another option?

I'm more in favor of the third one...

doegox avatar Aug 12 '19 20:08 doegox

replace Dbprintf call with a macro, that sets level or not.

iceman1001 avatar Aug 12 '19 20:08 iceman1001