This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Add support of software single step to process record


Cool.  I think your idea is more better than I did.  Thanks.

This is the new patch.

Best regards,
Hui

On Wed, Dec 23, 2009 at 14:51, Joel Brobecker <brobecker@adacore.com> wrote:
>> Joel, I remove the current_gdbarch() from this patch, but for
>> get_current_frame, I cannot find any function that fit for replace it.
>> ?Could you help me with it?
>
> Upon further investigation, I believe that this is the only way to do
> this. ?I don't think you can get the frame from the arguments provided
> to "resume". I did a quick research and infrun.c:resume does the same
> thing (actually, it's maybe_software_singlestep).
>
>> + ?if (single_step_breakpoints[0] != NULL
>> + ? ? ?|| single_step_breakpoints[1] != NULL)
>> + ? ?return 1;
>> +
>> + ?return 0;
>
> Style nit: You really don't have to fix this, as this is a matter of
> style more than correctness, but we usually write the above code as
>
> ?return (single_step_breakpoints[0] != NULL
> ? ? ? ? ?|| single_step_breakpoints[1] != NULL)
>
> This avoids the type of mistake you made. ?I tend to like the style
> you used when there are several consecutive if conditions that allow
> me to return early (a type of soft assert), or to avoid unreasonable
> nesting levels.
>
> --
> Joel
>

Attachment: prec_software_single_step.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]