1<html lang="en"> 2<head> 3<title>Architectures In Python - Debugging with GDB</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Debugging with GDB"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Python-API.html#Python-API" title="Python API"> 9<link rel="prev" href="Lazy-Strings-In-Python.html#Lazy-Strings-In-Python" title="Lazy Strings In Python"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1988-2013 Free Software Foundation, Inc. 13 14Permission is granted to copy, distribute and/or modify this document 15under the terms of the GNU Free Documentation License, Version 1.3 or 16any later version published by the Free Software Foundation; with the 17Invariant Sections being ``Free Software'' and ``Free Software Needs 18Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 19and with the Back-Cover Texts as in (a) below. 20 21(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 22this GNU Manual. Buying copies from GNU Press supports the FSF in 23developing GNU and promoting software freedom.'' 24--> 25<meta http-equiv="Content-Style-Type" content="text/css"> 26<style type="text/css"><!-- 27 pre.display { font-family:inherit } 28 pre.format { font-family:inherit } 29 pre.smalldisplay { font-family:inherit; font-size:smaller } 30 pre.smallformat { font-family:inherit; font-size:smaller } 31 pre.smallexample { font-size:smaller } 32 pre.smalllisp { font-size:smaller } 33 span.sc { font-variant:small-caps } 34 span.roman { font-family:serif; font-weight:normal; } 35 span.sansserif { font-family:sans-serif; font-weight:normal; } 36--></style> 37<link rel="stylesheet" type="text/css" href="../cs.css"> 38</head> 39<body> 40<div class="node"> 41<a name="Architectures-In-Python"></a> 42<p> 43Previous: <a rel="previous" accesskey="p" href="Lazy-Strings-In-Python.html#Lazy-Strings-In-Python">Lazy Strings In Python</a>, 44Up: <a rel="up" accesskey="u" href="Python-API.html#Python-API">Python API</a> 45<hr> 46</div> 47 48<h5 class="subsubsection">23.2.2.27 Python representation of architectures</h5> 49 50<p><a name="index-Python-architectures-2193"></a> 51<span class="sc">gdb</span> uses architecture specific parameters and artifacts in a 52number of its various computations. An architecture is represented 53by an instance of the <code>gdb.Architecture</code> class. 54 55 <p>A <code>gdb.Architecture</code> class has the following methods: 56 57<div class="defun"> 58— Function: <b>Architecture.name</b> ()<var><a name="index-Architecture_002ename-2194"></a></var><br> 59<blockquote><p>Return the name (string value) of the architecture. 60</p></blockquote></div> 61 62<div class="defun"> 63— Function: <b>Architecture.disassemble</b> (<var>start_pc </var><span class="roman">[</span><var>, end_pc </var><span class="roman">[</span><var>, count</var><span class="roman">]]</span>)<var><a name="index-Architecture_002edisassemble-2195"></a></var><br> 64<blockquote><p>Return a list of disassembled instructions starting from the memory 65address <var>start_pc</var>. The optional arguments <var>end_pc</var> and 66<var>count</var> determine the number of instructions in the returned list. 67If both the optional arguments <var>end_pc</var> and <var>count</var> are 68specified, then a list of at most <var>count</var> disassembled instructions 69whose start address falls in the closed memory address interval from 70<var>start_pc</var> to <var>end_pc</var> are returned. If <var>end_pc</var> is not 71specified, but <var>count</var> is specified, then <var>count</var> number of 72instructions starting from the address <var>start_pc</var> are returned. If 73<var>count</var> is not specified but <var>end_pc</var> is specified, then all 74instructions whose start address falls in the closed memory address 75interval from <var>start_pc</var> to <var>end_pc</var> are returned. If neither 76<var>end_pc</var> nor <var>count</var> are specified, then a single instruction at 77<var>start_pc</var> is returned. For all of these cases, each element of the 78returned list is a Python <code>dict</code> with the following string keys: 79 80 <dl> 81<dt><code>addr</code><dd>The value corresponding to this key is a Python long integer capturing 82the memory address of the instruction. 83 84 <br><dt><code>asm</code><dd>The value corresponding to this key is a string value which represents 85the instruction with assembly language mnemonics. The assembly 86language flavor used is the same as that specified by the current CLI 87variable <code>disassembly-flavor</code>. See <a href="Machine-Code.html#Machine-Code">Machine Code</a>. 88 89 <br><dt><code>length</code><dd>The value corresponding to this key is the length (integer value) of the 90instruction in bytes. 91 92 </dl> 93 </p></blockquote></div> 94 95 </body></html> 96 97