LLDB-Eigen-Pretty-Printer icon indicating copy to clipboard operation
LLDB-Eigen-Pretty-Printer copied to clipboard

warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_matrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?)

Open bartfer opened this issue 4 years ago • 4 comments

Hi!

When I load this file I get the following warnings(/ rather errors) in lldb (using CLion in windows):

warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_matrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_array_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_quaternion_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_sparsematrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: empty category enabled (typo?)

What am I doing wrong?

I can load https://github.com/timjj22/LLDB-Eigen-Data-Formatter without error but it doesn't really help with prettyprinting for eigen objects, I guess that is why you expanded his solution.

Thanks, Ferenc

bartfer avatar Dec 16 '20 14:12 bartfer

Hi!

When I load this file I get the following warnings(/ rather errors) in lldb (using CLion in windows):

warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_matrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_array_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_quaternion_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_sparsematrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: empty category enabled (typo?)

What am I doing wrong?

I can load https://github.com/timjj22/LLDB-Eigen-Data-Formatter without error but it doesn't really help with prettyprinting for eigen objects, I guess that is why you expanded his solution.

Thanks, Ferenc

Sorry, I haven't tested this formatter in windows? Does it work in windows?

fantaosha avatar Dec 17 '20 08:12 fantaosha

Hi!

When I load this file I get the following warnings(/ rather errors) in lldb (using CLion in windows):

warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_matrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_array_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_quaternion_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: The provided function "LLDB_Eigen_Pretty_Printer.eigen_sparsematrix_print" does not exist - please define it before attempting to use this summary. error: regex format error (maybe this is not really a regex?) warning: empty category enabled (typo?)

What am I doing wrong?

I can load https://github.com/timjj22/LLDB-Eigen-Data-Formatter without error but it doesn't really help with prettyprinting for eigen objects, I guess that is why you expanded his solution.

Thanks, Ferenc

Can you move the function def __lldb_init_module (debugger, dict): in lines 6-20 to the end of this file? I guess this might fix this issue. Please let me know if it works. Thanks!

fantaosha avatar Dec 17 '20 08:12 fantaosha

Thanks for your reply!

Unfortunately this doesn't fix the problem, I get the same errors. But I realized I messed up because the file name didn't match "LLDB_Eigen_Pretty_Printer.py" I had "LLDB_Eigen_Data_Formatter.py". Changing this I don't get the warnings, but I still do get the errors (+a warning): error: regex format error (maybe this is not really a regex?) error: regex format error (maybe this is not really a regex?) error: regex format error (maybe this is not really a regex?) error: regex format error (maybe this is not really a regex?) warning: empty category enabled (typo?)

I've tried a few things and found out that the problem lies with the question mark, so if I delete those I don't get any warning or errors: debugger.HandleCommand("type summary add -x \"^Eigen::Matrix<.*>$\" -F LLDB_Eigen_Pretty_Printer.eigen_matrix_print -p -r -w Eigen") debugger.HandleCommand("type summary add -x \"^Eigen::Array<.*>$\" -F LLDB_Eigen_Pretty_Printer.eigen_array_print -p -r -w Eigen") debugger.HandleCommand("type summary add -x \"^Eigen::Quaternion<.*>$\" -F LLDB_Eigen_Pretty_Printer.eigen_quaternion_print -p -r -w Eigen") debugger.HandleCommand("type summary add -x \"^Eigen::SparseMatrix<.*>$\" -F LLDB_Eigen_Pretty_Printer.eigen_sparsematrix_print -p -r -w Eigen") debugger.HandleCommand("type category enable Eigen")

Now it works. Only thing is that \n doesn't work, but I can see the values. I have 1 question: how should I modify the python file so that the values are printed for these kind of types?: Eigen::PlainObjectBase<Eigen::Matrix<double,-1,-1,0,-1,-1> > The other mentioned github repo tries to deal with this type (debugger.HandleCommand("type summary add -x "Eigen::PlainObjectBase" -F LLDB_Eigen_Data_Formatter.format") but using both at the same time doesn't work.

Thanks for this project though, it's a great help! (I don't know why the official natvis file doesn't work for CLion though but.. that is a different issue)

bartfer avatar Dec 17 '20 09:12 bartfer

I'm having the same issue with

% lldb --version
lldb-1300.0.42.3

and the same solution: .* instead of .*? makes it happy. Do we really need that ?? https://regex101.com/r/Yf488m/1

BenFrantzDale avatar Mar 09 '23 17:03 BenFrantzDale