public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@luukku.com>
To: Prasanna - Khanapur <bdm_future@rediffmail.com>
Cc: insight@sources.redhat.com, Keith Seitz <keiths@redhat.com>
Subject: Re: Clarifications regarding BDM GDB Insight for M68k
Date: Tue, 16 Apr 2002 06:54:00 -0000	[thread overview]
Message-ID: <3CBC2D06.59035232@luukku.com> (raw)
In-Reply-To: <20020415161710.22178.qmail@webmail23.rediffmail.com>

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

  parent reply	other threads:[~2002-04-16 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-15  9:25 Prasanna - Khanapur
2002-04-15  9:32 ` Keith Seitz
2002-04-16  6:54 ` Kai Ruottu [this message]
2002-04-16  9:07   ` Keith Seitz
  -- strict thread matches above, loose matches on Subject: below --
2002-04-14 23:09 Prasanna - Khanapur
2002-04-15  8:07 ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CBC2D06.59035232@luukku.com \
    --to=kai.ruottu@luukku.com \
    --cc=bdm_future@rediffmail.com \
    --cc=insight@sources.redhat.com \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).