RE: [rfc 6/8] record disas: omit function names by default

Metzger, Markus T
2013-02-18T14:51:05Z

> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Monday, February 18, 2013 3:13 PM

> > I intend to remove the "btrace" command and all its sub-commands. I just kept them
> > so people can compare them with the new "record" commands.
> >
> > Regarding "brace list" I do not plan to add a corresponding "record" command.
>
> What should do the current "record list" hook other than what "btrace list" did?
>
> Current to_list_record and to_list_record_range are always left NULL in
> archer-mmetzger-btrace so there isn't what to compare yet:)
> (gdb) record list
> You can't do that when your target is `record-btrace'

It should print 10 source lines around the current position and allow you to
iterate over the execution log on source level.

It should essentially produce the same output as repeating "reverse step"
10 times and discarding everything except for the current source position
echoed when the "reverse step" command completes.

A rough first algorithm would be:

for (;insn in bounds; ++/--insn) {
sal = lookup source and line at insn
if (sal == last_sal)
continue;
last_sal = sal;
print source and line
if (++printed >= record_list_size)
break;
}

This does not consider multi-line expressions or non-code source lines. For heavily
optimized code or for code that frequently splits expressions over multiple lines,
this may be less helpful - at least in the above version. It also omits comments,
which some might consider a drawback, as well.

This goes beyond what "btrace" did and has the potential for lots of discussions -
especially when considering optimized code.
It might be better if we postponed it in favor of reverse-stepping, but I wanted it
to be considered when we're discussing the new "record" commands to avoid that
we call what I called "record backtrace" "record list" and thus don't have an appropriate
name left for such a source listing command.

Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052