From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 508163851527; Fri, 28 Oct 2022 09:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 508163851527 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666949940; bh=jxEqOa5adjnqRZ5t0N8CtB014l0hF2RwDlBl3gX4S40=; h=From:To:Subject:Date:From; b=aG8CievVwJiRlq9+zickhBiiMfbOprAmHEaWn3avBpMiTOf6sYJKl+OV3YZVw0r7v iRkhsPtuFHItXpE7kps6Ibh63jymd14H06EDOe9zPS3hB9rs+dqQyZcY8tZkYJKiul qE9VGGAqoqjKFob5NM22Jsq/0XOaO4zm7ZWc97pM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: utils: drop 32 bit considerations X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: f51e76da0af5ad404aaa61ed8e43fbf948695ba8 X-Git-Newrev: 1fc30147282ab0d3dc8bc742082d4745e5ffe352 Message-Id: <20221028093900.508163851527@sourceware.org> Date: Fri, 28 Oct 2022 09:39:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1fc30147282= ab0d3dc8bc742082d4745e5ffe352 commit 1fc30147282ab0d3dc8bc742082d4745e5ffe352 Author: Corinna Vinschen Date: Fri Oct 28 11:37:02 2022 +0200 Cygwin: utils: drop 32 bit considerations =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/utils/dumper.cc | 6 +----- winsup/utils/mingw/cygcheck.cc | 9 ++------- winsup/utils/mingw/strace.cc | 10 ---------- winsup/utils/profiler.cc | 9 ++------- winsup/utils/ssp.c | 15 +++------------ 5 files changed, 8 insertions(+), 41 deletions(-) diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 12124e26a..1bbf394fd 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -562,11 +562,7 @@ dumper::dump_module (asection * to, process_module * m= odule) strncpy (header.elf_note_header.name, "win32module", NOTE_NAME_SIZE); #pragma GCC diagnostic pop =20 -#ifdef __x86_64__ module_pstatus_ptr->data_type =3D NOTE_INFO_MODULE64; -#else - module_pstatus_ptr->data_type =3D NOTE_INFO_MODULE; -#endif module_pstatus_ptr->data.module_info.base_address =3D module->base_addre= ss; module_pstatus_ptr->data.module_info.module_name_size =3D strlen (module= ->name) + 1; strcpy (module_pstatus_ptr->data.module_info.module_name, module->name); @@ -707,7 +703,7 @@ dumper::init_core_dump () #ifdef __x86_64__ const char *target =3D "elf64-x86-64"; #else - const char *target =3D "elf32-i386"; +#error unimplemented for this target #endif =20 core_bfd =3D bfd_openw (file_name, target); diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc index a9d2bc2b6..69f75927f 100644 --- a/winsup/utils/mingw/cygcheck.cc +++ b/winsup/utils/mingw/cygcheck.cc @@ -625,12 +625,7 @@ dll_info (const char *path, HANDLE fh, int lvl, int re= curse) } int base_off =3D 108; #else - if (arch !=3D IMAGE_FILE_MACHINE_I386) - { - puts (verbose ? " (not x86 dll)" : "\n"); - return; - } - int base_off =3D 92; +#error unimplemented for this target #endif int opthdr_ofs =3D pe_header_offset + 4 + 20; unsigned short v[6]; @@ -2019,7 +2014,7 @@ static const char base_url[] =3D #ifdef __x86_64__ #define ARCH_STR "&arch=3Dx86_64" #else -#define ARCH_STR "&arch=3Dx86" +#error unimplemented for this target #endif static const char *ARCH_str =3D ARCH_STR; =20 diff --git a/winsup/utils/mingw/strace.cc b/winsup/utils/mingw/strace.cc index f7e7b8fd0..c220643b3 100644 --- a/winsup/utils/mingw/strace.cc +++ b/winsup/utils/mingw/strace.cc @@ -494,11 +494,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsign= ed mask, FILE *ofile) buf[len] =3D '\0'; char *s =3D strtok (buf, " "); =20 -#ifdef __x86_64__ unsigned long long n =3D strtoull (s, NULL, 16); -#else - unsigned long n =3D strtoul (s, NULL, 16); -#endif =20 s =3D strchr (s, '\0') + 1; =20 @@ -635,11 +631,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsign= ed mask, FILE *ofile) if (include_hex) { s -=3D 8; -#ifdef __x86_64__ sprintf (s, "%012llx", n); -#else - sprintf (s, "%08lx", n); -#endif strchr (s, '\0')[0] =3D ' '; } child->last_usecs =3D usecs; @@ -791,13 +783,11 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid) case STATUS_BREAKPOINT: case 0x406d1388: /* SetThreadName exception. */ break; -#ifdef __x86_64__ case STATUS_GCC_THROW: case STATUS_GCC_UNWIND: case STATUS_GCC_FORCED: status =3D DBG_EXCEPTION_NOT_HANDLED; break; -#endif default: status =3D DBG_EXCEPTION_NOT_HANDLED; if (ev.u.Exception.dwFirstChance) diff --git a/winsup/utils/profiler.cc b/winsup/utils/profiler.cc index 985946e5f..520e29d12 100644 --- a/winsup/utils/profiler.cc +++ b/winsup/utils/profiler.cc @@ -191,11 +191,10 @@ sample (CONTEXT *context, HANDLE h) return 0ULL; } else -//TODO this approach does not support 32-bit executables on 64-bit #ifdef __x86_64__ return context->Rip; #else - return context->Eip; +#error unimplemented for this target #endif } =20 @@ -495,8 +494,6 @@ find_text_section (LPVOID base, HANDLE h) read_child ((void *) &lfanew, sizeof (lfanew), &idh->e_lfanew, h); ptr +=3D lfanew; =20 - /* Code handles 32- or 64-bit headers depending on compilation environme= nt. */ - /*TODO It doesn't yet handle 32-bit headers on 64-bit Cygwin or v/v. = */ IMAGE_NT_HEADERS *inth =3D (IMAGE_NT_HEADERS *) ptr; read_child ((void *) &ntsig, sizeof (ntsig), &inth->Signature, h); if (ntsig !=3D IMAGE_NT_SIGNATURE) @@ -507,7 +504,7 @@ find_text_section (LPVOID base, HANDLE h) #ifdef __x86_64__ if (machine !=3D IMAGE_FILE_MACHINE_AMD64) #else - if (machine !=3D IMAGE_FILE_MACHINE_I386) +#error unimplemented for this target #endif error (0, "target program was built for different machine architecture= \n"); =20 @@ -923,13 +920,11 @@ profile1 (FILE *ofile, pid_t pid) case STATUS_BREAKPOINT: break; =20 -#ifdef __x86_64__ case STATUS_GCC_THROW: case STATUS_GCC_UNWIND: case STATUS_GCC_FORCED: status =3D DBG_EXCEPTION_NOT_HANDLED; break; -#endif =20 default: status =3D DBG_EXCEPTION_NOT_HANDLED; diff --git a/winsup/utils/ssp.c b/winsup/utils/ssp.c index 4c98eefa9..96a90a1d9 100644 --- a/winsup/utils/ssp.c +++ b/winsup/utils/ssp.c @@ -49,12 +49,7 @@ typedef DWORD64 CONTEXT_REG; #define CONTEXT_REG_FMT "%016llx" #define ADDR_SSCANF_FMT "%lli" #else -#define KERNEL_ADDR 0x77000000 -#define CONTEXT_SP Esp -#define CONTEXT_IP Eip -typedef DWORD CONTEXT_REG; -#define CONTEXT_REG_FMT "%08lx" -#define ADDR_SSCANF_FMT "%li" +#error unimplemented for this target #endif =20 #define TRACE_SSP 0 @@ -263,10 +258,7 @@ dump_registers (HANDLE thread) printf ("esi %016llx edi %016llx ebp %016llx esp %016llx %016llx\n", context.Rsi, context.Rdi, context.Rbp, context.Rsp, context.Rip); #else - printf ("eax %08lx ebx %08lx ecx %08lx edx %08lx eip\n", - context.Eax, context.Ebx, context.Ecx, context.Edx); - printf ("esi %08lx edi %08lx ebp %08lx esp %08lx %08lx\n", - context.Esi, context.Edi, context.Ebp, context.Esp, context.Eip); +#error unimplemented for this target #endif } =20 @@ -947,8 +939,7 @@ main (int argc, char **argv) /* 1234567 123% 1234567 123% 1234567812345678 xxxxxxxxxxx */ printf (" Main-Thread Other-Thread BaseAddr DLL Name\n"); #else - /* 1234567 123% 1234567 123% 12345678 xxxxxxxxxxx */ - printf (" Main-Thread Other-Thread BaseAddr DLL Name\n"); +#error unimplemented for this target #endif =20 total_pcount =3D 0;