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

printing blitz arrays via GDB #164

Open
kishore1947 opened this issue May 10, 2020 · 3 comments
Open

printing blitz arrays via GDB #164

kishore1947 opened this issue May 10, 2020 · 3 comments

Comments

@kishore1947
Copy link

We would like your inputs on a couple of queries related to blitz usage.
It is very useful that Blitz supports printing any multidimensional arrays with a very simple statement as below
std::cout<<blitz_array_name<<std::endl

We are working on a large codebase, and we would like to print the array contents during the debug sessions as well.
We use GDB for debugging. We tried an option as below

a) overloaded functions for different type of arrays which we like to print, as below

void printBlitz(blitz::Array<bool, 1> &in)
{
std::cout<<in<<std::endl;
}

void printBlitz(blitz::Array<int, 1> &in)
{
std::cout<<in<<std::endl;
}

and so on
on the gdb debugger, we can simply call this function as below

(gdb) call printBlitz(blitz_array_name)

The issue now is we use many types of multi-dimensional arrays (including complex), we have to make overloads for every possible array

If you have any suggestions to directly print the blitz contents via GDB, please let us know.

This will simplify our debug to a large extent.
Any suggestion is highly appreciated

Thank you so much in advance !!

@citibeth
Copy link
Contributor

citibeth commented May 10, 2020 via email

@kishore1947
Copy link
Author

kishore1947 commented May 10, 2020 via email

@slayoo
Copy link
Member

slayoo commented May 10, 2020

Perhaps some points from this discussion might be relevant: #43

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

3 participants