public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Drop excluded regions list from dumper Date: Tue, 21 Jul 2020 14:20:27 +0000 (GMT) [thread overview] Message-ID: <20200721142027.76BAE384403F@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=44103c062166dc66c54ac0640cd4b2ab80d5561e commit 44103c062166dc66c54ac0640cd4b2ab80d5561e Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Sat Jul 4 15:57:31 2020 +0100 Cygwin: Drop excluded regions list from dumper Drop excluded regions, now it's always empty Diff: --- winsup/utils/dumper.cc | 48 ++++-------------------------------------------- winsup/utils/dumper.h | 17 ----------------- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 4577d2a3f..2a0c66002 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -83,7 +83,6 @@ dumper::dumper (DWORD pid, DWORD tid, const char *file_name) this->pid = pid; this->tid = tid; core_bfd = NULL; - excl_list = new exclusion (20); list = last = NULL; @@ -125,19 +124,16 @@ dumper::close () { if (core_bfd) bfd_close (core_bfd); - if (excl_list) - delete excl_list; if (hProcess) CloseHandle (hProcess); core_bfd = NULL; hProcess = NULL; - excl_list = NULL; } int dumper::sane () { - if (hProcess == NULL || core_bfd == NULL || excl_list == NULL) + if (hProcess == NULL || core_bfd == NULL) return 0; return 1; } @@ -226,42 +222,6 @@ dumper::add_mem_region (LPBYTE base, SIZE_T size) return 1; } -/* split_add_mem_region scans list of regions to be excluded from dumping process - (excl_list) and removes all "excluded" parts from given region. */ -int -dumper::split_add_mem_region (LPBYTE base, SIZE_T size) -{ - if (!sane ()) - return 0; - - if (base == NULL || size == 0) - return 1; // just ignore empty regions - - LPBYTE last_base = base; - - for (process_mem_region * p = excl_list->region; - p < excl_list->region + excl_list->last; - p++) - { - if (p->base >= base + size || p->base + p->size <= base) - continue; - - if (p->base <= base) - { - last_base = p->base + p->size; - continue; - } - - add_mem_region (last_base, p->base - last_base); - last_base = p->base + p->size; - } - - if (last_base < base + size) - add_mem_region (last_base, base + size - last_base); - - return 1; -} - int dumper::add_module (LPVOID base_address) { @@ -413,14 +373,14 @@ dumper::collect_memory_sections () last_size += mbi.RegionSize; else { - split_add_mem_region (last_base, last_size); + add_mem_region (last_base, last_size); last_base = (LPBYTE) mbi.BaseAddress; last_size = mbi.RegionSize; } } else { - split_add_mem_region (last_base, last_size); + add_mem_region (last_base, last_size); last_base = NULL; last_size = 0; } @@ -429,7 +389,7 @@ dumper::collect_memory_sections () } /* dump last sections, if any */ - split_add_mem_region (last_base, last_size); + add_mem_region (last_base, last_size); return 1; }; diff --git a/winsup/utils/dumper.h b/winsup/utils/dumper.h index 78592b61e..6e624a983 100644 --- a/winsup/utils/dumper.h +++ b/winsup/utils/dumper.h @@ -62,22 +62,6 @@ typedef struct _process_entity struct _process_entity* next; } process_entity; -class exclusion -{ -public: - size_t last; - size_t size; - size_t step; - process_mem_region* region; - - exclusion ( size_t step ) { last = size = 0; - this->step = step; - region = NULL; } - ~exclusion () { free ( region ); } - int add ( LPBYTE mem_base, SIZE_T mem_size ); - int sort_and_check (); -}; - #define PAGE_BUFFER_SIZE 4096 class dumper @@ -87,7 +71,6 @@ class dumper HANDLE hProcess; process_entity* list; process_entity* last; - exclusion* excl_list; char* file_name; bfd* core_bfd;
reply other threads:[~2020-07-21 14:20 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200721142027.76BAE384403F@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /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: linkBe 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).