Bug 16213 - -var-update still keeps "var1.<error at 0>"
Summary: -var-update still keeps "var1.<error at 0>"
Status: RESOLVED WORKSFORME
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 18:25 UTC by Jan Kratochvil
Modified: 2017-07-29 20:36 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Last reconfirmed:


Attachments
eclipse-cdt-8.2.1-3.fc19.x86_64 screenshot (122.02 KB, image/png)
2013-11-24 18:26 UTC, Jan Kratochvil
Details
Eclipse GDB MI input (629 bytes, text/plain)
2013-11-24 18:27 UTC, Jan Kratochvil
Details
Eclipse GDB MI output (1.72 KB, text/plain)
2013-11-24 18:27 UTC, Jan Kratochvil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2013-11-24 18:25:23 UTC
Eclipse fails to print local std::set variable.  I believe it is a GDB MI bug.

FAIL: gdb-7.6.1-46.fc19.x86_64
FAIL: GNU gdb (GDB) 7.6.50.20131124-cvs

Why GDB still insists on "var1.<error at 0>" even after -var-update?
Removing earlier
  32-var-list-children var1
fixes the problem, it then prints:
  99^done,numchild="1",children=[child={name="var1.[0]",exp="[0]",numchild="1",type="C",thread-id="1"}],has_more="0"

------------------------------------------------------------------------------
#include <set>
class C {
public:
  int i;
  C(int *ip):i(*ip) {}
};
namespace std {
  template<> bool less<C>::operator()(const C &a,const C &b) const { return a.i<b.i; }
}
int main() {
  int i=1;
  std::set<C> xxxvariable;
  xxxvariable.insert(C(&i));
  return 0;
}
------------------------------------------------------------------------------
gdb -i=mi <cmd
------------------------------------------------------------------------------
5-enable-pretty-printing
15-file-exec-and-symbols ./cxx
18-break-insert -t -f main
20-exec-run
31-var-create --thread 1 --frame 0 - * xxxvariable
32-var-list-children var1
33-break-insert -t -f cxx.cpp:14
34-exec-continue
38-var-update var1
99-var-list-children var1
------------------------------------------------------------------------------
38^done,changelist=[]
99^done,numchild="1",children=[child={name="var1.<error at 0>",exp="<error at 0>",numchild="36",type="char [36]",thread-id="1"}],has_more="0"
Comment 1 Jan Kratochvil 2013-11-24 18:26:17 UTC
Created attachment 7301 [details]
eclipse-cdt-8.2.1-3.fc19.x86_64 screenshot
Comment 2 Jan Kratochvil 2013-11-24 18:27:01 UTC
Created attachment 7302 [details]
Eclipse GDB MI input
Comment 3 Jan Kratochvil 2013-11-24 18:27:24 UTC
Created attachment 7303 [details]
Eclipse GDB MI output
Comment 4 Jan Kratochvil 2017-07-29 20:36:19 UTC
Seems to be fixed with:
eclipse-cdt-9.2.1-2.fc25.x86_64
gdb-7.12.1-48.fc25.x86_64