21 Commits

Author SHA1 Message Date
Mark Mentovai
6278690abe Update copyright boilerplate, 2022 edition (Crashpad)
sed -i '' -E -e 's/Copyright (.+) The Crashpad Authors\. All rights reserved\.$/Copyright \1 The Crashpad Authors/' $(git grep -El 'Copyright (.+) The Crashpad Authors\. All rights reserved\.$')

Bug: chromium:1098010
Change-Id: I8d6138469ddbe3d281a5d83f64cf918ec2491611
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3878262
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2022-09-06 23:54:07 +00:00
Peter Boström
1aa478d161 Remove DISALLOW_* macros in crashpad
This change was partially scripted and partially done manually with vim
regex + manually placing the deleted constructors.

The script change looked for destructors in the public: section of a
class, if that existed the deleted constructors would go before the
destructor.

For manual placement I looked for any constructor in the public: section
of the corresponding class. If there wasn't one, then it would ideally
have gone as the first entry except below enums, classes and typedefs.
This may not have been perfect, but is hopefully good enough. Fingers
crossed.

#include "base/macros.h" is removed from files that don't use
ignore_result, which is the only other thing defined in base/macros.h.

Bug: chromium:1010217
Change-Id: I099526255a40b1ac1264904b4ece2f3f503c9418
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3171034
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2021-09-21 15:09:44 +00:00
Jan Wilken Dörrie
2872c0ea4e [LSC] Remove base::char16 and base::string16 aliases
This change removes usages of the base::char16 and base::string16 type
aliases in favor of using char16_t and std::u16string directly.

Bug: chromium:1184339
Change-Id: Ieb790cbe2ce98d91865cd21d98616195a57b3903
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2742482
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-03-08 21:08:44 +00:00
Casey Dahlin
5f77cf41b6 Add CodeViewRecordBuildId
Until now we've been stuffing ELF debug symbol link information into a
CodeViewPDB70. This has reached the limits of its usefulness. We now add
a CodeViewRecord that can contain a proper ELF build ID.

Change-Id: Ice52cb2a958a1b9031943f280d9054da02d2f17d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1574107
Commit-Queue: Casey Dahlin <sadmac@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-04-22 23:16:22 +00:00
Mark Mentovai
e9f40ae176 Remove double double words
I ran the thing below (piped to “grep -v namespace”), fixed things up,
and rewrapped comments in the affected file.

import re
import sys

LAST_WORD_RE = re.compile('^.*[\s]+([\w]+)$')
FIRST_WORD_RE = re.compile('^[^\w]+([\w]+).*$')

for path in sys.argv[1:]:
  with open(path) as file:
    line_number = 0
    last_word = None
    for line in file:
      line_number += 1
      first_word = FIRST_WORD_RE.match(line)
      if first_word and first_word.group(1) == last_word:
        print('%s:%u: %s' % (path, line_number - 1, last_word))
      last_word = LAST_WORD_RE.match(line)
      if last_word:
        last_word = last_word.group(1)

Change-Id: Iea9f2a6453d9d9ec17e2f238e09252535d7408bd
Reviewed-on: https://chromium-review.googlesource.com/780284
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2017-11-20 23:38:48 +00:00
Mark Mentovai
419f25eac8 Remove PointerVector<> and replace with std::vector<std::unique_ptr<>>
As mentioned at
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/721978/13/tools/crashpad_http_upload.cc#90
Change-Id: I4820346cc0b0bf26633e1de598c884af8af19983
Reviewed-on: https://chromium-review.googlesource.com/724744
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2017-10-19 04:53:36 +00:00
Scott Graham
a02ba24006 Convert from scoped_ptr to std::unique_ptr
Follows https://codereview.chromium.org/1911823002/ but fixes includes
that were messed up there.

Change-Id: Ic4bad7d095ee6f5a1c9f8ca2d11ac9e67d55a626
Reviewed-on: https://chromium-review.googlesource.com/340497
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-04-25 19:16:26 +00:00
Mark Mentovai
6d2d31d2d1 Use base/macros.h instead of base/basictypes.h
This was done in Chromium’s local copy of Crashpad in 562827afb599. This
change is similar to that one, except more care was taken to avoid
including headers from a .cc or _test.cc when already included by the
associated .h. Rather than using <stddef.h> for size_t, Crashpad has
always used <sys/types.h>, so that’s used here as well.

This updates mini_chromium to 8a2363f486e3a0dc562a68884832d06d28d38dcc,
which removes base/basictypes.h.

e128dcf10122 Remove base/move.h; use std::move() instead of Pass()
8a2363f486e3 Move basictypes.h to macros.h

R=avi@chromium.org

Review URL: https://codereview.chromium.org/1566713002 .
2016-01-06 12:22:50 -05:00
Scott Graham
3ef04d14f2 Implement ModuleSnapshotWin::UUID
Reads CodeView PDB GUID from Debug Directory of PE header.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1311003003 .
2015-09-01 09:32:09 -07:00
Scott Graham
74a34e9c4b win: Resolve zero-length array errors on MSVC
In some cases, it's sufficient to move the zero-length array to the end of the
structure. When the struct is used inside a class that is derived from however,
this fails. In that case, switch to holding the object in a scoped_ptr.

