Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>,
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix MI dprintf-insert not printing when a location is pending.
Date: Fri, 27 Mar 2015 16:46:00 -0000	[thread overview]
Message-ID: <55158974.2040506@redhat.com> (raw)
In-Reply-To: <55154E63.5040603@ericsson.com>

On 03/27/2015 05:34 AM, Antoine Tremblay wrote:
> On 03/26/2015 03:10 PM, Keith Seitz wrote:
>> On 03/26/2015 09:47 AM, Antoine Tremblay wrote:
>>> +# Set pending dprintf via MI.
>>> +mi_gdb_test "-dprintf-insert -f pendfunc1 \"hello\"" \
>>> +
>>> ".*\\^done,bkpt={number=\"1\",type=\"dprintf\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"}"
>>>
>>> \
>>> +    "mi set dprintf"
>>> +
>>> +mi_gdb_test "-break-insert $bp_location1" ".*" "mi insert breakpoint
>>> bp_location1"
>>
>> Is it possible to use mi_make_breakpoint for these tests?
>
> Unfortunately for the dprintf one mi_make_breakpoint doesn't support
> pending breakpoints, it creates something like :
> bkpt={number="2",type=".*",disp=".*",enabled=".*",addr=".*",func=".*",
>         file=".*/myfile.c",fullname=".*",line="3",thread-groups=\[.*\],
>         times="0".*original-location=".*"}
>
> But with pending funcs it should be pending= ...

Ah, I see. Thank you for pointing that out. I *thought* that I did that 
already!

> It could be the subject of another patch to add that support.
>

Indeed.

> I used mi_create_breakpoint for the other breakpoint now
>

Excellent.

>>> +mi_run_cmd
>>> +
>>> +set msg "mi dprintf"
>>> +gdb_expect {
>>> +    -re ".*~\"hello\"" {
>>> +    pass $msg
>>> +    }
>>> +    -re ".*$mi_gdb_prompt$" {
>>> +    fail $msg
>>> +    }
>>> +    timeout {
>>> +    fail $msg
>>> +    }
>>> +}
>>
>> This a pretty common test suite idiom, I think. Can mi_gdb_test be used
>> instead of gdb_expect?
>
> That I can't since mi_gdb_test requires a command and in this case I'm
> just doing expect on that comes after mi_run_cmd, there's no command
> associated with it..

While not common in gdb.mi (with mi_gdb_test), the rest of gdb.* uses 
the idiom:

   gdb_test "" ...

all the time.

Looking at the description of mi_gdb_test:

# mi_gdb_test COMMAND PATTERN MESSAGE [IPATTERN] -- send a command to gdb;
#   test the result.
#
# COMMAND is the command to execute, send to GDB with send_gdb.  If
#   this is the null string no command is sent.

[Very quickly] Browsing through the code of that function, it seems like 
it should work. If it does not, would you please file a bug? It 
*definitely* should work.

Keith


      parent reply	other threads:[~2015-03-27 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 16:47 Antoine Tremblay
2015-03-26 19:11 ` Keith Seitz
2015-03-27 12:34   ` Antoine Tremblay
2015-03-27 12:37     ` Antoine Tremblay
2015-03-27 16:52       ` Keith Seitz
2015-03-27 17:13         ` Antoine Tremblay
2015-03-27 17:34           ` Keith Seitz
2015-04-20 12:14             ` Antoine Tremblay
2015-06-12 12:27               ` [PATCH v3] Fix MI dprintf-insert not printing on a resolved pending location Antoine Tremblay
2015-06-12 12:33                 ` Pedro Alves
2015-03-27 16:46     ` Keith Seitz [this message]

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=55158974.2040506@redhat.com \
    --to=keiths@redhat.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /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