Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Der Herr Hofrat <der.herr@hofr.at>
To: gdb@sources.redhat.com
Subject: tracepoint implementation question
Date: Sat, 18 Mar 2006 11:19:00 -0000	[thread overview]
Message-ID: <200603191024.k2JAOGh02932@hofr.at> (raw)


HI !

 I'm playing with tracepoints and ran across a problem with the actions.

 I added the basic package handling as a set of dummy routines that basically
 print information for now only + a dummy handler that just prints when it
 got called. The test code on the target is:

void junk2(int *someint){
        int junk=1;
        printf("got %d (%d)\n",*someint,junk);
}

main(){
        int i=0;
        while(i<4){
                junk2(&i);
                sleep(1);
                i++;
        }
        return 0;
}


This basically is working

Host:
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0x400007b0 in ?? ()
(gdb) symbol-file gdbserver/hello
Reading symbols from /root/tracepoints/gdb-6.3-tp1/gdb/gdbserver/hello...done.
(gdb) trace junk2
Tracepoint 1 at 0x80483df: file hello.c, line 8.
(gdb) actions
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
> collect $regs
> end
(gdb) tstart
(gdb) c
Continuing.

Program exited normally.
(gdb)

Target:
received pkt (QTinit)
Q packet received (QTinit)
received pkt (QTDP:1:080483df:E:0:0-)
Q packet received (QTDP:1:080483df:E:0:0-)
tracepoint data (QTDP:1:080483df:E:0:0-)
tp request 1 at address 80483df (state: 1)
received pkt (QTDP:-1:080483df:R03FFFFFFFFFF)
Q packet received (QTDP:-1:080483df:R03FFFFFFFFFF)
tracepoint data (QTDP:-1:080483df:R03FFFFFFFFFF)
packet data tc 1: (R03FFFFFFFFFF)
continuation for tp 1 at address 80483df
received pkt (QTStart)
Q packet received (QTStart)
tracepoint start (QTStart)
received pkt (vCont?)
received pkt (vCont;c)
tp breakpoint triggert at 80483df
got 0 (1)
tp breakpoint triggert at 80483df
got 1 (1)
...

 Now I started adding the different actions and found that only 
 "collect $regs" seems to be supported/working on the host side.
 I get the register array and could now collect it in the handler 
 that is called - but if I try anything else like:

(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
> collect someint
> end
(gdb) tstart
someint: don't know symbol class 21
(gdb)

no packet is obviously sent to the target - the same for args

(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
> collect $args
> end
(gdb) tstart
warning: don't know how to trace local symbol someint
warning: No args found in scope.
(gdb)

The tracepoint is set but no information on the object to collect is sent
to the target.

Is there any docs on the details of tracepoints ? 
is this part of the gdb code actually actively maintained or am I wasting my 
time trying to get this to work ? 
Is there any further information on tracepoints available other than the 
protocol/packet spec - some sort of design doc ?

thx !
hofrat


             reply	other threads:[~2006-03-18 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18 11:19 Der Herr Hofrat [this message]
2006-03-19 17:24 ` Jim Blandy
2006-03-20  6:18   ` Der Herr Hofrat
2006-03-20  6:38     ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603191024.k2JAOGh02932@hofr.at \
    --to=der.herr@hofr.at \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox