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 - Python Scripting] New method gdb.Architecture.disassemble


On Fri, Feb 8, 2013 at 10:05 AM, Doug Evans <dje@google.com> wrote:

> Let's take a step back and assume one wants to add disassembly to Python,
> without knowing anything about what gdb does and doesn't already provide.

Thanks for bringing this up, all very good points.

> Global State In An API Is Bad.

definitely agree, part of why i was wondering if the ui-out object
shouldn't be passed in to the disassemble method was because it seemed
more pure

I suppose this leads me to consider that the "data-disassemble" command is
(untested though) exposed already via the 'mi_execute' functions in
the PR #11688
which already has generic conversion of arguments to and from mi commands.

to transcribe an example (untested) from the mi docs [1]
gdb.mi_execute("data-disassemble", ("-s", "$pc", "-e", "$pc+20", "--", 0))

This at least makes it rather apparent that we aren't working with a
real python API
and are using a python version of some gdb command interpreter (and
all that entails).
that at least gives us a stopgap that we can use while codifying a real API

does disassemble method vs generic mi method make any difference?
my main concern with the generic mi method is that it makes the coding
of any real
python API addressing your concerns somewhat less imminent

[1] http://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation


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