Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb backtrace frames with and without address

Tags:

gdb

When I do gdb bt - I see some frames start with address and some not - why some functions don't start with the address

#6  0x000000000041fd1d in func (argc=0, argv=0x8723a0, t=<value optimized out>) at file1.c:55
#7  record (argc=0, argv=0x8723a0, x=<value optimized out>) at file3.c:11
like image 793
Shraddha Avatar asked Aug 30 '26 08:08

Shraddha


1 Answers

I believe record() is inlined and is part of another function which is an upper frame and func() is not inlined. I guess it is gdb that chooses to show inlined functions in this way if it has symbol information. I use gdb 7.0. It seems that earlier versions of gdb does not show inlined functions in this way.

Look, I have more or less the same situation with bt:

Thread 1 (Thread 1405):
#0  0x00002ac752a93d17 in allocate (this=0x3716b1e0, __in_chrg=<value optimized out>) at /import/home/bc_prod1/bc/data/daily/PROF_HAS_LIBS_005.00/18.05.2012_15_19_04/i686-redhat-linux_5.0_-64/src/build/xalanc-1.11/xml-xalan/c/src/xalanc/Include/XalanList.hpp:537
#1  getListHead (this=0x3716b1e0, __in_chrg=<value optimized out>) at /import/home/bc_prod1/bc/data/daily/PROF_HAS_LIBS_005.00/18.05.2012_15_19_04/i686-redhat-linux_5.0_-64/src/build/xalanc-1.11/xml-xalan/c/src/xalanc/Include/XalanList.hpp:517
#2  end (this=0x3716b1e0, __in_chrg=<value optimized out>) at /import/home/bc_prod1/bc/data/daily/PROF_HAS_LIBS_005.00/18.05.2012_15_19_04/i686-redhat-linux_5.0_-64/src/build/xalanc-1.11/xml-xalan/c/src/xalanc/Include/XalanList.hpp:282
#3  xalanc_1_11::ICUBridgeCollationCompareFunctorImpl::~ICUBridgeCollationCompareFunctorImpl (this=0x3716b1e0, __in_chrg=<value optimized out>) at /import/home/bc_prod1/bc/data/daily/PROF_HAS_LIBS_005.00/18.05.2012_15_19_04/i686-redhat-linux_5.0_-64/src/build/xalanc-1.11/xml-xalan/c/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctorImpl.cpp:144

My explantion is that in my situation getListHead() from frame 1, end() from the frame 2 were inlined and that is why they are shown without own address. They are actually part of frame 3 function ICUBridgeCollationCompareFunctorImpl::~ICUBridgeCollationCompareFunctorImpl() which actually was not inlined and has its address.

By the way when I do disass for frame 1, frame 2 and frame 3 I have got the same output.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!