Commit Graph

151 Commits

Author SHA1 Message Date
HoundThe
51405f81f4
DWARF: Coverity fixes (#17147) 2020-06-27 11:40:45 +08:00
HoundThe
914624a921
DWARF .debug_info parsing fix and improvement (#17007)
* Get .debug_info working for DWARF 2, 3
* Fill up missing information in abbrev string table
* Add 64bit dwarf option into debug_info
* Add DWARF4 and DWARF5 forms
* Add unit tests
* added basic test

Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
2020-06-19 19:25:59 +08:00
Michael Scherer
db5cce396d
Fix C99 construct without -c99 (#17077)
* Fix C99 construct without -c99

Co-authored-by: Anton Kochkov <xvilka@gmail.com>
2020-06-18 14:33:26 +08:00
HoundThe
1650ee69dc
DWARF 4 and 5 line parsing additions ##bin (#17061)
* Moved dwarf prototypes to its header, added information for DWARF4
* Fixed incorrect line parsing for last compilation unit
* Added ability to parse DWARF4 and DWARF5 but without parsing out the source files
2020-06-15 12:39:48 +08:00
HoundThe
f298057646
Fix signedness issue in the DWARF line parser on ARM64 (#17031) 2020-06-12 10:50:48 +08:00
HoundThe
80aca08721
Fix in a dwarf line information parsing implementation (#16976) 2020-06-07 11:26:31 +08:00
Francesco Tamagni
99330d6ce3 Fix DWARF parsing ##bin
- support up to v4
- ensure all v4 line number program header fields are parsed
- remove wrong assumptions about the content of included directories
- ensure unit length calculation is correct
- ensure all leb128 / uleb128 have boundary checking
2020-05-05 18:47:23 +02:00
Riccardo Schirone
7594b0f5e6 A bit of refactoring in RBin (#15349)
* introduce r_bin_open_buf
* fix r_bin_file_delete to use bf->id and not fd. This was used
  inconsistently and the function was just wrong.
* rewrite r_bin_reload to just reuse the existing bf->buf
* fix some memory leaks
2019-10-24 14:33:54 +02:00
GustavoLCR
7530895d0a Fix a few clang scan-build bugs (#12562)
* Removed unnecessary variable from libr/core/disasm.c
* Removed not necessary assignment in libr/core/casm.c
* Removed not used assignment in libr/bin/dwarf.c
* Rem. duplicate declaration and not used values
* Fixed potential memory leak in java/class.c
* Fixed potential memory leak in ragg2
* Removed unnecessary variable in visual.c
* Another potential memory leak in class.c
* Removed not used value assignment
* Fixed memory leak in dwarf.c
* Removed not needed assignments
* Remove more not used assignments
* Refactored where bin_sections gets arch & bits for clarity
* Removed more assignments that are not used
* Rem. more unused assignments
* Surround assignment with paranthesis
2018-12-26 12:54:12 +01:00
Dan Robertson
e980677887 r_bin_dwarf_expand_*: fix memory error (#12411)
The use of memset to set the rest of the newly realloc'd buffer in
various r_bin_dwarf_expand_* functions was overwriting portions of
the buffer that had previously been written to.

The functions including said error were the following:

 - r_bin_dwarf_expand_die
 - r_bin_dwarf_expand_cu
 - r_bin_dwarf_expand_abbrev_decl
 - r_bin_dwarf_expand_debug_abbrev
2018-12-06 15:12:47 +01:00
Riccardo Schirone
6115f00455
remove r_bin_load_io2 and rename MODE defines ##refactor
PR #11888 

* bin: no need for 2 r_bin_load_io APIs
* bin: remove io-related unused functions
* r_bin.h: remove some old comments
* r_bin.h: group together related APIs
* extract print/set modes in r_types, to remove dups in r_bin and r_core
* clang-format-diff: fix ternary operator indent for pancake
2018-10-24 16:54:57 +02:00
Riccardo Schirone
e2278cc50f
sync sdb: some refactoring on how to access base SdbKv fields (#11741) 2018-10-05 15:21:46 +02:00
radare
d901a44df3
Fix unaligned number parsing from memory in dwarf (#11556)
- Spotted with ASAN="undefined" sys/asan.sh
2018-09-17 14:06:36 +02:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
David CARLIER
09e8ccead3 Redo the previous PR. (#11415)
Fix couple of memory leaks only removed
one faulty line which led to garbage.
2018-09-06 12:43:50 +02:00
Riccardo Schirone
1b32083995 Travis was green (#11408)
* anal_x86: keep same syntax and POP value out of esil stack in push sp

NOTE: The other syntax was causing issues in afta, not sure why

* Revert "Further mem leak fixes (#11398)"

This reverts commit 38d9170f5d.

* anal_x86_cs: just use one expression for the PUSH x86 operation

* libr/core/cmd: set core_sysenv only when calling external scripts
2018-09-06 03:51:02 +02:00
David CARLIER
38d9170f5d Further mem leak fixes (#11398) 2018-09-05 14:56:29 +02:00
David CARLIER
89d6b8138c Fix couple of minor issues. (#11388) 2018-09-05 11:01:07 +02:00
Neven Sajko
d8784641ee Add parentheses in macros where needed for safety (#11290) 2018-08-30 13:16:50 +02:00
pancake
ebe148a670 Fix warning in dwarf.c 2018-07-11 17:28:09 +02:00
radare
d37d2b858a
Fix #10465 - Avoid string on low addresses (workaround) for corrupted dwarf (#10478) 2018-06-25 00:07:45 +02:00
pancake
b1212240a1 Blindfix #9506 - null deref i cant reproduce 2018-03-02 17:52:36 +01:00
pancake
2ca9ab4589 Fix #8813 - segfault in dwarf parser 2017-11-14 04:15:54 +09:00
pancake
2e96943872 Fix last covs 2017-10-31 12:06:12 +01:00
pancake
16432132bb Fix warning in dwarf.c 2017-10-29 11:37:14 +01:00
pancake
b1a9ce235d Fix dwarf tests 2017-10-12 02:28:01 +02:00
pancake
7203693790 Fix crash in bins/fuzzed/r2_nullptr_sdb_set_internal 2017-10-12 00:14:50 +02:00
alvarofe
80bfeae958 Fix NULL dereference while parsing dwarf structures 2017-09-07 16:40:40 +02:00
Fangrui Song
f8c670a9a3 dwarf.c: fix a few mem leaks (#8413) 2017-09-03 13:22:49 +02:00
pancake
df31f33d04 Fix more covs and warnings 2017-08-18 14:32:11 +02:00
pancake
59a94ae59f Fix #8084 - Honor colors in json_indent ~{} 2017-08-11 12:23:57 +02:00
pancake
94df0f1b44 Fix #8074 - reg profile for xnu-x86-64 native debugger 2017-07-31 18:37:16 +02:00
pancake
b3244620b8 Fix #8059 - Fix crash in dwarf parser 2017-07-31 15:00:01 +02:00
Anton Kochkov
41e21634ab Coverifixes (#8026) 2017-07-26 14:41:03 +08:00
Marc
80d4b44b2e Fix random code style issues 2017-07-13 00:46:27 +02:00
pancake
05ca43b5b2 Oops fix build 2017-07-10 18:10:30 +02:00
pancake
0918cabb22 Blindfix a null deref in dwarf parser 2017-07-10 18:05:01 +02:00
pancake
3a262ba5d7 Fix file containing (null) issue in dwarf 2017-05-25 15:14:18 +02:00
alvarofe
f0f037b974 Fix #7073 - fix oob read for not finalizing str 2017-03-21 23:20:30 +01:00
pancake
bce083ae7c Fix memleak in dwarf loading 2017-01-25 13:15:39 +01:00
Marc
459fc39f5b Add debug info support for Dalvik (#6570) 2017-01-24 18:51:27 +01:00
NighterMan
5d13d99526 Disable sdb sorting on dwarf to avoid stack exahustion 2017-01-19 13:04:13 +01:00
pancake
62e1edc01c Bump sdb to fix hash collision issues 2017-01-14 22:02:33 +01:00
Álvaro Felipe Melchor
884d2ddcc1 fix oob read in dwarf 2016-12-02 13:21:50 +01:00
Lowly Worm
98f897abfd rm unused var to silence warning 2016-11-20 18:15:36 -08:00
pancake
fd10f5bd7b Make dwarf work again 2016-11-16 10:43:53 +01:00
pancake
24ac867d90 Speedup DWARF loading by not checking if files exist 2016-11-15 19:52:22 +01:00
Álvaro Felipe Melchor
693fab645d minor speed up dwarf 2016-11-02 11:56:08 +01:00
pancake
53af9babce Aim to fix coverity-driven regression 2016-09-21 11:53:35 +02:00
pancake
e2b14a50f3 Fix latest COVs 2016-09-21 11:30:29 +02:00