aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
Commit message (Collapse)AuthorAgeFilesLines
* Breakpad Linux Dumper: Fix up comments in google_breakpad::Module interface.jimblandy2009-12-231-7/+7
| | | | | | | | | Use the term "own", since ownership is the concept at work here. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@468 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 49003: Breakpad Linux Dumper: Add unit tests for STABS dumper.jimblandy2009-12-231-0/+175
| | | | | | | | | | | | Previous patches added unit tests for the STABS parser and the Breakpad symbol file writer; this adds unit tests for the "dumper" class that sits between them, receiving data from the parser and handing it to the writer. So now the whole pathway has coverage. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@467 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Add unit tests for google_breakpad::Module.jimblandy2009-12-233-11/+331
| | | | | | | | | | | | | Adjust Module's interface a bit to facilitate testing: - Make AssignSourceIds something a client can call --- it's perfectly well-defined, so this is an okay change. - Add GetFunctions, GetFiles and FindExistingfile member functions, which the test harness will use to get results to examine. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@466 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux Dumper: Use proper sizes and radixes when writing Breakpad ↵jimblandy2009-12-231-7/+7
| | | | | | | | | | | | | | symbol files. A FUNC record's parameter size is also hexadecimal, and all values are 64 bits wide. A line record's address and size are 64 bits wide. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@465 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: move DumpStabsHandler into its own file, for testing.jimblandy2009-12-233-211/+304
| | | | | | | | | This will make it easier to write unit tests for DumpStabsHandler. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@464 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 357: New Linux file_id code doesn't persist across strip. ↵ted.mielczarek2009-12-233-16/+162
| | | | | | r=agl,nealsid at http://breakpad.appspot.com/49008 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@461 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 42001: Breakpad Linux Dumper: remove compilation warnings in ↵jimblandy@gmail.com2009-12-151-4/+18
| | | | | | | | | | | | | | | | | | guid_creator.cc. Building on Ubuntu 9.10 with the distributed compiler (GCC 4.4.1), we get warnings like the following: guid_creator.cc:56: warning: dereferencing type-punned pointer will break strict-aliasing rules It doesn't matter in this case, but there's no crying need to use reinterpret casts in an endian-dependent way when there are plenty of well-defined ways to get the same effect. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@447 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 26001: Linux dumper: fix comments in STABS readerjimblandy@gmail.com2009-12-152-24/+28
| | | | | | | | | | Typos; ambiguities; dangling references to arguments whose names got changed. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@445 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Add unit tests for google_breakpad::StabsReader.jimblandy@gmail.com2009-12-156-0/+573
| | | | | | | | | | | | | | | | | | | | | | The test system is based on Google C++ Testing Framework and the Google C++ Mocking Framework. This includes a parser that turns human-readable input files ("mock stabs") into .stab and .stabstr section contents, which we can then pass to a StabsReader instance, using a handler object written with GoogleMock. The 'make check' target in src/tools/linux/dump_syms runs this. The supplied input file is pretty small, but I've done coverage testing, and it does cover the parser. I thought the mock stabs parser would be less elaborate than it turned out to be. Lesson learned. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@444 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 25003: Linux dumper: Fix infinite loop in stabs parser.jimblandy@gmail.com2009-12-151-1/+6
| | | | | | | | | | | | If the input passed to a StabsReader instance contains a compilation unit whose first entry is an N_SO with no name, the parser enters an infinite loop. Since such entries mark the end of a compilation unit, ProcessCompilationUnit should skip them. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@443 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 25002: Linux symbol dumper: Require STABS consumers to provide a ↵jimblandy@gmail.com2009-12-152-1/+9
| | | | | | | | | | | | | Warning member. The StabsHandler class should not provide a fallback definition for its Warning member function that just throws away warning messages. It should require the consumer to provide an appropriate definition. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@442 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 330 - linux_syscall_support.h has extra semicolons causing compilation ↵ted.mielczarek2009-12-031-3/+3
| | | | | | to fail with certain gcc options. Patch by Josh Aas <joshmoz@gmail.com>, r=me git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@436 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 336 - Look for libcurl-gnutls in addition to libcurl.so. Patch by Karl ↵ted.mielczarek2009-12-031-0/+7
| | | | | | Tomlinson <karlt@mozbugz.karlt.net>, r=me git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@435 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Upstreaming several patches from Chrome:nealsid2009-12-014-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Build fix for systems where sys/user.h needs sys/types.h.... http://breakpad.appspot.com/40002 MDRawSystemInfo.processor_level refers to the CPU family, not the cpuid level.. http://breakpad.appspot.com/40003 Use MD_MODULE_SIZE in place of sizeof(MDRawModule). http://breakpad.appspot.com/39003 Linux x64 compile fix. http://breakpad.appspot.com/40004 Include linux_syscall_support.h to get definition of NT_PRXFPREG. This is Chromium commit 23659. http://breakpad.appspot.com/40005 Build breakpad / crash reporting on Linux 64-bit. This is Chromium commit 23396. http://breakpad.appspot.com/40006 Fix #includes in a couple unit tests. http://breakpad.appspot.com/41001 Clean up unused headers / files for Linux dump_syms. http://breakpad.appspot.com/40002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@432 4c0a9323-5329-0410-9bdc-e9ce6186880e
* New uploader for Linux with unit tests, and gflags/glog librariesnealsid2009-09-295-0/+751
| | | | | | | | | | | http://breakpad.appspot.com/29004 A=nealsid R=chris masone at chromium org git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@403 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Merge of Breakpad Chrome Linux forknealsid2009-08-178-83/+3450
| | | | | | | | | A=agl, Lei Zhang R=nealsid, agl git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@384 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: fix comments in src/common/linux/module.hjimblandy@gmail.com2009-08-071-13/+15
| | | | | | | | | | | Fix some typos and references to member functions that didn't make the final cut. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@381 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Move the data structures representing the breakpad data into ↵jimblandy@gmail.com2009-08-073-446/+574
| | | | | | | | | | | | | | | | | | | | | | | their own class. src/linux/common/module.h defines a new class, google_breakpad::Module, that can represent the contents of a breakpad symbol file. Module::Write writes a well-formed symbol file to the given stream. src/linux/common/dump_symbols.cc can now lose its symbol-file-writing code, and change DumpStabsHandler to populate a Module object, rather than the old SymbolInfo/SourceFileInfo/... collection of types. The code to compute function and line sizes, even in the absence of reliable size data in STABS, is moved into a new Finalize method of DumpStabsHandler, which is responsible for completing the Module's contents. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@380 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add files left behind by previous commit.jimblandy@gmail.com2009-08-072-0/+383
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@379 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Move STABS parsing into its own class.jimblandy@gmail.com2009-08-071-135/+107
| | | | | | | | | | | | | With this patch, dump_symbols.cc no longer knows about the details of the STABS debugging format; that is handled by the StabsReader class. dump_symbols.cc provides a subclass of StabsHandler that builds dump_symbols' own representation of the data. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@378 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Make the 'name' field of FuncInfo a std::string instead of a ↵jimblandy@gmail.com2009-08-051-10/+13
| | | | | | | | | | | | | | | | | | | char *. Because the actual N_FUN strings in the .stabstr section contain type information after the mangled name, representing this information using a pointer into .stabstr, while efficient with memory, makes the FuncInfo data structure STABS-specific: one must know the details of a STABS N_FUN string's syntax to interpret FuncInfo::name. This patch removes this STABS dependency from the data structure, and moves us closer to having an appropriate structure for representing unified STABS and DWARF data. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@375 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Properly separate function names from STABS type data.jimblandy@gmail.com2009-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STABS strings for N_FUN entries contain a mangled function name, followed by a colon, followed by type information. The type information itself may contain colons; mangled names never contain colons (they need to be legal assembly-language identifiers). So the current code in src/common/linux/dump_symbols.cc:WriteOneFunction that attempts to separate the mangled name from the STABS junk will incorrectly include STABS junk in the name, causing demangling to fail. Applying the patch below results in changes like these in the symbol file produced, where an unmangled name followed by STABS junk becomes a properly demangled name: ## --- base/libxul.so.syms 2009-07-13 21:46:33.000000000 -0700 ## +++ tip/libxul.so.syms 2009-07-13 21:51:04.000000000 -0700 ## @@ -3907,7 +3907,7 @@ ## FILE 3905 /home/jimb/mc/in/gfx/cairo/libpixman/src/pixman-region.c ## FILE 3906 combine.inc ## FILE 3907 /home/jimb/mc/in/gfx/cairo/libpixman/src/pixman-edge-imp.h ## -FUNC 19898c 54 0 _Z20NS_GetCaseConversionv:F(0,1201)=*(0,1202)=xsnsICaseConvers ## ion ## +FUNC 19898c 54 0 NS_GetCaseConversion() ## 19898c 12 54 1 ## 19899e 9 56 1 ## 1989a7 6 60 1 ## @@ -214776,7 +214776,7 @@ ## 3847c9 9 57 506 ## 3847d2 13 58 506 ## 3847e5 7 59 506 ## -FUNC 387e89 27 0 _ZN20nsGenericHTMLElement11FromContentEP10nsIContent:F(0,8117) ## =*(0,8118)=xsnsGenericHTMLElement ## +FUNC 387e89 27 0 nsGenericHTMLElement::FromContent(nsIContent*) ## 387e89 7 80 2584 ## 387e90 3 80 2584 ## 387e93 e 82 2584 ## @@ -250473,7 +250473,7 @@ ## 3d0d88 7 82 548 ## 3d0d8f 25 84 548 ## 3d0db4 5 85 548 ## -FUNC 3d0e0c 40 0 _ZL21GetEnclosingListFrameP8nsIFrame:f(0,7182)=*(0,7183)=xsnsL ## istControlFrame ## +FUNC 3d0e0c 40 0 GetEnclosingListFrame(nsIFrame*) ## 3d0e0c 5 146 549 ## 3d0e11 3 722 2645 ## 3d0e14 d 146 549 a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@374 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Don't switch to wrong source file when starting new function.jimblandy@gmail.com2009-08-051-6/+11
| | | | | | | | | | | | | | | | In STABS, if one function's line number information contains an N_SOL entry to switch to a new source file, then the next function's line data should pick up in the same source file where the prior function left off. However, the Linux dumper restarts each function in the compilation unit's main source file. This patch fixes that, so that the output attributes the lines in subsequent functions to the correct source files. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@373 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Delete non-functional stack parameter size computation.jimblandy@gmail.com2009-08-051-20/+1
| | | | | | | | | | Delete code to compute function stack parameter size. It never did anything. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@372 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Let LineInfo structures point directly to their SourceLineInfo ↵jimblandy@gmail.com2009-08-051-141/+147
| | | | | | | | | | | | | | | | | | | | | structures Let LineInfo structures point directly to their SourceLineInfo structures, rather than holding the index of the file's name in the .stabstr section in the early phases, and then later the holding source_id of the file. This is another step in the process of moving STABS-specific values out of the types that represent the breakpad symbol data. When we're done, the non-STABS structures will be something that we can populate with both STABS and DWARF data --- or at least it will be more easily replaced with such. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@371 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Don't record file boundary addresses as null-name ↵jimblandy@gmail.com2009-07-301-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | SourceFileInfoList entries. STABS information introduces a compilation unit with an N_SO entry whose address is the start address of the file and whose string is the name of the compilation unit's main source file. However, STABS entries can only hold one address, so STABS indicates the compilation unit's ending address with an N_SO entry whose name is empty. Currently, the dumper's data structures simply create SourceFileInfo structures with empty names for these end-of-unit N_SO entries. We want to remove STABS-specific characteristics from these structures so that we can replace them with an input-format-independent structure. This moves end-of-compilation-unit addresses out of the symbol table structure, and into their own list of boundary addresses. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@369 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Use pointers to SourceFileInfo structures.jimblandy@gmail.com2009-07-301-29/+38
| | | | | | | | | | | | | | | | | | | Use a list of pointers to SourceFileInfo structures, not a list of the structures themselves. This is preparation for a subsequent patch which makes the data structures less STABS-specific. This patch introduces a memory leak. If an included file is referenced only by line entries for functions that LoadFuncSymbols elected to omit from the func_info list, then its SourceFileInfo structure is leaked when we destroy the name_to_file map. This leak is fixed in a subsequent patch by letting the map of files by name own the file objects. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@368 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Use a sorted array of addresses in computing function and line ↵jimblandy@gmail.com2009-07-301-83/+34
| | | | | | | | | | | | | | | sizes. Replace the sorted lists of files and functions with an array of boundary addresses. This replaces CompareAddress with the default comparison, and SortByAddress and NextAddress with the stock STL sort and upper_bound algorithms, losing ~50 lines of code. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@367 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux dumper: Correctly find boundary address when computing line and ↵jimblandy@gmail.com2009-07-271-6/+10
| | | | | | | | | | | | | | function sizes. In NextAddress, check both the file list and the function list for the nearest boundary. Don't assume that, if we find any bounding entry in the function list, that must be the nearest thing. A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@365 4c0a9323-5329-0410-9bdc-e9ce6186880e
* The has_sol field of struct FuncInfo is unused. This patch removes it.jimblandy@gmail.com2009-07-271-6/+0
| | | | | | | | A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@364 4c0a9323-5329-0410-9bdc-e9ce6186880e
* The 'no_next_addr_count' variable in ComputeSizeAndRVA shouldn't be static.jimblandy@gmail.com2009-07-271-1/+1
| | | | | | | | | | | | | The current arrangement would produce needless warnings if WriteSymbolFile were ever used twice in the same program invocation. Even if it weren't wrong, it's unnecessary, and local non-const static variables require extra care when reading to be sure of their effect. A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@363 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use a std::map instead of a linear search to look up files for line records.jimblandy@gmail.com2009-07-271-15/+20
| | | | | | | | | | | | | | With this patch, the time required to generate Breakpad symbols for Firefox's libxul.so on a MacBook Pro 3,1 drops from 32s to 2s. I verified that this patch had no effect on the output of dump_syms when applied to firefox-bin and its libraries when built with -gstabs+. A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@362 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove warnings about uninitialized fields.jimblandy@gmail.com2009-07-271-0/+3
| | | | | | | | A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@361 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use ctsdio streams for dump_syms for significant speedup. Also contains a ↵nealsid2009-06-052-37/+26
| | | | | | | | | | | makefile fix to build in 32-bit mode, even on 64-bit systems. A=jim blandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@347 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 305 - breakpad Linux handler doesn't build with compiler built from ↵ted.mielczarek2009-03-241-0/+1
| | | | | | latest GCC sources. Trivial patch by Jim Blandy git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@321 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 294: mmap error checking is not correct.nealsid2009-02-222-2/+2
| | | | | | | | R=Liu git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@312 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Followup to address some review comments from Issue 259ted.mielczarek2008-11-251-9/+15
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@297 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 259 - crash when generating large .sym files with dump_syms on Linux. ↵ted.mielczarek2008-11-241-34/+56
| | | | | | Patch by login_ing@yahoo.com, r=Liu Li git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@296 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 238 - missing includes compiling with gcc 4.3. patch by taras glek, r=meted.mielczarek2008-02-241-0/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@240 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix issue 235, properly handling included(inlined) code.luly812007-12-131-53/+157
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@236 4c0a9323-5329-0410-9bdc-e9ce6186880e
* slight fixup from issue 225ted.mielczarek2007-12-031-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@234 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 225 - dynamically load libcurl in http_upload. patch by Andrew ↵ted.mielczarek2007-11-201-54/+88
| | | | | | Schultz <ajschult@verizon.net>, r=Liu Li git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@232 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 221 - HTTPUpload::SendRequest should provide error code or error ↵ted.mielczarek2007-11-022-2/+10
| | | | | | description to callers. r=Liu Li git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@228 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Solaris version of symbol dumper (#207). Patch by Alfred Peng. r=memmentovai2007-09-284-279/+2
| | | | | | | http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/e4cbdbf7ddaf7f51 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@218 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 191 - Linux dump_syms produces bad line numbers for some functions (16 ↵ted.mielczarek2007-07-021-1/+2
| | | | | | bit overflow). r=Liu Li git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@190 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow building with -pedantic (#186). r=ted.mielczarekmmentovai2007-05-311-1/+1
| | | | | | | http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/6aa39d7f0ffa3c42 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@183 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add md5 implementation into code base to get rid ofluly812007-05-033-5/+284
| | | | | | | | | openssl dependency. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@153 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Merge Ted's patch for writing symbols to stdout for linux.luly812007-05-022-8/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@149 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Discard age field in the dumped symbol file.luly812007-04-041-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@139 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix bug of issue 135, now can dump symbols for dynamic libraries.luly812007-03-271-7/+46
| | | | | | | | Also some minor fixes to make it compile with more strict compiling options. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@133 4c0a9323-5329-0410-9bdc-e9ce6186880e