public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Re: Clarifications regarding BDM GDB Insight for M68k
@ 2002-04-15  9:25 Prasanna - Khanapur
  2002-04-15  9:32 ` Keith Seitz
  2002-04-16  6:54 ` Kai Ruottu
  0 siblings, 2 replies; 5+ messages in thread
From: Prasanna - Khanapur @ 2002-04-15  9:25 UTC (permalink / raw)
  To: insight; +Cc: Keith Seitz

hello,
Thanks for the info.
According to the following link:
http://www.vas-gmbh.de/software/mpcbdm
for running the bdm,I have to use the Insight-GDB 5.0 version 
itself.

I could solve the undefined reference in libgui using -D_WIN32.
But the few other error still persists as fallows:

*****************************************************
gcc -g -O2       -Wl,--subsystem,console -o gdb.exe main.o
libgdb.a    ../bfd/libbfd.a ../readline/libreadl
libgdb.a(gdbtk.o): In function `initialize_gdbtk':
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:603:
undefined reference to `FreeConsole'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:609:
undefined reference to `GetStdHandle'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:609:
undefined reference to `GetFileType'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:620:
undefined reference to `AllocConsole'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:621:
undefined reference to `GetStdHandle'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:624:
undefined reference to `GetStdHandle'
/home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:627:
undefined reference to `GetStdHandle'
collect2: ld returned 1 exit status
make[1]: *** [gdb.exe] Error 1
make[1]: Leaving directory
`/home/taxi/insight-5.0/insight-5.0/gdb'
make: *** [all-gdb] Error 2
******************************************************


I searched for the function "FreeConsole()" and could find it in 
the /cygwin/lib/w32api/  in the libkernel32.a.
The following was output after nm.exe:



*****************************************************

$ nm libkernel32.a |grep FreeConsole
00000000 T _FreeConsole@0
00000000 I __imp__FreeConsole@0

****************************************************

So I guess that the definition of the unreferenced function is 
present in the libkernel32.a.
I added the libkernel32.a to the final linking of gdb.exe.
But still the error persist , what could be the problem?
Am I using the right library or does the order of the linking 
matters?

Regards
Prasanna


On Mon, 15 Apr 2002 Keith Seitz wrote :
>On 15 Apr 2002, Prasanna - Khanapur wrote:
>
> > Hello,
> > I'm trying to make Insight GDB BDM for M68k processor in 
>cygwin
> > environment on an WINNT machine.
> > I installed the latest cygwin version on the WINNT and
> > uncomopressed the insight-5.0.tar.bz2 file on the cygwin 
>dir.
>
>Insight-5.0 is not the latest version. Make sure you are trying 
>to build
>insight-5.1.
>
>Your libgui problems should be fixed by using "-mwin32". There 
>was a
>change in gcc for cygwin between 5.0 and 5.1 which necessitates 
>this flag.
>I don't recall if the 5.1 branch sources have this in it or not, 
>so it
>might be needed there. (And don't include '-mwin32' everywhere -- 
>just put
>it where needed.)
>
>Please verify which version of insight you are trying to build 
>and get
>back to us.
>
>Keith
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Clarifications regarding BDM GDB Insight for M68k
  2002-04-15  9:25 Re: Clarifications regarding BDM GDB Insight for M68k Prasanna - Khanapur
@ 2002-04-15  9:32 ` Keith Seitz
  2002-04-16  6:54 ` Kai Ruottu
  1 sibling, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2002-04-15  9:32 UTC (permalink / raw)
  To: Prasanna - Khanapur; +Cc: insight

On 15 Apr 2002, Prasanna - Khanapur wrote:

> http://www.vas-gmbh.de/software/mpcbdm
> for running the bdm,I have to use the Insight-GDB 5.0 version
> itself.

Ah, ok. I see. Too bad: insight 5.0 is really, ummm, marginal.

> But the few other error still persists as fallows:
>
> *****************************************************
> gcc -g -O2       -Wl,--subsystem,console -o gdb.exe main.o
> libgdb.a    ../bfd/libbfd.a ../readline/libreadl
> libgdb.a(gdbtk.o): In function `initialize_gdbtk':
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:603:
> undefined reference to `FreeConsole'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:609:
> undefined reference to `GetStdHandle'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:609:
> undefined reference to `GetFileType'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:620:
> undefined reference to `AllocConsole'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:621:
> undefined reference to `GetStdHandle'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:624:
> undefined reference to `GetStdHandle'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:627:
> undefined reference to `GetStdHandle'
> collect2: ld returned 1 exit status
> make[1]: *** [gdb.exe] Error 1

Yes, you are correct: you need to link against kernel32.

> But still the error persist , what could be the problem?
> Am I using the right library or does the order of the linking
> matters?

It often does. Did you put it last in the list of libraries?

Keith


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clarifications regarding BDM GDB Insight for M68k
  2002-04-15  9:25 Re: Clarifications regarding BDM GDB Insight for M68k Prasanna - Khanapur
  2002-04-15  9:32 ` Keith Seitz
