Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
79 user(s) are online (63 user(s) are browsing Forums)

Members: 0
Guests: 79

more...

Support us!

Headlines

Report message:*
 

Re: GDB

Subject: Re: GDB
by billyfish on 2021/2/23 17:57:45

Ok so after a few debugging printf () calls, the failing function is

fseeko64 ()

int
real_fseek 
(FILE *filefile_ptr offsetint whence)
{
#if defined (HAVE_FSEEKO64)
printf ("using fseeko64n");
    return 
fseeko64 (fileoffsetwhence);
#elif defined (HAVE_FSEEKO)
    
printf ("using fseekon");
  return 
fseeko (fileoffsetwhence);
#else
  
printf ("using fseekn");
  return 
fseek (fileoffsetwhence);
#endif
}


from bfd/bfdio.c:57


(gdbfile helloworld
file helloworld
0 calling bfd seek with Workspace
:/helloworld with pos 0 (8) and direction 0 (4)
bfd_seek called with Workspace:/helloworld with pos 0 (8) and direction 0 (4)
bfd_seek called with Workspace:/helloworld with pos 0 (8) and direction 0 (4)
cache_bseek f not null with Workspace:/helloworld with pos 12060 (8) and direction 0 (4)
using fseeko64
real_fseek returned 
-1 with Workspac:/helloworld with pos 12060 (8) and direction 0 (4)
1seeking Workspace:/helloworld with pos 12060 and direction 0 has result 89
4
seeking Workspace:/helloworld has error 29
returning Workspace
:/helloworld 89
"Workspace:/helloworld"not in executable formatIllegal seek
(gdb)



Reverting to the standard c versions by adding


#ifdef __amigaos4__
#undef HAVE_FSEEKO64
#undef HAVE_FSEEKO
#undef HAVE_FTELLO64
#undef HAVE_FTELLO
#undef HAVE_FOPEN64
#endif


to bfdio.c, we get

4.Workspace:> gdb-newlib
GNU gdb 
(GDB7.5.1
Copyright 
(C2012 Free Software FoundationInc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free softwareyou are free to change and redistribute it.
There is NO WARRANTYto the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "ppc-amigaos".
For 
bug reporting instructionsplease see:
<
http://www.gnu.org/software/gdb/bugs/>.
(gdbfile helloworld
file helloworld
0 calling bfd seek with Workspace
:/helloworld with pos 0 (8) and direction 0 (4)
bfd_seek called with Workspace:/helloworld with pos 0 (8) and direction 0 (4)
bfd_seek called with Workspace:/helloworld with pos 0 (8) and direction 0 (4)
cache_bseek f not null with Workspace:/helloworld with pos 12060 (8) and direction 0 (4)
using fseek
real_fseek returned 0 with Workspace
:/helloworld with pos 12060 (8) and direction 0 (4)
1seeking Workspace:/helloworld with pos 12060 and direction 0 has result 88
4
seeking Workspace:/helloworld has error 2
returning Workspace
:/helloworld 88
"Workspace:/helloworld"not in executable formatNo such file or directory
(gdb)



Which is a slight improvement and hopefully by setting

HAVE_FSEEKO64
HAVE_FSEEKO
HAVE_FTELLO64
HAVE_FTELLO
HAVE_FOPEN64

etc., correctly across the entire project we may be getting there as I'm hoping the later failure is due to other parts of the io code still using the "o64" function calls.



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project