binutils-gdb/gdb/testsuite/gdb.python
Joel Brobecker b5916bbd42 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.
2011-06-08 16:56:11 +00:00
..
Makefile.in 2011-05-16 Pedro Alves <pedro@codesourcery.com> 2011-05-16 13:56:41 +00:00
lib-types.cc
lib-types.exp
py-block.c
py-block.exp 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-breakpoint.c
py-breakpoint.exp 2011-03-14 Phil Muldoon <pmuldoon@redhat.com> 2011-03-14 16:09:55 +00:00
py-cmd.exp 2011-01-10 Phil Muldoon <pmuldoon@redhat.com> 2011-01-10 11:00:24 +00:00
py-error.exp
py-error.py
py-events.c Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
py-events.exp Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
py-events.py Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
py-evthreads.c Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
py-evthreads.exp Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
py-frame-inline.c gdb/ 2011-04-17 14:14:23 +00:00
py-frame-inline.exp gdb/ 2011-04-17 14:14:23 +00:00
py-frame.c
py-frame.exp use prepare_for_testing in gdb.python/py-frame.exp 2011-02-26 14:06:28 +00:00
py-function.exp gdb/ 2011-05-13 04:34:25 +00:00
py-inferior.c py-inferior.exp: Make sure local var is allocated on the stack. 2011-06-08 16:56:11 +00:00
py-inferior.exp py-inferior.exp: Make sure local var is allocated on the stack. 2011-06-08 16:56:11 +00:00
py-infthread.c
py-infthread.exp 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-mi.exp 2011-05-16 Pedro Alves <pedro@codesourcery.com> 2011-05-16 13:56:41 +00:00
py-objfile-script-gdb.py * NEWS: Mention "info auto-load-scripts". 2011-05-13 22:11:47 +00:00
py-objfile-script.c * NEWS: Mention "info auto-load-scripts". 2011-05-13 22:11:47 +00:00
py-objfile-script.exp * NEWS: Mention "info auto-load-scripts". 2011-05-13 22:11:47 +00:00
py-objfile.c 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-objfile.exp 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-parameter.exp 2011-03-10 Phil Muldoon <pmuldoon@redhat.com> 2011-03-10 12:29:08 +00:00
py-pp-maint.c
py-pp-maint.exp
py-pp-maint.py
py-prettyprint.c 2011-04-29 Phil Muldoon <pmuldoon@redhat.com> 2011-04-29 12:45:46 +00:00
py-prettyprint.exp gdb/testsuite/ 2011-04-11 17:40:41 +00:00
py-prettyprint.py gdb/testsuite/ 2011-04-11 17:40:41 +00:00
py-progspace.c
py-progspace.exp
py-section-script.c
py-section-script.exp * NEWS: Mention "info auto-load-scripts". 2011-05-13 22:11:47 +00:00
py-section-script.py
py-shared-sl.c
py-shared.c
py-shared.exp
py-symbol.c
py-symbol.exp 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-symtab.exp 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> 2011-03-17 09:36:17 +00:00
py-template.cc
py-template.exp
py-type.c
py-type.exp
py-value.c
py-value.exp gdb/testsuite/ 2011-04-24 09:04:38 +00:00
python-1.c
python.c
python.exp 2011-03-18 Phil Muldoon <pmuldoon@redhat.com> 2011-03-18 08:44:47 +00:00
source1
source2.py