Attilah
Attilah

Reputation: 17932

GDB : print contents of vector

I'm using gcc 4.8.2 and gdb 7.7.1. I am stepping through a C++ program and I want to print the contents of a vector. I've tried applying the solution mentionned here : https://stackoverflow.com/a/253101/91607

But I end up getting an error : "Cannot evaluate function -- may be inlined"

How do I resolve this ? it's a pain...

I'm trying to step through this bitcoin function('signrawtransaction') : https://github.com/bitcoin/bitcoin/blob/master/src/rpcrawtransaction.cpp#L487

Upvotes: 1

Views: 1316

Answers (1)

Mustafa
Mustafa

Reputation: 1854

I am guessing you have tried to use vector::size in your gdb command and that function could have been inlined. Try to use a fixed size instead just to check if it solves your problem.

Or use -fno-default-inline and -fno-inline g++ flags to disable inlining and test again.

P.S. I am just guessing. It is difficult to be of more help without actually looking at your gdb command and the code itself.

Upvotes: 1

Related Questions