Andrew Burgess d038ce48f1 gdb: fix invalid arg coercion when calling static member functions
In this commit:

  commit 7022349d5c86bae74b49225515f42d2e221bd368
  Date:   Mon Sep 4 20:21:13 2017 +0100

      Stop assuming no-debug-info functions return int

A new if case was added to call_function_by_hand_dummy to decide if a
function should be considered prototyped or not.  Previously the code
was structured like this:

  if (COND_1)
    ACTION_1
  else if (COND_2)
    ACTION_2
  else
    ACTION_3

With the new block the code now looks like this:

  if (COND_1)
    ACTION_1
  if (NEW_COND)
    NEW_ACTION
  else if (COND_2)
    ACTION_2
  else
    ACTION_3

Notice the new block was added as and 'if' not 'else if'.  I'm running
into a case where GDB executes ACTION_1 and then ACTION_2.  Prior to
the above commit GDB would only have executed ACTION_1.

The actions in the code in question are trying to figure out if a
function should be considered prototyped or not.  When a function is
not prototyped some arguments will be coerced, e.g. floats to doubles.

The COND_1 / ACTION_1 are a very broad, any member function should be
considered prototyped, however, after the above patch GDB is now
executing the later ACTION_2 which checks to see if the function's
type has the 'prototyped' flag set - this is not the case for the
member functions I'm testing, and so GDB treats the function as
unprototyped and casts the float argument to a double.

I believe that adding the new check as 'if' rather than 'else if' was
a mistake, and so in this commit I add in the missing 'else'.

gdb/ChangeLog:

	* infcall.c (call_function_by_hand_dummy): Add missing 'else' when
	setting prototyped flag.

gdb/testsuite/ChangeLog:

	* gdb.cp/method-call-in-c.cc (struct foo_type): Add static member
	function static_method.
	(global_var): New global.
	(main): Use new static_method to ensure it is compiled in.
	* gdb.cp/method-call-in-c.exp: Test calls to static member
	function.
2021-06-25 20:43:07 +01:00
2021-06-25 00:00:11 +00:00
2020-09-25 10:24:44 -04:00
2021-03-19 13:55:35 -07:00
2021-05-09 12:28:32 +09:30
2021-05-07 11:17:11 +01:00
2021-05-29 11:56:43 -04:00
2021-05-29 11:56:43 -04:00
2021-05-29 11:56:43 -04:00
2021-05-18 17:47:27 -04:00
2021-05-18 17:47:27 -04:00
2021-01-12 18:19:20 -05:00

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.
Description
Unofficial mirror of sourceware binutils-gdb repository. Updated daily.
Readme 780 MiB
Languages
C 51.8%
Makefile 22.4%
Assembly 12.3%
C++ 6%
Roff 1.4%
Other 5.4%