public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/13380] New: value.cast(value.type.strip_typedefs()) does not work for array typedefs
@ 2011-11-03 17:29 andre.poenitz at nokia dot com
  2011-11-03 18:13 ` [Bug python/13380] " andre.poenitz at nokia dot com
  2023-12-15 17:37 ` ssbssa at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: andre.poenitz at nokia dot com @ 2011-11-03 17:29 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13380

             Bug #: 13380
           Summary: value.cast(value.type.strip_typedefs()) does not work
                    for array typedefs
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: andre.poenitz@nokia.com
    Classification: Unclassified


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]

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug python/13380] value.cast(value.type.strip_typedefs()) does not work for array typedefs
  2011-11-03 17:29 [Bug python/13380] New: value.cast(value.type.strip_typedefs()) does not work for array typedefs andre.poenitz at nokia dot com
@ 2011-11-03 18:13 ` andre.poenitz at nokia dot com
  2023-12-15 17:37 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: andre.poenitz at nokia dot com @ 2011-11-03 18:13 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13380

--- Comment #1 from Andre Poenitz <andre.poenitz at nokia dot com> 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"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug python/13380] value.cast(value.type.strip_typedefs()) does not work for array typedefs
  2011-11-03 17:29 [Bug python/13380] New: value.cast(value.type.strip_typedefs()) does not work for array typedefs andre.poenitz at nokia dot com
  2011-11-03 18:13 ` [Bug python/13380] " andre.poenitz at nokia dot com
@ 2023-12-15 17:37 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-15 17:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13380

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org
   Target Milestone|---                         |11.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
This is fixed since gdb-11.1 with the following commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=30ab35866805d5f1251b7f40578ce985dd18d688

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-15 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03 17:29 [Bug python/13380] New: value.cast(value.type.strip_typedefs()) does not work for array typedefs andre.poenitz at nokia dot com
2011-11-03 18:13 ` [Bug python/13380] " andre.poenitz at nokia dot com
2023-12-15 17:37 ` ssbssa at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).