GDB test for a clang/llvm feature

Sriraman Tallam tmsriram@google.com
Thu Dec 31 03:01:16 GMT 2020


Hi Simon,

On Tue, Dec 8, 2020 at 7:49 AM Simon Marchi <simon.marchi@polymtl.ca> wrote:

> On 2020-12-07 11:14 p.m., Sriraman Tallam via Gdb-patches wrote:
> > Hi All,
> >
> >     We recently added a feature in clang to split functions into its hot
> > and cold parts based on profile information:
> > https://lists.llvm.org/pipermail/llvm-dev/2020-August/144012.html
> >
> >     This feature splits the cold part and can lay it out in a region of
> the
> > address space that is not adjacent to the original function.  We would
> like
> > to make sure binaries built with this feature are also tested with gdb.
> >
> >    I have added a simple test case to gdb to test this functionality.  Is
> > this alright? The function splitting feature can be ported to GCC at some
> > point in the future and is not tied to a specific compiler.
> >
> > Thoughts?
> >
> > Thanks
> > Sri
>
> Hi Sri,
>
> Just wondering, gcc also splits some functions in normal and cold paths.
> There
> were a number of fixes for this already, and tests written for that.  Can
> you
> check the history of this file?
>
>
> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp;h=504b4049c2f2c0590a98c78bf3286fb3ca8be74c;hb=HEAD
>
> Does the clang output differ significantly from gcc's?
>

Thanks for the pointer.  I checked -freorder-blocks-and-partition with what
LLVM does to split functions and it is pretty much similar in that we also
use DW_AT_ranges with DW_TAG_subprogram to generate the range  information
for the function.  So I guess I will pass on this for now.

Thanks
Sri


>
> Simon
>


More information about the Gdb-patches mailing list