Re: Show insn-preds.c instead of predicates.md during debug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks all, this does the trick.

Maxim

On Mon, 18 May 2020 at 17:40, Segher Boessenkool
<segher@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi!
>
> On Mon, May 18, 2020 at 04:42:54PM +0100, Richard Sandiford wrote:
> > Maxim Blinov via Gcc-help <gcc-help@xxxxxxxxxxx> writes:
> > > When we make the call into the predicate, GDB switches the view into
> > > the corresponding machine description file. This is really not what I
> > > want - I just want to step through the honest-to-god C code in the
> > > generated insn-preds.c file.
> > >
> > > Is there a switch one can give to GDB to stop being "too clever"?
> >
> > Unfortunately the best way at present to do that is to sed out the
> > "#line"s from insn-preds.c and then rerun "make".  E.g.:
> >
> >   sed -i '/^#line/d' insn-preds.c
> >
> > The reason for adding the #lines is that it gives better line number
> > information for diagnostics, if there's a warning or error in the
> > .md C++ code.
>
> --- 8< ---
> diff --git a/gcc/read-md.c b/gcc/read-md.c
> index 40690a8..8bd6ba0 100644
> --- a/gcc/read-md.c
> +++ b/gcc/read-md.c
> @@ -126,7 +126,7 @@ void
>  md_reader::fprint_md_ptr_loc (FILE *outf, const void *ptr)
>  {
>    const struct ptr_loc *loc = get_md_ptr_loc (ptr);
> -  if (loc != 0)
> +  if (0 && loc != 0)
>      fprintf (outf, "#line %d \"%s\"\n", loc->loc.lineno, loc->loc.filename);
>  }
>
> --- 8< ---
>
> (and then "(cd gcc && make)" in your build dir) does the trick.  Hacky
> perhaps, but effective :-)
>
>
> Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux