public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>"
@ 2014-09-11 13:48 marc.dumais at ericsson dot com
  2014-09-11 13:49 ` [Bug server/17373] " marc.dumais at ericsson dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: marc.dumais at ericsson dot com @ 2014-09-11 13:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17373

            Bug ID: 17373
           Summary: fast tracepoints with local variables captured -
                    reported as "<unavailable>"
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: marc.dumais at ericsson dot com

Created attachment 7780
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7780&action=edit
source of test program

Hi,

Capturing the value of local variables using fast tracepoints does not seem to
work, at least in my test program (neither in bulk or individually). They are
reported as "<unavailable>". Capturing the same local variables with normal
tracepoints works. In the example below I setup both a fast and a normal
tracepoint, in the same session.

OS: Ubuntu 12.04 AMD64
gdb version: compiled from master branch from 2014-09-10. Also reproduced with
gdb I built from source, release version 7.7 and 7.8
configure options: --with-python --enable-targets="i686-linux-gnu" --with-expat

I will attach to this bug the example program I used and the tracepoint data
file I generated from the session below.

How to reproduce: 

Compiling test program (gcc 4.6.3)
gcc -O0 -g3 -Wall -c -o "long1.o" "long1.c"
gcc -L/var/tmp/gdb.7.8/lib/ -o "long1"  long1.o   -linproctrace

gdbserver:
LD_PRELOAD=/var/tmp/gdb.7.8/lib/libinproctrace.so
/var/tmp/gdb.7.8/bin/gdbserver :9999 /tmp/long/long1 

gdb:
/var/tmp/gdb.7.8/bin/gdb /tmp/long/long1
GNU gdb (GDB) 7.8.0.20140910-cvs
Copyright (C) 2014 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-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/long/long1...done.
(gdb) target extended-remote :9999
Remote debugging using :9999
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x00007ffff7ddb6b0 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) b main
Breakpoint 1 at 0x4005f1: file long1.c, line 16.
(gdb) c
Continuing.

Breakpoint 1, main () at long1.c:16
16        test(10000);
(gdb) ftrace long1.c:10
Fast tracepoint 2 at 0x4005cb: file long1.c, line 10.
(gdb) actions
Enter actions for tracepoint 2, one per line.
End with a line saying just "end".
>collect $locals
>collect $args
>collect $_ret
>collect i
>collect j
>end
(gdb) trace long1.c:9
Tracepoint 3 at 0x4005b4: file long1.c, line 9.
(gdb) actions
Enter actions for tracepoint 3, one per line.
End with a line saying just "end".
>collect $locals
>collect $args
>collect $_ret
>collect i
>collect j
>end
(gdb) tstart
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ffff78cfdbd in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) tstop
(gdb) tfind
Found trace frame 0, tracepoint 3
#0  test (n=10000) at long1.c:9
9            printf("long1: count: %d\n",i);
(gdb) tdump
Data collected at tracepoint 3, trace frame 0:
i = 0
j = {1, 2, 3, 4}
n = 10000
i = 0
j = {1, 2, 3, 4}
(gdb) tfind
Found trace frame 1, tracepoint 2
10            sleep(1);
(gdb) tdump
Data collected at tracepoint 2, trace frame 1:
i = <unavailable>
j = <unavailable>
n = <unavailable>
i = <unavailable>
j = <unavailable>
(gdb) tfind
Found trace frame 2, tracepoint 3
9            printf("long1: count: %d\n",i);
(gdb) tdump
Data collected at tracepoint 3, trace frame 2:
i = 1
j = {1, 2, 3, 4}
n = 10000
i = 1
j = {1, 2, 3, 4}
(gdb) info tracepoints 
Num     Type            Disp Enb Address            What
2       fast tracepoint keep y   0x00000000004005cb in test at long1.c:10
        collect $locals
        collect $args
        collect $_ret
        collect i
        collect j
    installed on target
3       tracepoint      keep y   0x00000000004005b4 in test at long1.c:9
        collect $locals
        collect $args
        collect $_ret
        collect i
        collect j
    installed on target
(gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug server/17373] fast tracepoints with local variables captured - reported as "<unavailable>"
  2014-09-11 13:48 [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>" marc.dumais at ericsson dot com
@ 2014-09-11 13:49 ` marc.dumais at ericsson dot com
  2014-09-11 13:49 ` marc.dumais at ericsson dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marc.dumais at ericsson dot com @ 2014-09-11 13:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17373

--- Comment #2 from Marc Dumais <marc.dumais at ericsson dot com> ---
Created attachment 7782
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7782&action=edit
tracepoint data file

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug server/17373] fast tracepoints with local variables captured - reported as "<unavailable>"
  2014-09-11 13:48 [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>" marc.dumais at ericsson dot com
  2014-09-11 13:49 ` [Bug server/17373] " marc.dumais at ericsson dot com
