Bug 13380 - value.cast(value.type.strip_typedefs()) does not work for array typedefs
Summary: value.cast(value.type.strip_typedefs()) does not work for array typedefs
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 17:28 UTC by Andre'
Modified: 2011-11-03 18:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre' 2011-11-03 17:28:22 UTC
Given

  typedef char Foo[20];  
  Foo foo = "foo";

and

  value = gdb.parse_and_eval("foo")
  value.cast(value.type.strip_typedefs())

I get a

  "RuntimeError: Invalid cast."


I would have expected a value with type char[20]
Comment 1 Andre' 2011-11-03 18:12:59 UTC
As workaround:

  python print gdb.parse_and_eval("{%s}%s" % (f.type.strip_typedefs(), 

produces the expected

  ~"\"foo\", '\\000' <repeats 16 times>\n"