This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bfd patch for gdb cross-debugging support


On Sat, 2009-09-19 at 11:01 +0200, Danny Backx wrote:
> On Tue, 2009-09-15 at 16:52 -0700, Ian Lance Taylor wrote:
> > Danny Backx <danny.backx@scarlet.be> writes:
> > 
> > > On Mon, 2009-09-14 at 09:08 -0700, Ian Lance Taylor wrote:
> > >> Aside from API issues, I will note that using a global variable is not
> > >> an ideal choice when BFD is compiled as a shared library.
> > >
> > > You're implying that I extend some existing data structure with a field.
> > > Is this structure the "struct bfd" ?
> > 
> > No, sorry, I'm implying that you should use a static variable with a
> > function API.  Much as you understood before.  Sorry for the confusion.
> > 
> > (There is nothing wrong with global or static variables referenced only
> > within a shared library.  Having the main program refer to a global
> > variable defined in a shared library works, but has various issues I
> > won't go into here.  The latter is best avoided when possible.)
> 
> Ok. Here is a next version of my work.
> 
> I'm showing this early so I don't go too far in the wrong direction,
> it's not finished.
> 
> I've not been overly ambitious, just cleaned up most of the
> HAVE_DOS_BASED_FILE_SYSTEM stuff. There may be code to be merged from
> all the places where the filesystem prefix ("A:") is taken into account.
> 
> Comments please.
> 
> 	Danny

Oops, I didn't include the new file (bfd/filesystem.c). Attached now.

	Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
/* bfd filesystem (is it DOS-like or not) support stuff
   Copyright 2009,
   Free Software Foundation, Inc.
   Written by Danny Backx.

   This file is part of BFD, the Binary File Descriptor library.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"

#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
static int _have_dos_based_file_system = 1;
#else
static int _have_dos_based_file_system = 0;
#endif

int have_dos_based_file_system(void)
{
	return _have_dos_based_file_system;
}

void set_dos_based_file_system(int v)
{
	_have_dos_based_file_system = v;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]