Longer winded version: https://groups.google.com/a/chromium.org/d/msg/crashpad-dev/NGZ6LwRMORM/nKcXKQ7inIEJ

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/896663006
2015-02-04 17:34:43 -08:00
Scott Graham
429a3368d4 win: Work towards getting 'minidump' to compile
- dbghelp.h requires windows.h to be included before it (ick!).
  Add a stub one for non_win to make this work.
- convert __attribute__ -> macro that can work work with MSVC;
- a handful of narrowing casts.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/883773005
2015-02-04 17:30:03 -08:00
Scott Graham
af07f4022b Move string16 and char16 in to base::
Needs to include roll with https://codereview.chromium.org/803593002/ included.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/804593002
2014-12-12 11:06:09 -08:00
Mark Mentovai
45993a6959 minidump: Fix InitializeFromSnapshot() comments for module lists.
These classes don’t really have “mutators” other than their singular
AddModule() methods, and the documentation is clearer when revised in
this way.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/691853002
2014-10-30 17:26:56 -04:00
Mark Mentovai
4299ab3c4c Add MinidumpMemoryListWriter::AddFromSnapshot(), everything downstream,
and its test.

TEST=minidump_test MinidumpMemoryWriter.AddFromSnapshot
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/641603006
2014-10-30 17:15:49 -04:00
Mark Mentovai
f7b38a9dd9 minidump: Fix InitializeFromSnapshot() comments for module lists.
These classes don’t really have “mutators” other than their singular
AddModule() methods, and the documentation is clearer when revised in
this way.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/691853002
2014-10-30 14:51:40 -04:00
Mark Mentovai
84b44610cf minidump: Add InitializeFromSnapshot() for MinidumpModuleWriter and
MinidumpModuleListWriter.

TEST=minidump_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/682263002
2014-10-29 11:38:49 -04:00
Mark Mentovai
0a4ea0b52d minidump: Change the ownership model.
All minidump objects now own their all of their children, rather than
having them maintain weak pointers and requiring callers to maintain
ownership.

The only weak object in the entire tree now is the “extra memory” added
to a MinidumpMemoryListWriter by its AddExtraMemory() method. Extra
memory aliases objects owned elsewhere in the tree, typically by a
MinidumpThreadWriter as stack memory. Non-“extra” memory added to a
MinidumpMemoryListWriter by its AddMemory() method is strongly owned.

Many objects are now deleted through base pointers, and in those cases,
the base classes now have public virtual destructors. The ultimate base,
MinidumpWritable, is still protected to guard against direct
instantiation and deletion, and thus its destructor does not need to be
virtual.

This updates mini_chromium to eeb3b6a4f020 specifically for that
revision, which includes necessary updates to scoped_ptr. It also picks
up:

eeb3b6a4f020 Update base/move.h and base/memory/scoped_ptr.h to match
67ad2efafaba More porting to Windows
be27a006421e AUTHORS: Fix link post-git migration flag day.
05f5b1503230 Add codereview.settings to mini_chromium.
a32c2b199811 Beginnings of Windows support in mini_chromium

TEST=minidump_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/674153002
2014-10-27 15:01:39 -04:00
Mark Mentovai
38aeadc1c1 minidump: Use forward declarations in more places.
TEST=minidump_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/679443002
2014-10-23 18:47:27 -04:00
Mark Mentovai
44a839614b minidump: Annotate existing virtual destructors that override a base
class virtual destructor with “override”.

TEST=minidump_test MinidumpContextWriter.*:MinidumpModuleWriter.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/675783006
2014-10-23 18:42:26 -04:00
Mark Mentovai
525de2c35a Use exactly one of final, override, and virtual.
This change was generated mechanically by running:

  find . \
      \( -name \*.cc -or -name \*.mm -or -name \*.h \) \
      -and -not -path ./third_party/\* -and -not -path ./out/\* -exec \
      sed -i '' -E -e 's/virtual (.*) override final/\1 final/' {} +

  find . \
      \( -name \*.cc -or -name \*.mm -or -name \*.h \) \
      -and -not -path ./third_party/\* -and -not -path ./out/\* -exec \
      sed -i '' -E -e 's/virtual (.*) override/\1 override/' {} +

Additional changes were made manually based on:

  git grep -E '^ {3,}.*override[;{]'

http://google-styleguide.googlecode.com/svn/trunk/cppguide.html?showone=The__define_Guard#Inheritance

TEST=*_test
BUG=
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/654933002
2014-10-14 11:11:57 -04:00
Mark Mentovai
0ba9d2b065 Add MinidumpModuleWriter, MinidumpModuleListWriter, related classes, and
their test.

TEST=minidump_test MinidumpModuleTest
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/460933004
2014-08-13 15:26:21 -07:00