How to debug Proxmox Perl code

EuroDomenii

Renowned Member
Sep 30, 2016
145
36
68
Slatina
www.domenii.eu
Since I am coming from php world ( Xdebug remote with ssh tunneling via PhpStorm), it would be best to ask via example.

I want to debug btrfs snapshot rollback feature.

-Setup a breakpoint in function volume_snapshot_rollback from PVE/Storage/BTRFSPlugin.pm
https://www.mail-archive.com/pve-devel@pve.proxmox.com/msg18777.html

-Click in Proxmox GUI the RollBack button

-Step in into the function volume_snapshot_rollback ( on remote debug client), run it step by step, watching the values and so on.

Thanks!
 
Last edited:
well, you can just edit the code? whatever you print in the perl code is usually printed to stdout as well, when run from the command line (e.g., "qm rollback VMID SNAPSHOT"). Data::Dumper is a handy tool for dumping bigger data structures for printing. I don't think you will need more, but if you really want to set breakpoints, you can also use perl's "-d" flag and call the CLI tools with that?
 
  • Like
Reactions: EuroDomenii