From: asmwarrior <asmwarrior@gmail.com>
To: Pedro Alves <palves@redhat.com>,
GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program
Date: Mon, 16 Mar 2015 08:20:00 -0000 [thread overview]
Message-ID: <550693AB.60007@gmail.com> (raw)
In-Reply-To: <55068495.5040205@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 618 bytes --]
OK, I now successfully build gdb.exe and gdbserver.exe!
To handle the INT32_MAX and INT32_MIN macro definition issue, I just have:
#ifndef INT32_MIN
#define INT32_MIN INT_MIN
#endif
#ifndef INT32_MAX
#define INT32_MAX INT_MAX
#endif
Before
#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
#endif
In either:
mybuildcpp\gdb\gdbserver\build-gnulib-gdbserver\import\inttypes.h
and
mybuildcpp\gdb\build-gnulib\import\inttypes.h
The total patch I use is in attachment.
Yuanhui Zhang
[-- Attachment #2: 0001-build-fix-when-using-enable-build-with-cxx-option-un.patch --]
[-- Type: text/x-c++, Size: 6746 bytes --]
From d0a34a8b8491f3aae0a7e13e6a5f0a1969aac1dd Mon Sep 17 00:00:00 2001
From: asmwarrior <asmwarrior@gmail.com>
Date: Mon, 16 Mar 2015 16:23:38 +0800
Subject: [PATCH] build fix when using --enable-build-with-cxx option under
MinGW.
---
gdb/gdb_curses.h | 2 +-
gdb/stub-termcap.c | 22 ++++++++++++++--------
gdb/windows-nat.c | 38 +++++++++++++++++++-------------------
3 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/gdb/gdb_curses.h b/gdb/gdb_curses.h
index 9b3707a..d02cab3 100644
--- a/gdb/gdb_curses.h
+++ b/gdb/gdb_curses.h
@@ -51,7 +51,7 @@
of the termcap functions will be built from stub-termcap.c. Readline
provides its own extern declarations when there's no termcap.h; do the
same here for the termcap functions used in GDB. */
-extern int tgetnum (const char *);
+extern "C" int tgetnum (const char *);
#endif
/* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */
diff --git a/gdb/stub-termcap.c b/gdb/stub-termcap.c
index cc8632c..a2e833a 100644
--- a/gdb/stub-termcap.c
+++ b/gdb/stub-termcap.c
@@ -23,14 +23,20 @@
#include "defs.h"
#include <stdlib.h>
-
+#ifdef __cplusplus
+extern "C" {
+#endif
/* -Wmissing-prototypes */
-extern int tgetent (char *buffer, char *termtype);
-extern int tgetnum (char *name);
-extern int tgetflag (char *name);
-extern char* tgetstr (char *name, char **area);
-extern int tputs (char *string, int nlines, int (*outfun) ());
-extern char *tgoto (const char *cap, int col, int row);
+int tgetent (char *buffer, char *termtype);
+int tgetnum (char *name);
+int tgetflag (char *name);
+char* tgetstr (char *name, char **area);
+int tputs (char *string, int nlines, int (*outfun) (char *));
+char *tgoto (const char *cap, int col, int row);
+#ifdef __cplusplus
+}
+#endif
+
/* Each of the files below is a minimal implementation of the standard
termcap function with the same name, suitable for use in a Windows
@@ -61,7 +67,7 @@ tgetstr (char *name, char **area)
}
int
-tputs (char *string, int nlines, int (*outfun) ())
+tputs (char *string, int nlines, int (*outfun) (char *))
{
while (*string)
outfun (*string++);
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 49c09d3..f812a2c 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -189,16 +189,16 @@ typedef struct thread_info_struct
CONTEXT context;
STACKFRAME sf;
}
-thread_info;
+thread_info_windows;
-static thread_info thread_head;
+static thread_info_windows thread_head;
/* The process and thread handles for the above context. */
static DEBUG_EVENT current_event; /* The current debug event from
WaitForDebugEvent */
static HANDLE current_process_handle; /* Currently executing process */
-static thread_info *current_thread; /* Info on currently selected thread */
+static thread_info_windows *current_thread; /* Info on currently selected thread */
static DWORD main_thread_id; /* Thread ID of the main thread */
/* Counts of things. */
@@ -291,10 +291,10 @@ check (BOOL ok, const char *file, int line)
/* Find a thread record given a thread id. If GET_CONTEXT is not 0,
then also retrieve the context for this thread. If GET_CONTEXT is
negative, then don't suspend the thread. */
-static thread_info *
+static thread_info_windows *
thread_rec (DWORD id, int get_context)
{
- thread_info *th;
+ thread_info_windows *th;
for (th = &thread_head; (th = th->next) != NULL;)
if (th->id == id)
@@ -331,10 +331,10 @@ thread_rec (DWORD id, int get_context)
}
/* Add a thread to the thread list. */
-static thread_info *
+static thread_info_windows *
windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
{
- thread_info *th;
+ thread_info_windows *th;
DWORD id;
gdb_assert (ptid_get_tid (ptid) != 0);
@@ -344,7 +344,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
if ((th = thread_rec (id, FALSE)))
return th;
- th = XCNEW (thread_info);
+ th = XCNEW (thread_info_windows);
th->id = id;
th->h = h;
th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
@@ -374,13 +374,13 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
static void
windows_init_thread_list (void)
{
- thread_info *th = &thread_head;
+ thread_info_windows *th = &thread_head;
DEBUG_EVENTS (("gdb: windows_init_thread_list\n"));
init_thread_list ();
while (th->next != NULL)
{
- thread_info *here = th->next;
+ thread_info_windows *here = th->next;
th->next = here->next;
xfree (here);
}
@@ -391,7 +391,7 @@ windows_init_thread_list (void)
static void
windows_delete_thread (ptid_t ptid, DWORD exit_code)
{
- thread_info *th;
+ thread_info_windows *th;
DWORD id;
gdb_assert (ptid_get_tid (ptid) != 0);
@@ -412,7 +412,7 @@ windows_delete_thread (ptid_t ptid, DWORD exit_code)
if (th->next != NULL)
{
- thread_info *here = th->next;
+ thread_info_windows *here = th->next;
th->next = here->next;
xfree (here);
}
@@ -446,7 +446,7 @@ do_windows_fetch_inferior_registers (struct regcache *regcache, int r)
else
#endif
{
- thread_info *th = current_thread;
+ thread_info_windows *th = current_thread;
th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
CHECK (GetThreadContext (th->h, &th->context));
/* Copy dr values from that thread.
@@ -1080,7 +1080,7 @@ display_selectors (char * args, int from_tty)
static int
handle_exception (struct target_waitstatus *ourstatus)
{
- thread_info *th;
+ thread_info_windows *th;
DWORD code = current_event.u.Exception.ExceptionRecord.ExceptionCode;
ourstatus->kind = TARGET_WAITKIND_STOPPED;
@@ -1211,7 +1211,7 @@ static BOOL
windows_continue (DWORD continue_status, int id, int killed)
{
int i;
- thread_info *th;
+ thread_info_windows *th;
BOOL res;
DEBUG_EVENTS (("ContinueDebugEvent (cpid=%d, ctid=0x%x, %s);\n",
@@ -1289,7 +1289,7 @@ static void
windows_resume (struct target_ops *ops,
ptid_t ptid, int step, enum gdb_signal sig)
{
- thread_info *th;
+ thread_info_windows *th;
DWORD continue_status = DBG_CONTINUE;
/* A specific PTID means `step only this thread id'. */
@@ -1412,8 +1412,8 @@ get_windows_debug_event (struct target_ops *ops,
{
BOOL debug_event;
DWORD continue_status, event_code;
- thread_info *th;
- static thread_info dummy_thread_info;
+ thread_info_windows *th;
+ static thread_info_windows dummy_thread_info;
int retval = 0;
last_sig = GDB_SIGNAL_0;
@@ -2551,7 +2551,7 @@ static int
windows_get_tib_address (struct target_ops *self,
ptid_t ptid, CORE_ADDR *addr)
{
- thread_info *th;
+ thread_info_windows *th;
th = thread_rec (ptid_get_tid (ptid), 0);
if (th == NULL)
--
1.9.5.msysgit.0
next prev parent reply other threads:[~2015-03-16 8:20 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 23:20 Pedro Alves
2015-02-09 23:20 ` [PATCH 02/36] Add --enable-build-with-cxx configure switch Pedro Alves
2015-02-10 22:11 ` Yao Qi
2015-02-27 13:24 ` Pedro Alves
2015-02-27 14:20 ` Yao Qi
2015-02-27 16:29 ` Pedro Alves
2015-02-09 23:21 ` [PATCH 29/36] Normalize TRY_CATCH exception handling block Pedro Alves
2015-02-09 23:21 ` [PATCH 27/36] catch_command_errors: Remove 'mask' parameter Pedro Alves
2015-02-09 23:21 ` [PATCH 04/36] Fix struct, union, and enum nesting in C++ Pedro Alves
2015-02-09 23:21 ` [PATCH 26/36] Adjust self tests to cope with GDB built as a C++ program Pedro Alves
2015-02-09 23:21 ` [PATCH 03/36] C++ keyword cleanliness, mostly auto-generated Pedro Alves
2015-02-11 7:57 ` Joel Brobecker
2015-02-11 8:52 ` Phil Muldoon
2015-02-11 10:27 ` Pedro Alves
2015-02-11 10:51 ` Pedro Alves
2015-02-12 12:19 ` Joel Brobecker
2015-02-12 13:14 ` Pedro Alves
2015-02-12 14:43 ` Pedro Alves
2015-02-12 14:59 ` Joel Brobecker
2015-02-27 17:41 ` Pedro Alves
2015-02-09 23:21 ` [PATCH 19/36] Exported const objects Pedro Alves
2015-02-09 23:21 ` [PATCH 16/36] x86 Linux/ptrace: fix offsetof usage in C++ mode Pedro Alves
2015-02-09 23:21 ` [PATCH 25/36] python/python-internal.h: enum ‘ext_lang_rc’ not defined Pedro Alves
2015-02-09 23:21 ` [PATCH 28/36] Move exception_none to common code, and use it Pedro Alves
2015-02-09 23:21 ` [PATCH 17/36] mi/mi-cmd-stack.c|frame filters: print_values <-> ext_lang_frame_args Pedro Alves
2015-02-09 23:21 ` [PATCH 11/36] Make functions and variables exported by the IPA be extern "C" Pedro Alves
2015-02-09 23:21 ` [PATCH 22/36] Remove duplicate const Pedro Alves
2015-02-09 23:21 ` [PATCH 23/36] gdbarch.h: include regcache.h Pedro Alves
2015-02-09 23:21 ` [PATCH 15/36] Don't forward declare enum target_hw_bp_type Pedro Alves
2015-02-09 23:21 ` [PATCH 31/36] Split TRY_CATCH into TRY + CATCH Pedro Alves
2015-03-07 15:58 ` Pedro Alves
2015-02-09 23:21 ` [PATCH 12/36] proc-service, extern "C" Pedro Alves
2015-02-09 23:21 ` [PATCH 05/36] Fix redefinition errors in C++ mode Pedro Alves
2015-02-11 10:09 ` Yao Qi
2015-02-11 11:30 ` Pedro Alves
2015-02-11 11:39 ` [PATCH] xcoffread.c: delete 'within_function' definition (Re: [PATCH 05/36] Fix redefinition errors in C++ mode) Pedro Alves
2015-02-09 23:21 ` [PATCH 09/36] floatformat.h: Wrap in extern "C" Pedro Alves
2015-02-09 23:35 ` Andrew Pinski
2015-02-09 23:49 ` Pedro Alves
2015-02-12 11:49 ` Pedro Alves
2015-02-18 19:55 ` Jakub Jelinek
2015-02-14 17:29 ` Doug Evans
2015-02-14 18:36 ` Pedro Alves
2015-02-14 22:46 ` Doug Evans
2015-02-09 23:21 ` [PATCH 08/36] elf-bfd.h: " Pedro Alves
2015-02-09 23:33 ` Andrew Pinski
2015-02-10 12:05 ` [PATCH v2] Wrap BFD headers " Pedro Alves
2015-02-11 0:36 ` Alan Modra
2015-02-11 10:08 ` Pedro Alves
2015-02-09 23:21 ` [PATCH 20/36] gdbserver/tracepoint: Add cast sockaddr_un/sockaddr cast Pedro Alves
2015-02-09 23:21 ` [PATCH 13/36] target.h: Include infrun.h Pedro Alves
2015-02-09 23:21 ` [PATCH 21/36] opcodes/microblaze: Rename 'or', 'and', 'xor' to avoid C++ conflict Pedro Alves
2015-02-10 15:05 ` Michael Eager
2015-02-10 18:11 ` Pedro Alves
2015-02-09 23:22 ` [PATCH 36/36] Make TRY/CATCH use real C++ try/catch in C++ mode Pedro Alves
2015-02-09 23:22 ` [PATCH 32/36] TRY_CATCH -> TRY+CATCH+END_CATCH everywhere Pedro Alves
2015-02-09 23:22 ` [PATCH 33/36] TRY_CATCH -> TRY+CATCH+END_CATCH, the manual conversions Pedro Alves
2015-02-09 23:35 ` [PATCH 18/36] Rename struct lzma_stream to avoid clash with system header Pedro Alves
2015-02-09 23:45 ` [PATCH 06/36] record-btrace.c: Remove redefinitions Pedro Alves
2015-02-09 23:46 ` [PATCH 35/36] kill volatile struct gdb_exception Pedro Alves
2015-02-09 23:49 ` [PATCH 00/36] Support building GDB as a C++ program Doug Evans
2015-02-09 23:50 ` [PATCH 34/36] more making TRY/CATCH callers look more like real C++ try/catch blocks Pedro Alves
2015-03-07 15:59 ` Pedro Alves
2015-02-09 23:51 ` [PATCH 14/36] Do not do arithmetic on enum types Pedro Alves
2015-02-09 23:51 ` [PATCH 07/36] Make array object extern Pedro Alves
2015-02-27 22:47 ` Simon Marchi
2015-02-27 22:58 ` Pedro Alves
2015-02-27 23:04 ` Simon Marchi
2015-02-09 23:53 ` [PATCH 01/36] Create libiberty/libiberty.m4, have GDB and GDBserver use it Pedro Alves
2015-02-09 23:35 ` Pedro Alves
2015-02-27 16:23 ` Pedro Alves
2015-02-09 23:54 ` [PATCH 30/36] quit_force: Replace TRY_CATCH wrapper macros Pedro Alves
2015-02-09 23:54 ` [PATCH 10/36] Add extern "C" to declarations of C symbols Pedro Alves
2015-02-11 11:51 ` Pedro Alves
2015-02-10 0:21 ` [PATCH 24/36] breakpoint.h: move enum ‘print_stop_action’ Pedro Alves
2015-02-11 12:28 ` Yao Qi
2015-02-10 15:07 ` [PATCH 00/36] Support building GDB as a C++ program Michael Eager
2015-02-11 17:15 ` Yao Qi
2015-02-12 11:34 ` Pedro Alves
2015-02-17 23:19 ` Patrick Palka
2015-02-18 21:54 ` Yao Qi
2015-02-18 23:49 ` Patrick Palka
2015-02-27 18:19 ` Pedro Alves
2015-02-27 23:52 ` Patrick Palka
2015-02-28 0:09 ` Pedro Alves
2015-03-07 16:01 ` Pedro Alves
2015-03-07 17:58 ` [all pushed] " Pedro Alves
2015-03-16 4:42 ` asmwarrior
2015-03-16 5:05 ` asmwarrior
2015-03-16 5:22 ` asmwarrior
2015-03-16 7:15 ` asmwarrior
2015-03-16 8:20 ` asmwarrior [this message]
2015-03-16 11:43 ` [pushed] stub-termcap.c: prototype tputs's parameter's parameter, for C++ mode (Re: [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program) Pedro Alves
2015-03-16 11:46 ` [pushed] stub termcap, add extern "C" " Pedro Alves
2015-03-16 11:55 ` [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program Pedro Alves
2015-03-16 11:42 ` Pedro Alves
2015-05-15 8:13 ` asmwarrior
2015-05-15 8:24 ` asmwarrior
2015-05-15 15:09 ` Pedro Alves
2015-05-15 15:04 ` Pedro Alves
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=550693AB.60007@gmail.com \
--to=asmwarrior@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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