diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2013-11-11 19:49:45 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2013-11-11 19:49:45 +0000 |
commit | bc79de95db1005e1cefc18729eca9e9d5f771c91 (patch) | |
tree | 0c20455a1659da6d02e8f03df6123ec8278c208e /gdb/testsuite/gdb.python/py-linetable.c | |
parent | 67dc82bc511e35ef134952014b4deb2fdcf10676 (diff) | |
download | binutils-bc79de95db1005e1cefc18729eca9e9d5f771c91.zip binutils-bc79de95db1005e1cefc18729eca9e9d5f771c91.tar.gz binutils-bc79de95db1005e1cefc18729eca9e9d5f771c91.tar.bz2 |
2013-11-11 Phil Muldoon <pmuldoon@redhat.com>
PR python/15629
* NEWS: Add linetable feature.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-linetable entries.
* python/py-linetable.c: New file.
* python/py-symtab.c (stpy_get_linetable): New function.
* python/python-internal.h (symtab_to_linetable_object): Declare.
(gdbpy_initialize_linetable): Ditto.
* python/python.c (_initialize_python): Call
gdbpy_initialize_linetable.
2013-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-linetable.S: New file.
* gdb.python/py-linetable.c: New file.
* gdb.python/py-linetable.exp: New file.
2013-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Symbol Tables In Python): Add linetable method entry.
(Line Tables In Python): New node.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-linetable.c')
-rw-r--r-- | gdb/testsuite/gdb.python/py-linetable.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-linetable.c b/gdb/testsuite/gdb.python/py-linetable.c new file mode 100644 index 0000000..b358fff --- /dev/null +++ b/gdb/testsuite/gdb.python/py-linetable.c @@ -0,0 +1,46 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2013 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +int +foo (int a, int b) +{ + if (a == b) + return 1; + + return 0; +} + +bar (int a, int b) +{ + if (a + b == a) + return 1; + + return 0; +} + +int +main (void) +{ + int i; + if (foo (5,5) && bar (5,0)) + return 0; + + for (i = 0; + i<500; + i++); + return 0; +} |