-
Notifications
You must be signed in to change notification settings - Fork 578
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
Trouble inspecting Teuchos::SerialDenseMatrix in gdb #1817
Comments
My personal experience with GDB is that I have not been able to use 'print any_cxx_func()` for an C++ function for many years (perhaps ever). All that I have been able to to do is print raw data. So to get the size, you will need to print the difference of the two pointers into a Teuchos::RCP, for example. Does you GDB allow you to print any C++ function? My advice is to use a debugger that works, like TotalView or just use trusty 'std::ostream' statements in C++ code. Or just get used to debugging raw code and printing raw data. But for debugging matrices, I would just print them out in C++ and avoid the debugger until I had to use it for some reason. Have other Teuchos or Trilinos developers had a different experience with GDB than what I described above? |
Use DDT or if you like debuggers that crash, TotalView. Chasing pointers is much easier in TotalView, so the crash rate may be tolerable.
Chris Luchini
…________________________________
From: Roscoe A. Bartlett <[email protected]>
Sent: Wednesday, October 4, 2017 17:49
To: trilinos/Trilinos
Cc: Subscribed
Subject: [EXTERNAL] Re: [trilinos/Trilinos] Trouble inspecting Teuchos::SerialDenseMatrix in gdb (#1817)
@jeff788<https://github.com/jeff788>,
My personal experience with GDB is that I have not been able to use 'print any_cxx_func()` for an C++ function for many years (perhaps ever). All that I have been able to to do is print raw data. So to get the size, you will need to print the difference of the two pointers into a Teuchos::RCP, for example. Does you GDB allow you to print any C++ function?
My advice is to use a debugger that works, like TotalView or just use trusty 'std::ostream' statements in C++ code. Or just get used to debugging raw code and printing raw data. But for debugging matrices, I would just print them out in C++ and avoid the debugger until I had to use it for some reason.
Have other Teuchos or Trilinos developers had a different experience with GDB than what I described above?
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#1817 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AI6-Wn_KEpKsk3Ly4iGRGKdqeeQieKKJks5spBmAgaJpZM4PuTRK>.
|
I usually use gdb for pretty simple things, and have for a long time, so I guess I didn't realize how far behind these other debuggers it is. I guess I'll get myself on the learning curve. Thanks for the quick responses! |
@jeff788, okay to close this GitHub Issue? |
Yes, thanks for your time. |
@trilinos/teuchos
@bartlettroscoe
Is there a good way to inspect a Teuchos::SerialDenseMatrix in gdb? I'm having an issue with an LU factorization with LAPACK on a 6x6 SerialDenseMatrix "A", and I'm trying to diagnose the problem by inspecting the input matrix. When I try to inspect any elements of the matrix this is what happens:
(gdb) p A
$30 = {Teuchos::CompObject = {
vptr.CompObject = 0x7ffff756e708 <vtable for Teuchos::SerialDenseMatrix<int, double>+16>,
flopCounter = 0x0}, Teuchos::Object = {
vptr.Object = 0x7ffff756e730 <vtable for Teuchos::SerialDenseMatrix<int, double>+56>,
static tracebackMode = -1, label = ""}, <Teuchos::BLAS<int, double>> = {
vptr.BLAS = 0x7ffff756e770 <vtable for Teuchos::SerialDenseMatrix<int, double>+120>},
numRows = 6, numCols_ = 6, stride_ = 6, valuesCopied_ = true, values_ = 0x81fa9d70}
(gdb) p A(0,0)
Invalid data type for function to be called.
(gdb) p A.values()
./mesh_transfer.sh: line 2: 1692 Segmentation fault gdb /home/burg137/Projects/FY2018/NRAP/E4D/e4d_tools/MeshTransfer/bin/dream2tetgen
I also get a Segmentation fault if I try to print out the size of an ArrayRCP with ArrayRCP::size(), while I can inspect individual elements in the ArrayRCP with the [] accessor.
Thanks,
Jeff
The text was updated successfully, but these errors were encountered: