This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/22869] New: set architecture i8068 has no effect on disassembly
- From: "aidankhoury at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 20 Feb 2018 20:29:01 +0000
- Subject: [Bug gdb/22869] New: set architecture i8068 has no effect on disassembly
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=22869
Bug ID: 22869
Summary: set architecture i8068 has no effect on disassembly
Product: gdb
Version: 8.1
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: aidankhoury at gmail dot com
Target Milestone: ---
When specifying the current target architecture as i8086 using `set
architecture i8086`, GDB still disassembles in i386 protected mode.
Here is some example code compiled using NASM with BITS 16 specified:
; i386 instruction set
CPU 386
; Text section
SECTION .text
; 16 bit code
[BITS 16]
check_device:
mov bx, 55AAh
mov ah, 41h
int 13h
mov si, sDriveParamsBuffer
mov word [si+DRIVE_PARAMS_EXTENDED.BufferSize], 16
mov ah, 48h
int 13h
Here is GDB's disassembly output at the correct location, which is clearly
being seen as 32 bit protected mode code
even though the target architecture is set for i8086:
(gdb) set architecture i8086
The target architecture is assumed to be i8086
(gdb) show architecture
The target architecture is assumed to be i8086
(gdb) disassemble /r $cs * 16 + $eip,+24
Dump of assembler code from 0x2033d to 0x20355:
0x0002033d: bb aa 55 b4 41 mov ebx,0x41b455aa
0x00020342: cd 13 int 0x13
0x00020344: 72 78 jb 0x203be
0x00020346: 66 be a0 2f mov si,0x2fa0
0x0002034a: 00 00 add BYTE PTR [eax],al
0x0002034c: c7 04 42 00 b4 48 cd mov DWORD PTR [edx+eax*2],0xcd48b400
0x00020353: 13 72 68 adc esi,DWORD PTR [edx+0x68]
Here are the current flags I use to configure the GDB project for build:
./configure --enable-64-bit-bfd --disable-werror --disable-win32-registry
--disable-rpath --with-expat --with-zlib --with-lzma --enable-tui
--
You are receiving this mail because:
You are on the CC list for the bug.