summaryrefslogtreecommitdiff
path: root/overlay/mgdb/gdb/amd64-winnt-tdep.c
blob: ab8fdb8909c8852aa81c9477cda0cd405a732704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/***************************************************************/
/*  mgdb: midipix-specific bits for gdb                        */
/*  Copyright (C) 2019  Z. Gilboa                              */
/*  Released under GPLv2 and GPLv3; see COPYING.MGDB.          */
/***************************************************************/

#include "defs.h"
#include "osabi.h"
#include "frame-unwind.h"
#include "windows-tdep.h"
#include "amd64-windows-tdep.c"

#define amd64_winnt_push_dummy_call		amd64_windows_push_dummy_call
#define amd64_winnt_return_value		amd64_windows_return_value
#define amd64_winnt_skip_trampoline_code	amd64_windows_skip_trampoline_code

#define amd64_winnt_skip_prologue               amd64_windows_skip_prologue
#define amd64_winnt_skip_main_prologue		amd64_skip_main_prologue

static void
amd64_winnt_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
	/* abi */
	amd64_init_abi                    (info, gdbarch);
	windows_init_abi                  (info, gdbarch);

	/* out-of-band function calls */
	set_gdbarch_push_dummy_call       (gdbarch, amd64_winnt_push_dummy_call);
	set_gdbarch_return_value          (gdbarch, amd64_winnt_return_value);
	set_gdbarch_skip_trampoline_code  (gdbarch, amd64_winnt_skip_trampoline_code);

	/* skip prologue methods */
	set_gdbarch_skip_prologue         (gdbarch, amd64_windows_skip_prologue);
	set_gdbarch_skip_main_prologue    (gdbarch, amd64_skip_main_prologue);

	/* todo: SEH unwinder */
	frame_unwind_append_unwinder      (gdbarch, 0);

	/* todo: inferior-specific, dynamically detected size of long */
	set_gdbarch_long_bit              (gdbarch, 64);
}

extern initialize_file_ftype _initialize_amd64_winnt_tdep;

void
_initialize_amd64_winnt_tdep (void)
{
	gdbarch_register_osabi(
		bfd_arch_i386,
		bfd_mach_x86_64,
		GDB_OSABI_WINNT,
		amd64_winnt_init_abi);
}