* How to improve debuggability of inlined function?
@ 2014-10-30 9:29 Terry Guo
0 siblings, 0 replies; only message in thread
From: Terry Guo @ 2014-10-30 9:29 UTC (permalink / raw)
To: gcc-help
Hi there,
When setting breakpoint under gdb for source line that contains an
inlined function call, I often run into below error:
(gdb) b g.c:18
No line 18 in file "g.c".
Make breakpoint pending on future shared library load? (y or [n])
Can such issue be fixed by generating more suitable dwarf information?
If so, could somebody please shed some light on this? I know something
about gcc/dwarf/gdb and I am willing to improve this debug experience.
Thanks in advance for any help.
BR,
Terry
PS:
My test case is:
terguo01@terry-pc01:case$ cat -n g.c
1 volatile int x;
2
3 static inline void NVIC_EnableIRQ(int IRQn)
4 {
5 volatile int y;
6 y = IRQn;
7 }
8
9 __attribute__( ( always_inline ) ) static inline void __WFI(void)
10 {
11 __asm volatile ("nop");
12 }
13
14 int main(void) {
15
16 x= 42;
17
18 NVIC_EnableIRQ(16); //the call will be inlined
19 NVIC_EnableIRQ(18); //the call will be inlined
20
21 while (1)
22 {
23 __WFI();
24 }
25
26 return 0 ;
27 }
28
The case is compiled with command "../x86/install/bin/gcc -g -O2 -c g.c".
I am using pretty recent gcc and gdb trunk.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-30 9:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 9:29 How to improve debuggability of inlined function? Terry Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).