Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output for dynamicially sized matrices is None #3

Closed
js1972 opened this issue Mar 13, 2017 · 12 comments
Closed

Output for dynamicially sized matrices is None #3

js1972 opened this issue Mar 13, 2017 · 12 comments

Comments

@js1972
Copy link

js1972 commented Mar 13, 2017

I've installed with bash -c "$(curl -fsSL https://raw.githubusercontent.com/tehrengruber/LLDB-Eigen-Data-Formatter/master/tools/install.sh)".

Is there anything else I would need to do to get it to work in CLion IDE on a Mac?
Does lldb look in ~/.lldbinit by default?

This is what I get if ->

(lldb) print this->x_
(Eigen::VectorXd) $4 = None
@tehrengruber
Copy link
Owner

No that should work. What type of matrix did you print?

@js1972
Copy link
Author

js1972 commented Mar 17, 2017

Any of the eigen stuff.... for example:

  #include "Eigen/Dense"
  using Eigen::MatrixXd;

  P_ = MatrixXd(5, 5);
  P_ << 1, 0, 0, 0, 0,
        0, 1, 0, 0, 0,
        0, 0, 1, 0, 0,
        0, 0, 0, 1, 0,
        0, 0, 0, 0, 1;

From the lldb prompt in CLion I enter print P_ and it just responds with "None".

Here is an actual output:
image

Appreciate your help. Thx.

@js1972
Copy link
Author

js1972 commented Mar 20, 2017

image
I should also add that I installed as per the readme and can see the .lldinit file, etc.

@tehrengruber
Copy link
Owner

Indeed the installation of the plugin worked. Therefore you only see None instead of the default output from lldb, because some exception occurs in the plugin. Usually the plugin should fallback to the lldbs default printer in that case, which for whatever reason does not work. I have to check this on an OS X machine the upcoming days, because on my linux machine everything works as expected.

@tehrengruber
Copy link
Owner

Ok so the problem here is that the matrices you are trying to debug are of dynamic size, which this plugin does not support right now. There is however a pull request implementing this: #2 which works, but has some problems.
Since I have a new plugin in development that supports not only viewing, but also editing I'm not going to fix this, but feel free to just switch to the branch of the pull request.

@js1972
Copy link
Author

js1972 commented Mar 22, 2017

Thankyou for that info. I saw the pull request but as I'm a newbie to eigen I didn't even know I was using dynamic matrices all the time. ;-) Looking forward to the update and will test the pull request. Really appreciate your help.

@js1972 js1972 closed this as completed Mar 22, 2017
@tehrengruber tehrengruber changed the title Output from inspecting an Eigen matrix is None Output for dynamicially sized matrices is None Mar 22, 2017
@tehrengruber
Copy link
Owner

Nevermind :-) I will still keep this ticket open because the returning None is not what should happen.

For the matrix/vector you use in the screenshot you should probably use a statically sized type because its way faster for small matrices. This is because many optimizations are only possible, when the size is known at compile time.

@tehrengruber tehrengruber reopened this Mar 22, 2017
@js1972
Copy link
Author

js1972 commented Mar 24, 2017

Excellent. By keeping this open I'll be alerted to updates ;-)
Off-topic but do you notice CLion gives heaps of compiler syntax warnings on Eigen code as well?

@js1972
Copy link
Author

js1972 commented Mar 30, 2017

Update... Tried pull request 2 it it fails everywhere... Will stick to cout for now. ;-)

@chrisdembia
Copy link
Contributor

I would love to use this plugin but I'm having the same issue (I need to use dynamic sizes). Thanks for this useful tool.

@fantaosha
Copy link

This bug might be partially fixed. Please have a look at https://github.com/fantaosha/LLDB-Eigen-Data-Formatter

@tehrengruber
Copy link
Owner

I've added support for dynamically sized matrices today (see 7a07dc1). Feel free to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants