This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3 PR gdb/16959] gdb hangs in infinite recursion


Hi Weimin,

The commit title should state what the patch does/changes, not what the problem
is.  So it could be "Fix infinite recursion when printing static type", or
something like that.

Also, when applying your patch, I get this:

.git/rebase-apply/patch:20: trailing whitespace.
	* cp-valprint.c: (cp_print_static_field) Use check_typedef() to get
.git/rebase-apply/patch:21: trailing whitespace.
	static member's real type for TYPE_CODE_STRUCT and TYPE_CODE_ARRAY
.git/rebase-apply/patch:22: trailing whitespace.
	comparisons.
.git/rebase-apply/patch:112: new blank line at EOF.
+
warning: 4 lines add whitespace errors.


Could you fix those?

> diff --git a/gdb/testsuite/gdb.cp/static-typedef-print.exp b/gdb/testsuite/gdb.cp/static-typedef-print.exp
> new file mode 100644
> index 0000000..e0da0c9
> --- /dev/null
> +++ b/gdb/testsuite/gdb.cp/static-typedef-print.exp
> @@ -0,0 +1,40 @@
> +# Copyright 2018 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/>.
> +
> +if { [skip_cplus_tests] } { continue }
> +
> +standard_testfile .cc
> +
> +if [get_compiler_info "c++"] {
> +    return -1
> +}
> +
> +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
> +    return -1
> +}
> +
> +clean_restart $testfile
> +
> +if ![runto_main] {
> +    untested "could not run to main"
> +    return -1
> +}
> +
> +gdb_test "print a" \
> +         "static INSTANCE = <same as static member of an already seen type>}}.*" \
> +         "print static member"
> +
> +gdb_exit
> +return 0

You can remove these last two lines.

Some boring administrative stuff:

If you plan on submitting more patches, it would be a good idea for you to have
an account on sourceware.org, so that you can push your patches once they are
approved.  If so, you can use the following form to request an account:

  https://sourceware.org/cgi-bin/pdw/ps_form.cgi

You can put me as the person that referred you.

Also, from what I can see, Oracle has a blanket copyright assignment, so you
don't need one specifically for you, is that right?

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]