This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257851 - gdb shows wrong next line when stepping into in Quote sample on Ubuntu
Summary: gdb shows wrong next line when stepping into in Quote sample on Ubuntu
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 18:29 UTC by Alexander Pepin
Modified: 2017-04-10 11:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (160.12 KB, image/png)
2016-02-04 18:29 UTC, Alexander Pepin
Details
gdb log (64.05 KB, text/plain)
2016-02-04 18:31 UTC, Alexander Pepin
Details
screenshot2 (151.20 KB, image/png)
2016-02-04 18:41 UTC, Alexander Pepin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2016-02-04 18:29:55 UTC
Created attachment 158378 [details]
screenshot

Steps to reproduce:
- create Quote sample project and build it using default GNU tool collection
- set a breakpoint in line 133 (discount = getDiscountFor(customerName);)
- start debugger
- enter any string as a customer name e.g. "aaa", debugger stops at the breakpoint
- do Step Into
Result: Debugger shows Disassembly of libstdc++ (see attached screenshot and gdb log).
Comment 1 Alexander Pepin 2016-02-04 18:31:44 UTC
Created attachment 158379 [details]
gdb log
Comment 2 Alexander Pepin 2016-02-04 18:37:45 UTC
If while performing 'Step Into' Debugging view was opened then debugger shows quote.cc source with a green cursor placed in the wrong line (see screenshot2).
Comment 3 Alexander Pepin 2016-02-04 18:41:19 UTC
Created attachment 158380 [details]
screenshot2
Comment 4 Alexander Pepin 2016-02-04 18:48:16 UTC
The bug is 100% reproducible on both my Ubuntu desktop and our Ubuntu testing machine.
Comment 5 soldatov 2016-02-04 19:47:42 UTC
GDB log without IDE:
hudson@VBoxUbuntu64:~/NetBeansProjects/Quote_1$ gdb ./dist/Debug/GNU-Linux-x86/quote_1
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/home/hudson/NetBeansProjects/Quote_1/dist/Debug/GNU-Linux-x86/quote_1...done.
(gdb) b 133
Breakpoint 1 at 0x402cb9: file quote.cc, line 133.
(gdb) r
Starting program: /export/home/hudson/NetBeansProjects/Quote_1/dist/Debug/GNU-Linux-x86/quote_1
Support metric quote program

Customer list (5 customer(s)):
--------------------------------------
John has discount 10%
Mike has discount 0%
Peter has discount 13%
Ann has discount 11%
Tom has discount 9%

Enter customer name: aaa

Breakpoint 1, main (argc=1, argv=0x7fffffffea88) at quote.cc:133
133             discount = getDiscountFor(customerName);
(gdb) s
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=0x7fffffffe960, __str="aaa")
    at /build/buildd/gcc-4.7-4.7.2/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:171
171     /build/buildd/gcc-4.7-4.7.2/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc: No such file or directory.
(gdb)
Comment 6 Alexander Pepin 2016-02-05 11:02:01 UTC
It looks like Ubuntu system specific bug (gdb + system libs) and IDE can do nothing with it. The workaround is to skip string copy constructor by performing Step Out followed by Step Into commands.
  So the only remaining issue here is wrong next line if Debugging View is open but it's definitely not P2 and could be fixed in the next release.
Comment 7 Maria Tishkova 2017-04-10 11:48:35 UTC
Works fine on my ubuntu with 82. netbeans (enum/release82)

C Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
C++ Compiler: g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Fortran Compiler: Tool not found
Assembler: GNU assembler (GNU Binutils for Ubuntu) 2.26.1
Make Tool: GNU Make 4.1
Debugger: GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
QMake Tool: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
CMake Tool: Tool not found