This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix dprintf work not right if it is pending
- From: Hui Zhu <teawater at gmail dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Keith Seitz <keiths at redhat dot com>, Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Wed, 10 Apr 2013 12:43:46 +0800
- Subject: Re: [PATCH] Fix dprintf work not right if it is pending
- References: <514BF736 dot 3070706 at mentor dot com> <514C3C85 dot 4000704 at codesourcery dot com> <514EEBFF dot 8090705 at redhat dot com> <CANFwon3D77yDiB_bQ0iZeg=KpkwoGiKnu=_7+kfcVV547M_cfg at mail dot gmail dot com> <5154378D dot 60302 at redhat dot com> <CANFwon3OdcsC3PQRwteYPKiBYFFKGPcOfMVcc4Fx8XdjZ=-pQw at mail dot gmail dot com> <515B1DF7 dot 3090705 at redhat dot com> <515EF6A3 dot 2080704 at redhat dot com> <CANFwon2UZwnHqCuEtSbSz6z82tr2HciU0QfiQS2dacFdFcvMFg at mail dot gmail dot com> <CANFwon11DSoU5jiHX4G7RGuxBOZRaXD6Cth6Ob3X_Z0-TgnPXw at mail dot gmail dot com> <5162D6A9 dot 2070706 at redhat dot com> <CANFwon3rTwU1AkmeWAoHJZLH=DFrwMzbazK06M5UgBbSn7ZJ2A at mail dot gmail dot com> <51640391 dot 2040801 at redhat dot com> <CANFwon0Dmnsq50NgQ6BrPNVA5uQnEgUmsksr2SODBHp7A60ZBw at mail dot gmail dot com>
Hi Joel,
http://sourceware.org/ml/gdb-cvs/2013-04/msg00097.html
This is a bug fix. Can I check it in to 7.6 branch?
Thanks,
Hui
On Wed, Apr 10, 2013 at 12:40 PM, Hui Zhu <teawater@gmail.com> wrote:
> Hi Pedro,
>
> Thanks for your review.
>
> On Tue, Apr 9, 2013 at 8:03 PM, Pedro Alves <palves@redhat.com> wrote:
>> Hi Hui,
>>
>> On 04/09/2013 10:00 AM, Hui Zhu wrote:
>>> On Mon, Apr 8, 2013 at 10:39 PM, Pedro Alves <palves@redhat.com> wrote:
>>>>
>>>>> +set testfile "dprintf-pending"
>>>>> +set libfile "dprintf-pendshr"
>>>>> +set srcfile $testfile.c
>>>>> +set libsrc $srcdir/$subdir/$libfile.c
>>>>> +set binfile $objdir/$subdir/$testfile
>>>>> +set lib_sl $objdir/$subdir/$libfile.sl
>>>>
>>>> Please use standard_testfile/standard_output_file.
>>>
>>> Fixed.
>>
>> Close, but:
>>
>>> +standard_testfile .c
>>> +set libfile "dprintf-pendshr"
>>> +set libsrc $srcdir/$subdir/$libfile.c
>>> +set lib_sl $objdir/$subdir/$libfile.sl
>>
>> ".c" is not necessary. Do use standard_output_file please.
>>
>> Like so:
>>
>> standard_testfile
>>
>> set libfile "dprintf-pendshr"
>> set libsrc $srcdir/$subdir/$libfile.c
>> set lib_sl [standard_output_file $libfile.sl]
>
> Fixed.
>
>>
>>
>> Oh,
>>
>>> +++ b/gdb/breakpoint.c
>>> @@ -12963,6 +12963,35 @@ bkpt_re_set (struct breakpoint *b)
>>> breakpoint_re_set_default (b);
>>> }
>>>
>>> +/* Dprintf breakpoint_ops methods. */
>>> +
>>> +static void
>>> +dprintf_re_set (struct breakpoint *b)
>>> +{
>> ...
>>> +}
>>> +
>>> static int
>>> bkpt_insert_location (struct bp_location *bl)
>>> {
>>
>> I only now noticed you're putting the new dprintf_re_set
>> function right in the middle of the
>>
>> /* Default breakpoint_ops methods. */
>>
>> bkpt_re_set (struct breakpoint *b)
>> ...
>> bkpt_insert_location (struct bp_location *bl)
>> ...
>> bkpt_remove_location (struct bp_location *bl)
>> ...
>> bkpt_breakpoint_hit (const struct bp_location *bl,
>> ...
>> bkpt_resources_needed (const struct bp_location *bl)
>> ...
>> bkpt_print_it (bpstat bs)
>> ...
>> bkpt_print_mention (struct breakpoint *b)
>> ...
>> bkpt_decode_linespec (struct breakpoint *b, char **s,
>> ...
>>
>> section. If you keep scrolling down, you'll notice that
>> we have a section/block/group of functions for each
>> breakpoint type.
>>
>> /* Virtual table for internal breakpoints. */
>> /* Virtual table for momentary breakpoints */
>> /* Specific methods for probe breakpoints. */
>> /* The breakpoint_ops structure to be used in tracepoints. */
>>
>> etc. for all other types. Please don't break this layout.
>
> Fixed.
>
>>
>> Otherwise OK.
>
> Commited in http://sourceware.org/ml/gdb-cvs/2013-04/msg00097.html
>
> Thanks,
> Hui
>
>>
>> Thanks,
>> --
>> Pedro Alves
>>