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


> 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


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