@ 2002-04-16  6:54 ` Kai Ruottu
  2002-04-16  9:07   ` Keith Seitz
  1 sibling, 1 reply; 5+ messages in thread
From: Kai Ruottu @ 2002-04-16  6:54 UTC (permalink / raw)
  To: Prasanna - Khanapur; +Cc: insight, Keith Seitz

Prasanna - Khanapur wrote:
> 
> But the few other error still persists as fallows:
> 
> *****************************************************
> gcc -g -O2       -Wl,--subsystem,console -o gdb.exe main.o
> libgdb.a    ../bfd/libbfd.a ../readline/libreadl
> libgdb.a(gdbtk.o): In function `initialize_gdbtk':
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:603:
> undefined reference to `FreeConsole'
> /home/taxi/insight-5.0/insight-5.0/gdb/./gdbtk/generic/gdbtk.c:609:
> undefined reference to `GetStdHandle'
> 
> I searched for the function "FreeConsole()" and could find it in
> the /cygwin/lib/w32api/  in the libkernel32.a.
> The following was output after nm.exe:
> 
> *****************************************************
> 
> $ nm libkernel32.a |grep FreeConsole
> 00000000 T _FreeConsole@0
> 00000000 I __imp__FreeConsole@0
> 
> ****************************************************

 As you can see the symbol name is not 'FreeConsole', but instead
'FreeConsole@0' !!!  So here should be your clue and asking why
the '@0' is there would give you a sane answer from anyone familiar
with the Cygwin or Mingw target...

> So I guess that the definition of the unreferenced function is
> present in the libkernel32.a.
> I added the libkernel32.a to the final linking of gdb.exe.
> But still the error persist , what could be the problem?

 The answer is that the function prototype should declare this being
a 'WINAPI'-function :

    E:\usr\local\i386-mingw32msvc\sys-include>grep FreeConsole *.h
    wincon.h:BOOL WINAPI FreeConsole(void);

 The 'w32api'-headers (should be common for Cygwin and Mingw) should
declare this function as seen previously... So the 'gdbtk.c' doesn't
include the needed 'wincon.h' directly or via some other header, and
this causes the symbol name not being 'mangled' this way...

 I don't know whether '#include <windows.h>' should include <wincon.h>
too, or not, or what could be the 'right' fix... It can be to add the
'#include <wincon.h>' into some w32api-header which should now include
it, or to add this into the 'gdbtk.c' itself. But as an local workaround
the last choice could be the best...

Cheers, Kai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Clarifications regarding BDM GDB Insight for M68k
  2002-04-16  6:54 ` Kai Ruottu
@ 2002-04-16  9:07   ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2002-04-16  9:07 UTC (permalink / raw)
  To: Prasanna - Khanapur; +Cc: Insight Maling List

On Tue, 16 Apr 2002, Kai Ruottu wrote:

> > *****************************************************
> >
> > $ nm libkernel32.a |grep FreeConsole
> > 00000000 T _FreeConsole@0
> > 00000000 I __imp__FreeConsole@0
> >
> > ****************************************************
>
>  As you can see the symbol name is not 'FreeConsole', but instead
> 'FreeConsole@0' !!!  So here should be your clue and asking why
> the '@0' is there would give you a sane answer from anyone familiar
> with the Cygwin or Mingw target...

Doh! I completely overlooked this.. What happens when you use "-mwin32"
instbead of "-D_WIN32" (or in addition to)?

Keith


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Clarifications regarding BDM GDB Insight for M68k
@ 2002-04-16 23:03 Prasanna - Khanapur
  0 siblings, 0 replies; 5+ messages in thread
From: Prasanna - Khanapur @ 2002-04-16 23:03 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Insight Maling List

Hi,
It works now.!
I tried "-mwin32" in the makefile at the highiest level and I 
don't have any problems in building the gdb.

thanx for the suggestions
Prasanna



On Tue, 16 Apr 2002 Keith Seitz wrote :
>On Tue, 16 Apr 2002, Kai Ruottu wrote:
>
> > > *****************************************************
> > >
> > > $ nm libkernel32.a |grep FreeConsole
> > > 00000000 T _FreeConsole@0
> > > 00000000 I __imp__FreeConsole@0
> > >
> > > ****************************************************
> >
> >  As you can see the symbol name is not 'FreeConsole', but 
>instead
> > 'FreeConsole@0' !!!  So here should be your clue and asking 
>why
> > the '@0' is there would give you a sane answer from anyone 
>familiar
> > with the Cygwin or Mingw target...
>
>Doh! I completely overlooked this.. What happens when you use 
>"-mwin32"
>instbead of "-D_WIN32" (or in addition to)?
>
>Keith
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-04-17  6:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-15  9:25 Re: Clarifications regarding BDM GDB Insight for M68k Prasanna - Khanapur
2002-04-15  9:32 ` Keith Seitz
2002-04-16  6:54 ` Kai Ruottu
2002-04-16  9:07   ` Keith Seitz
2002-04-16 23:03 Prasanna - Khanapur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).