* valops.c (value_struct_elt): Clarify error message.
gdb/testsuite/
2005-12-07  Christophe Lyon  <christophe.lyon@st.com>
	* gdb.cp/printmethod.cc (main): Call virt and nonvirt, to force
	code generation for these functions.
	* gdb.cp/printmethod.exp: Expect "&A::nonvirt()" instead of an
	error message.
This commit is contained in:
Daniel Jacobowitz 2005-12-07 23:07:54 +00:00
parent 7b6792f929
commit 55b3918466
5 changed files with 17 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2005-12-07 Daniel Jacobowitz <dan@codesourcery.com>
* valops.c (value_struct_elt): Clarify error message.
2005-12-07 Jim Blandy <jimb@redhat.com>
* target.c (target_xfer_memory_partial): Doc fix.

View file

@ -1,3 +1,10 @@
2005-12-07 Christophe Lyon <christophe.lyon@st.com>
* gdb.cp/printmethod.cc (main): Call virt and nonvirt, to force
code generation for these functions.
* gdb.cp/printmethod.exp: Expect "&A::nonvirt()" instead of an
error message.
2005-12-02 Andrew Stubbs <andrew.stubbs@st.com>
* gdb.base/help.exp (help b, help br, help bre, help brea)

View file

@ -1,6 +1,6 @@
/* This test script is part of GDB, the GNU debugger.
Copyright 2002, 2004,
Copyright 2002, 2004, 2005
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@ -29,6 +29,8 @@ public:
int main()
{
A *theA = new A;
theA->virt ();
theA->nonvirt ();
return 0; // breakpoint: constructs-done
}

View file

@ -1,4 +1,4 @@
# Copyright 2002, 2003 Free Software Foundation, Inc.
# Copyright 2002, 2003, 2005 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
@ -63,7 +63,7 @@ gdb_continue_to_breakpoint "end of constructors"
# The first of these is for PR gdb/653.
gdb_test "print theA->virt" "\\$\[0-9\]* = &A::virt\\((void|)\\)" "print virtual method."
gdb_test "print theA->nonvirt" "Cannot take address of a method" "print nonvirtual method."
gdb_test "print theA->nonvirt" "\\$\[0-9\]* = &A::nonvirt\\((void|)\\)" "print nonvirtual method."
gdb_exit
return 0

View file

@ -1587,7 +1587,7 @@ value_struct_elt (struct value **argp, struct value **args,
v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
if (v == (struct value *) - 1)
error (_("Cannot take address of a method"));
error (_("Cannot take address of method %s."), name);
else if (v == 0)
{
if (TYPE_NFN_FIELDS (t))