[PATCH v2 4/4] Skip .cold functions in search_minsyms_for_name

Bernd Edlinger bernd.edlinger@hotmail.de
Sun May 30 13:59:03 GMT 2021


When a function with the same name is also available,
that is preferred.

The .cold function is not the external interface.

Fixes 77f2120b200 ("Don't drop static function bp locations w/o debug info")

The motivation for this patch is that I became aware that the "real"
get_alias_set function (in gcc's cc1) had a two-PC breakpoint
location with gdb-9 but a three-PC breakpoint location with gdb-10.
The third breakpoint location was not an entry point but somewhere in the
error handling, which is named "get_alias_set.cold".

Bisection pointed to the above commit.  Prior to this commit the
static "get_alias_set.cold" was ignored, since there is also a global
get_alias_set function.  Basically the previous behavior was to ignore
any static function, when there is a global function with the same name.
The current behavior is to consider a static function and a global
function with the same name as different entities.

But a function named with ".cold" is not a real function at all.
It is just a wrapper for all the cold code paths in that function.
Therefore this patch checks if a function with the same name is
found and skip the ".cold" overload in that case.

gdb:
2020-11-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* linespec.c (search_minsyms_for_name): Filter .cold functions when
	a real function with the same name is found.

gdb/testsuite:
2020-11-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gdb.cp/step-and-next-inline-1.exp: New test.

Thanks,
Bernd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Skip-.cold-functions-in-search_minsyms_for_name.patch
Type: text/x-patch
Size: 4416 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20210530/8610994e/attachment.bin>


More information about the Gdb-patches mailing list