Discussion:
[Bug python/23936] New: python: cast of typedef loses address
orgads at gmail dot com
2018-11-29 17:47:39 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23936

Bug ID: 23936
Summary: python: cast of typedef loses address
Product: gdb
Version: 8.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: orgads at gmail dot com
Target Milestone: ---

cat > test.c <<-EOF
typedef int Int;
int main()
{
Int var = 42;
return 0;
}
EOF

gcc -g -o test test.c

cat > cast-no-addr.py <<-EOF
#!/usr/bin/env python

gdb.Breakpoint('5')
gdb.execute('run')
value = gdb.selected_frame().read_var('var')
targetType = value.type.strip_typedefs()
casted = value.cast(targetType)
print('%x' % value.address)
print('%x' % casted.address)
EOF

gdb -batch -x cast-no-addr.py test

# Output:
#7fffffffde5c
#Traceback (most recent call last):
# File "cast-no-addr.py", line 9, in <module>
# print('%x' % casted.address)
#TypeError: %x format: an integer is required, not NoneType
--
You are receiving this mail because:
You are on the CC list for the bug.
orgads at gmail dot com
2018-11-29 17:55:45 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23936

Orgad Shaneh <orgads at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |orgads at gmail dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...