www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/10/05:32:07

Date: Mon, 10 Oct 1994 14:30:47 +22305931 (WAUST)
From: Ron Grunwald <rgrunwal AT bluering DOT cowan DOT edu DOT au>
Subject: GDB debugger and DPMI
To: djgpp AT sun DOT soe DOT clarkson DOT edu

Hi all G++'ers,


Recently I've managed to spare some time to explore those GDB problems that
I've been getting a little further. Here are some of the results I've found.

The following C++ code was compiled under GNU C++ V2.6.0 and linked without
any problems. The exact command line used was:

gcc -v -g -o t2 t2.cc -lm -lgpp


----------------------------------------------------------------------------
#include <iostream.h>

int main(void) {

   int a=2,b=3,c=9,z;

   z=a+b+c*c;

   cout << "Computed equation value = " << z;
   return 1;
}
----------------------------------------------------------------------------


I then tried to run it under GO32 V1.12 maint 2 and debugger GDB V4.12. The
environment is a full-screen DOS box under Windows 3.1. The exact command
line entered was:


go32 -d /djgpp/bin/gdb-dpmi t2


The whole process aborted with a segmentation violation. The exact output is
shown below:


C:\DJGPP\DTLSOLID>go32 -d /djgpp/bin/gdb-dpmi t2
go32 version 1.12 Copyright (C) 1994 DJ Delorie
48984+4096+4096 = 57176
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.12 (go32 ), Copyright 1994 Free Software Foundation, Inc...Segmentation vi
olation in pointer 0x000cc004 at cf:85a77
eax=000c3f00 ebx=00000008 ecx=00002ee2 edx=000cc004 esi=000cc004 edi=00002ee2
ebp=00299e4c esp=00299e24 cs=cf ds=c7 es=c7 fs=a7 gs=bf ss=c7 cr2=00001fe5
Call frame traceback EIPs:
  0x00085a77
  0x0004901f
  0x0004866e
  0x00021db6
  0x00021f8e
  0x000221ff
  0x0000150a



I then used the C version of the above program as shown below:


----------------------------------------------------------------------------
#include <stdio.h>

int main(void) {

   int a=2,b=3,c=9,z;

   z=a+b+c*c;

   printf("Computed equation value = %d\n", z);
   return 1;
}
----------------------------------------------------------------------------


This was compiled and linked with the following command line:

gcc -v -g -o t3 t3.c


It was then run as:

go32 -d /djgpp/bin/gdb-dpmi t3



The output generated from this is shown below:

C:\DJGPP\DTLSOLID>go32 -d /djgpp/bin/gdb-dpmi t3
go32 version 1.12 Copyright (C) 1994 DJ Delorie
12120+4096+4096 = 20312
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.12 (go32 ), Copyright 1994 Free Software Foundation, Inc...
(gdb) l
1       #include <stdio.h>
2
3       int main(void) {
4
5          int a=2,b=3,c=9,z;
6
7          z=a+b+c*c;
8
9          printf("Computed equation value = %d\n", z);
10         return 1;
(gdb) q


In other words, it works fine!


So, what I'm wondering now is maybe the current version of GDB 4.12 cannot
interpret C++ object files yet. Can anyone positively confirm or deny this
assumption?


A short summary of the memory configuration under which GO32 operates in is
shown below.

C:\DJGPP\DTLSOLID>go32
go32 version 1.12 Copyright (C) 1994 DJ Delorie
Lowest version I can run is 1.08
go32.exe usage: go32 [-d {debugger}] [{program} [{options} . . . ]]
go32.exe build time was Thu Aug 04 19:52:27 1994
DPMI memory available: 1776 Kb
Swap space available: 11744 Kb

C:\DJGPP\DTLSOLID>



I will continue to find out more about this problem, but in the meantime
if anyone has any further ideas or thoughts on the matter, they would be
deeply appreciated.


Regards, Ron.




 ********************************************************************
 | Author.............. Ron Grunwald                                | 
 | Internet............ rgrunwal AT bluering DOT cowan DOT edu DOT au              | 
 | Phone............... (09)273 8027 or (09)273 8468                |
 |------------------------------------------------------------------|
 | Department.......... Information Technology                      | 
 | Division/Faculty.... Operations and Systems Management           | 
 | Institute........... Edith Cowan University, Churchlands         | 
 | Location............ Perth, Western Australia                    |
 ********************************************************************
 "I don't have any solution but I certainly admire the problem!"

 



- Raw text -


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