aboutsummaryrefslogtreecommitdiff
path: root/gprof/README
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-06-08 16:56:11 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-06-08 16:56:11 +0000
commitb5916bbd42f792ef2ee9ecd70dce940bce23ef60 (patch)
treea19d513cba335a618a3ee679ba61739a3f6d4137 /gprof/README
parent11eef9ed35b52f3e2647551120d8a0d16a5fbf15 (diff)
downloadgdb-b5916bbd42f792ef2ee9ecd70dce940bce23ef60.zip
gdb-b5916bbd42f792ef2ee9ecd70dce940bce23ef60.tar.gz
gdb-b5916bbd42f792ef2ee9ecd70dce940bce23ef60.tar.bz2
py-inferior.exp: Make sure local var is allocated on the stack.
The testcase, at some point, is trying to change the contents of a string that was defined as follow: char *str = "hello, testsuite"; The problem is that the string is constant, and str is never used to change the contents of the string in the program, so the compiler is free to allocate it in a read-only section. This is what happens on x86-windows, for instance. As a result, trying to change the contents of the string during the `python gdb.inferiors()[0].write_memory (addr, str)' results in the following error: (gdb) python gdb.inferiors()[0].write_memory (addr, str) gdb: write target memory, 5 bytes at 0x00403064 Traceback (most recent call last): File "<string>", line 1, in <module> gdb.MemoryError: Cannot access memory at address 0x403064 Error while executing Python code. This patch prevents this from happening by declaring str as an array rather than a pointer. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.c (f2): Make str an array rather than a pointer. * gdb.python/py-inferior.exp: Adjust testcase accordingly.
Diffstat (limited to 'gprof/README')
0 files changed, 0 insertions, 0 deletions