This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/11391] New: gdb.Value does not support truth testing


I wish to demand load from a target in a common class. Given RTEMS is embedded
the targets are often remote so loading only when the data is needed makes
sense. If I code in Python:

 class my_class:

     id_encoding = ('target_var1', 'target_var2')

     def __init__(self, id):
         self.id = id
         self.data_var = None

     def data(self):
         if not self.data_var:
             self.data_var = gdb.parse_and_eval(self.is_encoding[self.id])
         return self.data_var

On the second call to 'data' the following error is reported:

TypeError: Attempted truth testing on invalid gdb.Value type.

I think gdb.Value supporting this feature would be useful.

-- 
           Summary: gdb.Value does not support truth testing
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: chrisj at rtems dot org
                CC: gdb-prs at sourceware dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]