bug-gdb
[Top][All Lists]
Advanced

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

How to control number of disassembly lines displayed when single-steppin


From: Frank
Subject: How to control number of disassembly lines displayed when single-stepping
Date: Wed, 28 Mar 2012 19:05:24 -0000
User-agent: G2/1.0

Dear GDB users/hackers,

I was wondering if anyone could help with the following problem.

I have a short script that generates an instruction-by-instruction
execution trace of a program. However, as the script executes the
"stepi" command in a loop, GDB displays several lines of disassembled
machine code at each step instead of just the precise intruction being
executed (which is indicated by a =>). I understand this is precisely
what is desired in most cases, but I would like to get GDB to only
display the line being executed (this makes for a smaller execution
log file).

So, is there a way to control the number of context lines given when
stepping through disassembled code? An environmental variable or
control parameter of some sort? Much appreciated if you have the
answer.

So you know, I have googled this in depth, but was unsuccessful
finding an answer.

The script and a segment of the output are below.

Thanks in advance,

F.

SCRIPT:

set disassemble-next-line on
set arm disassembler std

break main
enable 1
info break

continue

while (1)
si
end

OUTPUT:

557       Next_Ptr_Glob = (Rec_Pointer) &x;
=> 0x000082ec <main+20>:         2c 32 04 e3    movw    r3,
#16940      ; 0x422c
   0x000082f0 <main+24>:         01 30 40 e3    movt    r3, #1
   0x000082f4 <main+28>:         90 20 4b e2    sub     r2, r11,
#144   ; 0x90
   0x000082f8 <main+32>:         00 20 83 e5    str     r2, [r3]
0x000082f0      557       Next_Ptr_Glob = (Rec_Pointer) &x;
   0x000082ec <main+20>:         2c 32 04 e3    movw    r3,
#16940      ; 0x422c
=> 0x000082f0 <main+24>:         01 30 40 e3    movt    r3, #1
   0x000082f4 <main+28>:         90 20 4b e2    sub     r2, r11,
#144   ; 0x90
   0x000082f8 <main+32>:         00 20 83 e5    str     r2, [r3]
0x000082f4      557       Next_Ptr_Glob = (Rec_Pointer) &x;
   0x000082ec <main+20>:         2c 32 04 e3    movw    r3,
#16940      ; 0x422c
   0x000082f0 <main+24>:         01 30 40 e3    movt    r3, #1
=> 0x000082f4 <main+28>:         90 20 4b e2    sub     r2, r11,
#144   ; 0x90
   0x000082f8 <main+32>:         00 20 83 e5    str     r2, [r3]
0x000082f8      557       Next_Ptr_Glob = (Rec_Pointer) &x;
   0x000082ec <main+20>:         2c 32 04 e3    movw    r3,
#16940      ; 0x422c
   0x000082f0 <main+24>:         01 30 40 e3    movt    r3, #1
   0x000082f4 <main+28>:         90 20 4b e2    sub     r2, r11,
#144   ; 0x90
=> 0x000082f8 <main+32>:         00 20 83 e5    str     r2, [r3]
558       Ptr_Glob = (Rec_Pointer) &y;
=> 0x000082fc <main+36>:         38 32 04 e3    movw    r3,
#16952      ; 0x4238
   0x00008300 <main+40>:         01 30 40 e3    movt    r3, #1
   0x00008304 <main+44>:         c0 20 4b e2    sub     r2, r11,
#192   ; 0xc0
   0x00008308 <main+48>:         00 20 83 e5    str     r2, [r3]
0x00008300      558       Ptr_Glob = (Rec_Pointer) &y;
   0x000082fc <main+36>:         38 32 04 e3    movw    r3,
#16952      ; 0x4238
=> 0x00008300 <main+40>:         01 30 40 e3    movt    r3, #1
   0x00008304 <main+44>:         c0 20 4b e2    sub     r2, r11,
#192   ; 0xc0
   0x00008308 <main+48>:         00 20 83 e5    str     r2, [r3]

etc....


reply via email to

[Prev in Thread] Current Thread [Next in Thread]