From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18973 invoked by alias); 3 Mar 2009 21:46:58 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 18947 invoked by uid 9674); 3 Mar 2009 21:46:58 -0000 Date: Tue, 03 Mar 2009 21:46:00 -0000 Message-ID: <20090303214658.18932.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-python: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-python X-Git-Refname: refs/heads/archer-jankratochvil-python X-Git-Reftype: branch X-Git-Oldrev: f3ec9b4195a8b4b4de2c513841f469553d9f3b38 X-Git-Newrev: b7d72995b3fb6e6ef1ca3d5cf33269dc523a561f X-SW-Source: 2009-q1/txt/msg00243.txt.bz2 List-Id: The branch, archer-jankratochvil-python has been updated via b7d72995b3fb6e6ef1ca3d5cf33269dc523a561f (commit) via 2c02a8f709f15aa25a10fb47a9e3bd98ff9d9a78 (commit) from f3ec9b4195a8b4b4de2c513841f469553d9f3b38 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit b7d72995b3fb6e6ef1ca3d5cf33269dc523a561f Merge: f3ec9b4195a8b4b4de2c513841f469553d9f3b38 2c02a8f709f15aa25a10fb47a9e3bd98ff9d9a78 Author: Jan Kratochvil Date: Tue Mar 3 22:46:29 2009 +0100 Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-python ----------------------------------------------------------------------- Summary of changes: gdb/doc/gdb.texinfo | 2 +- gdb/python/lib/gdb/command/backtrace.py | 2 +- gdb/python/python-frame.c | 8 ++++---- gdb/testsuite/gdb.python/find.exp | 14 +++++++------- gdb/testsuite/gdb.python/python-frame.exp | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) First 500 lines of diff: diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8e259f8..dc8d2c1 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -19594,7 +19594,7 @@ Return the frame immediately newer (inner) to this frame. Return the frame's symtab and line object. @c (see @xref{Symtab_and_line,, Symtab and line}). @end defmethod -@defmethod Frame read_var_value @var{variable} +@defmethod Frame read_var @var{variable} Return the value of the given variable in this frame. @code{variable} can be either a string or a @code{gdb.Symbol} object. @c (@pxref{Symbols In Python}). @end defmethod diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py index 008e5dd..f07696e 100644 --- a/gdb/python/lib/gdb/command/backtrace.py +++ b/gdb/python/lib/gdb/command/backtrace.py @@ -33,7 +33,7 @@ class FrameWrapper: stream.write (sym.print_name + "=") try: - val = self.frame.read_var_value (sym) + val = self.frame.read_var (sym) if val != None: val = str (val) # FIXME: would be nice to have a more precise exception here. diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c index 1729717..c98dc39 100644 --- a/gdb/python/python-frame.c +++ b/gdb/python/python-frame.c @@ -391,13 +391,13 @@ frapy_find_sal (PyObject *self, PyObject *args) return sal_obj; } -/* Implementation of gdb.Frame.read_var_value (self, variable) -> gdb.Value. +/* Implementation of gdb.Frame.read_var (self, variable) -> gdb.Value. Returns the value of the given variable in this frame. The argument can be either a gdb.Symbol or a string. Returns None if GDB can't find the specified variable. */ static PyObject * -frapy_read_var_value (PyObject *self, PyObject *args) +frapy_read_var (PyObject *self, PyObject *args) { struct frame_info *frame; PyObject *sym_obj; @@ -645,8 +645,8 @@ Return the frame immetidaely newer (inner) to this frame." }, { "find_sal", frapy_find_sal, METH_NOARGS, "find_sal () -> gdb.Symtab_and_line.\n\ Return the frame's symtab and line." }, - { "read_var_value", frapy_read_var_value, METH_VARARGS, - "read_var_value (variable) -> gdb.Value.\n\ + { "read_var", frapy_read_var, METH_VARARGS, + "read_var (variable) -> gdb.Value.\n\ Return the value of the variable in this frame." }, {NULL} /* Sentinel */ }; diff --git a/gdb/testsuite/gdb.python/find.exp b/gdb/testsuite/gdb.python/find.exp index a7dad97..dd9aabc 100644 --- a/gdb/testsuite/gdb.python/find.exp +++ b/gdb/testsuite/gdb.python/find.exp @@ -90,7 +90,7 @@ set two_patterns_found "${newline}.${dec_number}L, ${dec_number}L]" # Test string pattern. gdb_test "set *(int32_t*) &int8_search_buf\[10\] = 0x61616161" "" "" -gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int8_search_buf')" "" "" +gdb_test "py search_buf = gdb.selected_frame ().read_var ('int8_search_buf')" "" "" gdb_test "py start_addr = search_buf.address ()" "" "" gdb_test "py length = search_buf.type ().sizeof ()" "" "" @@ -128,7 +128,7 @@ gdb_test "py print gdb.search_memory (start_addr, length, \['a', 'a'\], max_coun # Test 16-bit pattern. gdb_test "set int16_search_buf\[10\] = 0x1234" "" "" -gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int16_search_buf')" "" "" +gdb_test "py search_buf = gdb.selected_frame ().read_var ('int16_search_buf')" "" "" gdb_test "py start_addr = search_buf.address ()" "" "" gdb_test "py length = search_buf.type ().sizeof ()" "" "" gdb_test "py pattern = gdb.parse_and_eval ('(int16_t) 0x1234')" "" "" @@ -142,7 +142,7 @@ gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \ # Test 32-bit pattern. gdb_test "set int32_search_buf\[10\] = 0x12345678" "" "" -gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int32_search_buf')" "" "" +gdb_test "py search_buf = gdb.selected_frame ().read_var ('int32_search_buf')" "" "" gdb_test "py start_addr = search_buf.address ()" "" "" gdb_test "py length = search_buf.type ().sizeof ()" "" "" gdb_test "py pattern = gdb.parse_and_eval ('(int32_t) 0x12345678')" "" "" @@ -155,7 +155,7 @@ gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \ # Test 64-bit pattern. gdb_test "set int64_search_buf\[10\] = 0xfedcba9876543210LL" "" "" -gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int64_search_buf')" "" "" +gdb_test "py search_buf = gdb.selected_frame ().read_var ('int64_search_buf')" "" "" gdb_test "py start_addr = search_buf.address ()" "" "" gdb_test "py length = search_buf.type ().sizeof ()" "" "" gdb_test "py pattern = gdb.parse_and_eval ('(int64_t) 0xfedcba9876543210LL')" "" "" @@ -170,7 +170,7 @@ gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \ gdb_test "set *(int8_t*) &search_buf\[10\] = 0x62" "" "" gdb_test "set *(int16_t*) &search_buf\[11\] = 0x6363" "" "" gdb_test "set *(int32_t*) &search_buf\[13\] = 0x64646464" "" "" -gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('search_buf')" "" "" +gdb_test "py search_buf = gdb.selected_frame ().read_var ('search_buf')" "" "" gdb_test "py start_addr = search_buf\[0\].address ()" "" "" gdb_test "py pattern1 = gdb.parse_and_eval ('(int8_t) 0x62')" "" "" gdb_test "py pattern2 = gdb.parse_and_eval ('(int16_t) 0x6363')" "" "" @@ -187,8 +187,8 @@ set CHUNK_SIZE 16000 ; gdb_test "set *(int32_t*) &search_buf\[0*${CHUNK_SIZE}+100\] = 0x12345678" "" "" gdb_test "set *(int32_t*) &search_buf\[1*${CHUNK_SIZE}+100\] = 0x12345678" "" "" -gdb_test "py start_addr = gdb.selected_frame ().read_var_value ('search_buf')" "" "" -gdb_test "py length = gdb.selected_frame ().read_var_value ('search_buf_size')" "" "" +gdb_test "py start_addr = gdb.selected_frame ().read_var ('search_buf')" "" "" +gdb_test "py length = gdb.selected_frame ().read_var ('search_buf_size')" "" "" gdb_test "py print gdb.search_memory (start_addr, length, 0x12345678, 4)" \ "${two_patterns_found}" "search spanning large range" diff --git a/gdb/testsuite/gdb.python/python-frame.exp b/gdb/testsuite/gdb.python/python-frame.exp index f62f63d..083fa90 100644 --- a/gdb/testsuite/gdb.python/python-frame.exp +++ b/gdb/testsuite/gdb.python/python-frame.exp @@ -81,10 +81,10 @@ gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc" gdb_test "python print 'result =', f0.addr_in_block ()" " = \[0-9\]+" "test Frame.addr_in_block" gdb_test "python print 'result =', f0.older ().equals (f1)" " = True" "test Frame.older" gdb_test "python print 'result =', f1.newer ().equals (f0)" " = True" "test Frame.newer" -gdb_test "python print 'result =', f0.read_var_value ('b')" \ +gdb_test "python print 'result =', f0.read_var ('b')" \ "ValueError: variable 'b' not found.*Error while executing Python code." \ - "test Frame.read_var_value - error" -gdb_test "python print 'result =', f0.read_var_value ('a')" " = 1" "test Frame.read_var_value - success" + "test Frame.read_var - error" +gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success" gdb_test "python print 'result =', gdb.newest_frame ().equals (f0)" " = True" "test gdb.newest_frame" gdb_test "python print 'result =', gdb.selected_frame ().equals (f1)" " = True" "test gdb.selected_frame" hooks/post-receive -- Repository for Project Archer.