https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96780

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #11)
> I'm surprised that adding the "artificial" attribute didn't work; I thought
> the main point of that attribute was to automatically skip the function in
> the debugger/profiler.  I guess that never got implemented in gdb?

It seems to work with optimization, but not at -O0:

$ gdb -q -ex start -ex step -ex step -ex cont -ex q a.out
Reading symbols from a.out...
Temporary breakpoint 1 at 0x40110e: file move.C, line 16.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at move.C:16
16        int i = 0;
17        return std::move(i);
std::move<int&> (__t=@0x7fffffffd77c: 0) at move.C:11
11          { return static_cast<typename
std::remove_reference<_Tp>::type&&>(__t); }
Continuing.
[Inferior 1 (process 1629725) exited normally]

I think I must have only tested -O0 last time.


> But these functions aren't really artificial, just tiny, so using that
> attribute seems wrong.

I think there's a case to be made for things like std::__addressof and
std::__is_constant_evaluated being "artificial" because they are just wrappers
around a built-in, and purely impl details. But I agree that std::move and
std::forward are not "artificial" in the sense of the DW_AT_artificial tag:
https://dwarfstd.org/doc/DWARF5.pdf#page=65

Reply via email to