@ 2014-09-11 13:49 ` marc.dumais at ericsson dot com
  2014-09-11 14:45 ` marc.khouzam at ericsson dot com
  2014-09-11 14:55 ` marc.dumais at ericsson dot com
  3 siblings, 0 replies; 5+ messages in thread
From: marc.dumais at ericsson dot com @ 2014-09-11 13:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17373

--- Comment #1 from Marc Dumais <marc.dumais at ericsson dot com> ---
Created attachment 7781
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7781&action=edit
binary test program

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug server/17373] fast tracepoints with local variables captured - reported as "<unavailable>"
  2014-09-11 13:48 [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>" marc.dumais at ericsson dot com
  2014-09-11 13:49 ` [Bug server/17373] " marc.dumais at ericsson dot com
  2014-09-11 13:49 ` marc.dumais at ericsson dot com
@ 2014-09-11 14:45 ` marc.khouzam at ericsson dot com
  2014-09-11 14:55 ` marc.dumais at ericsson dot com
  3 siblings, 0 replies; 5+ messages in thread
From: marc.khouzam at ericsson dot com @ 2014-09-11 14:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17373

Marc Khouzam <marc.khouzam at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marc.khouzam at ericsson dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug server/17373] fast tracepoints with local variables captured - reported as "<unavailable>"
  2014-09-11 13:48 [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>" marc.dumais at ericsson dot com
                   ` (2 preceding siblings ...)
  2014-09-11 14:45 ` marc.khouzam at ericsson dot com
@ 2014-09-11 14:55 ` marc.dumais at ericsson dot com
  3 siblings, 0 replies; 5+ messages in thread
From: marc.dumais at ericsson dot com @ 2014-09-11 14:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17373

--- Comment #3 from Marc Dumais <marc.dumais at ericsson dot com> ---
I have reproduced the issue with gdb 7.2 : with this one the apparent problem
reported is a bit more specific/raw, compared to newer gdb:


(gdb) tfind
Found trace frame 0, tracepoint 3
#0  test (n=10000) at long1.c:9
9            printf("long1: count: %d\n",i);
(gdb) tdump
Data collected at tracepoint 3, trace frame 0:
i = 0
j = {1, 2, 3, 4}
n = 10000
i = 0
j = {1, 2, 3, 4}
(gdb) tfind
Found trace frame 1, tracepoint 2
10            sleep(1);
(gdb) tdump
Data collected at tracepoint 2, trace frame 1:
i = <error reading variable i (Cannot access memory at address 0x7fff5883e87c)>
j = <error reading variable j (Cannot access memory at address 0x7fff5883e860)>
n = <error reading variable n (Cannot access memory at address 0x7fff5883e85c)>
i = Cannot access memory at address 0x7fff5883e87c

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-11 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 13:48 [Bug server/17373] New: fast tracepoints with local variables captured - reported as "<unavailable>" marc.dumais at ericsson dot com
2014-09-11 13:49 ` [Bug server/17373] " marc.dumais at ericsson dot com
2014-09-11 13:49 ` marc.dumais at ericsson dot com
2014-09-11 14:45 ` marc.khouzam at ericsson dot com
2014-09-11 14:55 ` marc.dumais at ericsson dot com

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).