Browse Source

--- Merging r14149 into '.':
A packages/gdbint/gen-gdblib-inc.sh
--- Merging r14154 into '.':
U packages/gdbint/gen-gdblib-inc.sh
--- Merging r14161 into '.':
G packages/gdbint/gen-gdblib-inc.sh
--- Merging r14374 into '.':
G packages/gdbint/gen-gdblib-inc.sh
--- Merging r14375 into '.':
U packages/gdbint/src/gdbint.pp
--- Merging r14376 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14377 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14378 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14380 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14381 into '.':
G packages/gdbint/gen-gdblib-inc.sh

# revisions: 14149,14154,14161,14374,14375,14376,14377,14378,14380,14381
------------------------------------------------------------------------
r14149 | pierre | 2009-11-11 22:41:24 +0100 (Wed, 11 Nov 2009) | 1 line
Changed paths:
A /trunk/packages/gdbint/gen-gdblib-inc.sh

+ Script to generate libgdb directory
------------------------------------------------------------------------
------------------------------------------------------------------------
r14154 | pierre | 2009-11-12 17:24:58 +0100 (Thu, 12 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/gen-gdblib-inc.sh

* Improve script to generate gdblib.inc
------------------------------------------------------------------------
------------------------------------------------------------------------
r14161 | pierre | 2009-11-12 22:05:19 +0100 (Thu, 12 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/gen-gdblib-inc.sh

* improve DJGPP output
------------------------------------------------------------------------
------------------------------------------------------------------------
r14374 | pierre | 2009-12-09 11:43:54 +0100 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/gen-gdblib-inc.sh

* also accept cc as compiler
------------------------------------------------------------------------
------------------------------------------------------------------------
r14375 | pierre | 2009-12-09 11:44:44 +0100 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

solaris support and python first try
------------------------------------------------------------------------
------------------------------------------------------------------------
r14376 | pierre | 2009-12-09 15:32:19 +0100 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

+ bp_location struct added
------------------------------------------------------------------------
------------------------------------------------------------------------
r14377 | pierre | 2009-12-09 15:53:00 +0100 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

BP_LOCATION is used from 6.6
------------------------------------------------------------------------
------------------------------------------------------------------------
r14378 | pierre | 2009-12-09 16:29:19 +0100 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* more bp_location fixes
------------------------------------------------------------------------
------------------------------------------------------------------------
r14380 | pierre | 2009-12-10 00:41:55 +0100 (Thu, 10 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* handle post 7.0 CVS diffs in structs
------------------------------------------------------------------------
------------------------------------------------------------------------
r14381 | pierre | 2009-12-10 00:43:02 +0100 (Thu, 10 Dec 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/gen-gdblib-inc.sh

* also define GDB_CVS if version contains cvs substring
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@14724 -

marco 15 years ago
parent
commit
d5d360632d
3 changed files with 322 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 142 0
      packages/gdbint/gen-gdblib-inc.sh
  3. 179 2
      packages/gdbint/src/gdbint.pp

+ 1 - 0
.gitattributes

@@ -1800,6 +1800,7 @@ packages/gdbint/examples/mingw.pas svneol=native#text/plain
 packages/gdbint/examples/symify.pp svneol=native#text/plain
 packages/gdbint/examples/testgdb.pp svneol=native#text/plain
 packages/gdbint/fpmake.pp svneol=native#text/plain
+packages/gdbint/gen-gdblib-inc.sh svneol=native#text/plain
 packages/gdbint/src/freadlin.pp svneol=native#text/x-pascal
 packages/gdbint/src/gdbcon.pp svneol=native#text/plain
 packages/gdbint/src/gdbint.pp svneol=native#text/plain

+ 142 - 0
packages/gdbint/gen-gdblib-inc.sh

@@ -0,0 +1,142 @@
+#!/bin/bash
+
+if [ "$1" != "" ]; then
+  destdir=$1
+fi
+if [ "${PATHEXT}" != "" ]; then
+  EXEEXT=.exe
+  if [ "${DJDIR}" != "" ]; then
+    libdir=${DJDIR}/lib
+  else
+    libdir=/lib
+  fi
+else
+  EXEEXT=
+  libdir=/lib
+fi
+
+echo "Deleting gdb${EXEEXT} to force recompile"
+rm -f gdb${EXEEXT}
+echo "Rebuilding gdb${EXEEXT}"
+make gdb${EXEEXT} | tee make.log
+
+gdb_full_version=`sed -n "s:.*version.*\"\(.*\)\".*:\1:p" version.c`
+gdbcvs=`sed -n "s:.*version.*\"\(.*\)cvs\(.*\)\".*:\1cvs\2:p" version.c`
+gdb_version1=`sed -n "s:.*version.*\"\([0-9]*\)\.\([0-9]*\).*:\1:p" version.c`
+gdb_version2=`sed -n "s:.*version.*\"\([0-9]*\)\.\([0-9]*\).*:\2:p" version.c`
+gdb_version=`sed -n "s:.*version.*\"\([0-9]*\)\.\([0-9]*\).*:\1.\2:p" version.c`
+
+echo found full version is ${gdb_full_version}
+echo found version is ${gdb_version}
+if [ ${gdb_version2} -lt 10 ]; then
+  gdbversion=${gdb_version1}0${gdb_version2}
+else
+  gdbversion=${gdb_version1}${gdb_version2}
+fi
+if [ "${destdir}" == "" ]; then
+  destdir=./libgdb
+fi
+
+if ! [ -d ${destdir} ]; then
+  mkdir ${destdir}
+fi
+
+cat make.log | gawk '
+BEGIN {
+doprint=0
+}
+# We look for the compilation line
+# either gcc or cc
+/cc / { doprint=1; }
+
+{
+if ( doprint == 1 ) {
+  print $0
+}
+}
+
+! /\\$/ { doprint=0; }
+' | tee comp-cmd.log
+# Try to locate all libraries
+echo Creating ./copy-libs.sh script
+cat comp-cmd.log |gawk -v destdir=${destdir} -v libdir=${libdir} '
+BEGIN {
+  print "#!/bin/bash"
+  print "# copy-libs.sh generated by awk script"
+  print "if [ \"$1\" != \"\" ]; then"
+  print "  destdir=$1"
+  print " ginstall -d ${destdir}"
+  print "else"
+  print "  echo $0 destdir"
+  print "  echo destdir should be the location where libgdb.a"
+  print "  echo and all other archives should be copied"
+  print "  exit"
+  print "fi"
+  print "# Copy gdblib.inc file"
+  print "cp gdblib.inc ${destdir}"
+}
+
+{
+  nb = split ($0,list);
+
+  for (i=1; i<=nb; i++) {
+  if ( list[i] ~ /lib[^ ]*\.a/ ) {
+  staticlib = gensub (/([^ ]*)(lib[^ ]*\.a)/,"\\1\\2 ","g",list[i]);
+  print "cp " staticlib " ${destdir}";
+  }
+  if ( list[i] ~ /-l/ ) {
+  systemlib = gensub (/-l([^ ]*)/,"lib\\1.a ","g",list[i]);
+  print "systemlib=`find " libdir " -name " systemlib "`" ;
+  print "if [ \"${systemlib}\" != \"\" ]; then";
+  print "echo System lib found: ${systemlib}";
+  print "cp ${systemlib} ${destdir}";
+  print "else";
+  print "echo Library " systemlib " not found, shared library assumed";
+  print "fi";
+  }
+  }
+}
+' | tee copy-libs.sh
+chmod u+x ./copy-libs.sh
+# For later
+
+echo Creating ./gdblib.inc file
+# Generate gdblib.inc file
+cat comp-cmd.log |gawk -v gdbcvs=${gdbcvs} -v destdir=${destdir} -v gdbversion=${gdbversion} '
+BEGIN {
+  use_mingw=0;
+  print "{ libgdb.inc file generated by awk script }"
+  print "{$define GDB_V" gdbversion " }"
+  if (gdbcvs) {
+    print "{$define GDB_CVS}"
+  }
+  print "{$ifdef COMPILING_GDBINT_UNIT }"
+}
+
+{
+  nb = split ($0,list);
+
+  for (i=1; i<=nb; i++) {
+  if ( list[i] ~ /lib[^ ]*\.a/ ) {
+    staticlib = gensub (/([^ ]*)(lib[^ ]*\.a)/,"{$LINKLIB \\2} { found in \\1 }","g",list[i]);
+    print staticlib;
+    if ( list[i] ~/mingw/ ) {
+    use_mingw=1
+    }
+  }
+  if ( list[i] ~ /-l/ ) {
+    systemlib = gensub (/-l([^ ]*)/,"{$LINKLIB \\1} { with -l gcc option}","g",list[i]);
+    print systemlib;
+  }
+  }
+}
+END {
+  print "{$endif COMPILING_GDBINT_UNIT }"
+  print "{$undef NotImplemented}"
+  if ( use_mingw == 1 ) {
+    print "{$define USE_MINGW_GDB}"
+  }
+}
+' | tee  gdblib.inc
+
+

+ 179 - 2
packages/gdbint/src/gdbint.pp

@@ -26,8 +26,14 @@ unit GdbInt;
 
 { Possible optional conditionals:
   GDB_DISABLE_INTL              To explicitly not use libintl
+
+  GDB_DISABLE_PYTHON            To explicitly not use libpython,
+  if gdb was configured using --without-python
+
   GDB_CORE_ADDR_FORCE_64BITS    To force 64 bits for CORE_ADDR
+
   Verbose                       To test gdbint
+
   DebugCommand                  To debug Command method
 }
 
@@ -82,6 +88,7 @@ interface
   {$info using gdb 6.6.x}
   {$define GDB_V6}
   {$define GDB_HAS_DB_COMMANDS}
+  {$define GDB_USES_BP_LOCATION}
   {$define GDB_NEEDS_NO_ERROR_INIT}
   {$define GDB_USES_EXPAT_LIB}
   {$define GDB_HAS_DEBUG_FILE_DIRECTORY}
@@ -92,6 +99,7 @@ interface
   {$info using gdb 6.7.x}
   {$define GDB_V6}
   {$define GDB_HAS_DB_COMMANDS}
+  {$define GDB_USES_BP_LOCATION}
   {$define GDB_NEEDS_NO_ERROR_INIT}
   {$define GDB_USES_EXPAT_LIB}
   {$define GDB_HAS_DEBUG_FILE_DIRECTORY}
@@ -102,10 +110,13 @@ interface
   {$info using gdb 6.8.x}
   {$define GDB_V6}
   {$define GDB_HAS_DB_COMMANDS}
+  {$define GDB_USES_BP_LOCATION}
+  {$define GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
   {$define GDB_NEEDS_NO_ERROR_INIT}
   {$define GDB_USES_EXPAT_LIB}
   {$define GDB_HAS_DEBUG_FILE_DIRECTORY}
-  {$define GDB_HAS_OBSERVER_NOTIFY_BREAKPOINT_CREATED}
+  {$define GDB_USES_LIBDECNUMBER}
+  // {$define GDB_HAS_OBSERVER_NOTIFY_BREAKPOINT_CREATED}
   {$define GDB_HAS_BP_NONE}
 {$endif def GDB_V608}
 
@@ -119,14 +130,25 @@ interface
 {$ifdef GDB_V7}
   {$define GDB_V6}
   {$define GDB_HAS_DB_COMMANDS}
+  {$define GDB_USES_BP_LOCATION}
+  {$define GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+  {$define GDB_BP_LOCATION_HAS_GDBARCH}
   {$define GDB_NEEDS_NO_ERROR_INIT}
   {$define GDB_USES_EXPAT_LIB}
   {$define GDB_USES_LIBDECNUMBER}
   {$define GDB_USES_LIBINTL}
+  {$ifndef GDB_DISABLE_PYTHON}
+    {$define GDB_USES_LIBPYTHON}
+  {$endif}
   {$define GDB_HAS_DEBUG_FILE_DIRECTORY}
   {$define GDB_HAS_OBSERVER_NOTIFY_BREAKPOINT_CREATED}
   {$define GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
   {$define GDB_HAS_BP_NONE}
+
+  {$ifdef GDB_CVS}
+    {$define GDB_BP_LOCATION_HAS_GDBARCH}
+    {$define GDB_HAS_PROGRAM_SPACE}
+  {$endif GDB_CVS}
 {$endif def GDB_V7}
 
 
@@ -148,6 +170,17 @@ interface
   {$define GDB_HAS_SIM}
 {$endif cpupowerpc}
 
+{$ifdef Solaris}
+  {$ifdef Sparc}
+    { Sparc/i386 solaris gdb also supports 64bit mode, thus
+      CORE_ADDR is 8-byte long }
+    {$define GDB_CORE_ADDR_FORCE_64BITS}
+  {$endif Sparc}
+  {$ifdef i386}
+    {$define GDB_CORE_ADDR_FORCE_64BITS}
+  {$endif i386}
+{$endif Solaris}
+
 {$ifdef NotImplemented}
 {$ifdef go32v2}
   {$undef NotImplemented}
@@ -166,6 +199,9 @@ interface
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   {$ifndef GDB_DISABLE_INTL}
     {$LINKLIB intl}
   {$endif ndef GDB_DISABLE_INTL}
@@ -184,9 +220,15 @@ interface
   {$LINKLIB libopcodes.a}
   {$LINKLIB libhistory.a}
   {$LINKLIB libiberty.a}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   {$LINKLIB ncurses}
   {$LINKLIB m}
   {$LINKLIB dl}
@@ -214,11 +256,17 @@ interface
   {$ifndef GDB_DISABLE_INTL}
     {$LINKLIB intl}
   {$endif ndef GDB_DISABLE_INTL}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
      { does not seem to exist on netbsd LINKLIB dl,
                             but I use GDB CVS snapshots for the *BSDs}
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   {$LINKLIB c}
   {$LINKLIB gcc}
 {$endif freebsd}
@@ -238,14 +286,50 @@ interface
   {$LINKLIB m}
   {$LINKLIB iberty}
   {$LINKLIB intl}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   { does not seem to exist on netbsd LINKLIB dl}
   {$LINKLIB c}
   {$LINKLIB gcc}
 {$endif netbsd}
 
+{$ifdef solaris}
+  {$undef NotImplemented}
+  {$LINKLIB gdb}
+  {$ifdef GDB_HAS_SIM}
+    {$LINKLIB sim}
+  {$endif GDB_HAS_SIM}
+  {$LINKLIB bfd}
+  {$LINKLIB readline}
+  {$LINKLIB opcodes}
+  {$LINKLIB history}
+  {$LINKLIB iberty}
+  {$LINKLIB curses}
+  {$LINKLIB m}
+  {$LINKLIB iberty}
+  {$LINKLIB intl}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
+  {$ifdef GDB_USES_EXPAT_LIB}
+    {$LINKLIB expat}
+  {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
+  {$LINKLIB dl}
+  {$LINKLIB socket}
+  {$LINKLIB nsl}
+  {$LINKLIB c}
+{$endif solaris}
+
 {$ifdef openbsd}
   {$undef NotImplemented}
   {$LINKLIB gdb}
@@ -263,9 +347,15 @@ interface
   {$ifndef GDB_DISABLE_INTL}
     {$LINKLIB intl}
   {$endif ndef GDB_DISABLE_INTL}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   { does not seem to exist on netbsd LINKLIB dl}
   {$LINKLIB c}
   {$LINKLIB gcc}
@@ -292,20 +382,32 @@ interface
     {$LINKLIB libmingw32.a}
     {$LINKLIB libmsvcrt.a}
     {$LINKLIB libdecnumber.a}
+    {$ifdef GDB_USES_LIBDECNUMBER}
+      {$LINKLIB decnumber}
+    {$endif GDB_USES_LIBDECNUMBER}
     {$ifdef GDB_USES_EXPAT_LIB}
       {$LINKLIB expat}
     {$endif GDB_USES_EXPAT_LIB}
+    {$ifdef GDB_USES_LIBPYTHON}
+      {$LINKLIB python}
+    {$endif GDB_USES_LIBPYTHON}
   {$else not USE_MINGW_GDB}
     {$LINKLIB libiconv.a}
     {$LINKLIB libncurses.a}
+    {$ifdef GDB_USES_LIBDECNUMBER}
+      {$LINKLIB decnumber}
+    {$endif GDB_USES_LIBDECNUMBER}
     {$ifdef GDB_USES_EXPAT_LIB}
       {$LINKLIB expat}
     {$endif GDB_USES_EXPAT_LIB}
+    {$ifdef GDB_USES_LIBPYTHON}
+      {$LINKLIB python}
+    {$endif GDB_USES_LIBPYTHON}
     {$LINKLIB gcc}
     {$LINKLIB cygwin} { alias of libm.a and libc.a }
   {$LINKLIB libintl.a}
   {$LINKLIB imagehlp}
-  {$endif not USE_MINGW_GDB}	
+  {$endif not USE_MINGW_GDB}
   {$LINKLIB kernel32}
   {$LINKLIB user32}
 {$endif win32}
@@ -327,9 +429,15 @@ interface
   {$ifndef GDB_DISABLE_INTL}
     {$LINKLIB intl}
   {$endif ndef GDB_DISABLE_INTL}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
   {$ifdef GDB_USES_EXPAT_LIB}
     {$LINKLIB expat}
   {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
   { does not seem to exist on netbsd LINKLIB dl}
   { $ LINKLIB c} // This is libroot under BeOS, and always linked
   {$LINKLIB debug}
@@ -702,6 +810,14 @@ type
 
      bpdisp = (del,del_at_next_stop,disable,donttouch);
 
+     pbp_location = ^bp_location;
+
+     bp_loc_type = (bp_loc_software_breakpoint, bp_loc_hardware_breakpoint,
+                    bp_loc_hardware_watchpoint, bp_loc_other);
+
+
+     target_hw_bp_type = (hw_write, hw_read, hw_access, hw_execute);
+
 {$PACKRECORDS 4}
      pbreakpoint = ^breakpoint;
      breakpoint = record
@@ -710,14 +826,20 @@ type
           enable : tenable;
           disposition : bpdisp;
           number : longint;
+{$ifdef GDB_USES_BP_LOCATION}
+          loc : pbp_location;
+{$else not GDB_USES_BP_LOCATION}
           address : CORE_ADDR;
+{$endif not GDB_USES_BP_LOCATION}
           line_number : longint;
           source_file : pchar;
           silent : byte;
           ignore_count : longint;
+{$ifndef GDB_USES_BP_LOCATION}
           shadow_contents : array[0..15] of char;
           inserted : char;
           duplicate : char;
+{$endif not GDB_USES_BP_LOCATION}
           commands : pointer; {^command_line}
           frame : CORE_ADDR;
           cond : pointer; {^expression}
@@ -737,6 +859,49 @@ type
           section : pointer; {^asection}
        end;
 
+     bp_target_info = record
+          placed_address_space : pointer;{paddress_space;}
+          placed_address : CORE_ADDR;
+          shadow_contents : array[0..15] of char;
+          shadow_len : longint;
+          placed_size : longint;
+       end;
+
+     bp_location = record
+         next : pbp_location;
+{$ifdef GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         global_next : pbp_location;
+{$endif GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         loc_type : bp_loc_type;
+         owner : pbreakpoint;
+{$ifdef GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         cond : pointer;{pexpression;}
+         shlib_disabled : byte;
+         enabled : byte;
+{$endif GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         inserted : byte;
+         duplicate : byte;
+{$ifdef GDB_BP_LOCATION_HAS_GDBARCH}
+         gdbarch : pointer;{pgdbarch;}
+{$endif GDB_BP_LOCATION_HAS_GDBARCH}
+{$ifdef GDB_HAS_PROGRAM_SPACE}
+         pspace : pointer;{pprogram_space;}
+{$endif GDB_HAS_PROGRAM_SPACE}
+         address : CORE_ADDR;
+{$ifdef GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         length : longint;
+         watchpoint_type : target_hw_bp_type;
+{$endif GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         section : pointer;{pobj_section;}
+         requested_address : CORE_ADDR;
+{$ifdef GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         function_name : ^char;
+{$endif GDB_BP_LOCATION_HAS_GLOBAL_NEXT}
+         target_info : bp_target_info;
+         overlay_target_info : bp_target_info;
+         events_till_retirement : longint;
+      end;
+
      tfreecode=(free_nothing,free_contents,free_linetable);
 
      psymtab = ^symtab;
@@ -765,6 +930,9 @@ type
 
      psymtab_and_line = ^symtab_and_line;
      symtab_and_line = record
+         {$ifdef GDB_HAS_PROGRAM_SPACE}
+         pspace : pointer;
+         {$endif GDB_HAS_PROGRAM_SPACE}
           symtab : psymtab;
           section : pointer; {^asection;}
           line : longint;
@@ -2177,7 +2345,12 @@ var
   not restored correctly PM }
   procedure get_pc_line;
     begin
+
+{$ifdef GDB_USES_BP_LOCATION}
+      sym:=find_pc_line(b.loc^.address,0);
+{$else not GDB_USES_BP_LOCATION}
       sym:=find_pc_line(b.address,0);
+{$endif not GDB_USES_BP_LOCATION}
     end;
 begin
   get_pc_line;
@@ -2187,7 +2360,11 @@ begin
      { function breakpoints have zero as file and as line !!
        but they are valid !! }
      invalid_breakpoint_line:=(b.line_number<>sym.line) and (b.line_number<>0);
+{$ifdef GDB_USES_BP_LOCATION}
+     last_breakpoint_address:=b.loc^.address;
+{$else not GDB_USES_BP_LOCATION}
      last_breakpoint_address:=b.address;
+{$endif not GDB_USES_BP_LOCATION}
      last_breakpoint_line:=sym.line;
      if assigned(sym.symtab) then
       last_breakpoint_file:=sym.symtab^.filename