delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/14/13:31:00

From: "David Lee" <keeyu AT poetic DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: GDB problem:
Date: Sat, 15 Jul 2000 00:52:12 +0800
Organization: IMS Netvigator
Lines: 43
Message-ID: <8kngfn$s0d1@imsp212.netvigator.com>
NNTP-Posting-Host: wtstnt01180.netvigator.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I write a little program:

#include <sys/farptr.h>
#include <dpmi.h>

void main()
{
    int sel, seg;
    seg = __dpmi_allocate_dos_memory(1, &sel);

    _farpokeb(sel, 0, 2);
    _farpokeb(sel, 1, 29);
    _farpokeb(sel, 2, 112);
    _farpokeb(sel, 3, 2);

    __dpmi_free_dos_memory(sel);
}

Then I do the following:

C:\> gxx -g test.cpp
C:\> gdb a.exe

(gdb) b main        // set breakpoint in main()
(gdb) run              // run the program
(gdb) s                  // step
Breakpoint 1, main () at dos.cpp:9
9               seg = __dpmi_allocate_dos_memory(12, &sel);
Current language:  auto; currently c++
(gdb) s
11              _farpokeb(sel, 0, 2);
(gdb) s
_farpokeb (selector=287, offset=0, value=2) at test.cpp:89
Line number 89 out of range; test.cpp has 17 lines.
(gdb)

It says that "Line number 89 out of range". But why would gdb goto
line 89? My source code does not even have line 89!

Any help is appreciated.



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019