Skip to content

Commit b0bef35

Browse files
committed
Now all #if 0 have a comment explaining why.
modified: src/lib/libdwarf/dwarf_elf_load_headers.c modified: src/lib/libdwarf/dwarf_generic_init.c modified: src/lib/libdwarf/dwarf_global.c modified: src/lib/libdwarf/dwarf_init_finish.c modified: src/lib/libdwarf/dwarf_line.h modified: src/lib/libdwarf/dwarf_macro5.c modified: src/lib/libdwarf/dwarf_object_detector.c
1 parent 896bd62 commit b0bef35

File tree

7 files changed

+6
-25
lines changed

7 files changed

+6
-25
lines changed

src/lib/libdwarf/dwarf_elf_load_headers.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,13 @@ generic_shdr_from_shdr32(dwarf_elf_object_access_internals_t *ep,
493493

494494
gshdr->gh_secnum = i;
495495
copysection32(ep,gshdr,psh);
496-
#if 1
497496
if (gshdr->gh_size >= ep->f_filesize &&
498497
gshdr->gh_type != SHT_NOBITS) {
499498
free(orig_psh);
500499
free(orig_gshdr);
501500
*errcode = DW_DLE_SECTION_SIZE_ERROR;
502501
return DW_DLV_ERROR;
503502
}
504-
#endif /* 0 */
505503
isempty = is_empty_section(gshdr->gh_type);
506504
if (i == 0) {
507505
Dwarf_Unsigned shnum = 0;

src/lib/libdwarf/dwarf_generic_init.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,7 @@ dwarf_init_b(int fd,
454454
Dwarf_Unsigned filesize = 0;
455455
int res = 0;
456456
int errcode = 0;
457-
#if 0
458-
void *inmem_data;
459-
Dwarf_Unsigned inmem_size = 0;
460-
#endif
457+
461458
if (!ret_dbg) {
462459
DWARF_DBG_ERROR(NULL,DW_DLE_DWARF_INIT_DBG_NULL,DW_DLV_ERROR);
463460
}

src/lib/libdwarf/dwarf_global.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,6 @@ _dwarf_internal_get_pubnames_like(Dwarf_Debug dbg,
10691069
*out_phead_chain = 0;
10701070
return DW_DLV_ERROR;
10711071
}
1072-
#if 1
10731072
/* If there is some kind of padding at the end of
10741073
the section, following a pairs terminator,
10751074
as emitted by some compilers, skip over that padding and
@@ -1084,7 +1083,6 @@ _dwarf_internal_get_pubnames_like(Dwarf_Debug dbg,
10841083
pubnames_like_offset = finaloffset;
10851084
}
10861085
}
1087-
#endif
10881086
pubnames_like_ptr = pubnames_ptr_past_end_cu;
10891087
} while (pubnames_like_ptr < section_end_ptr);
10901088
*return_count = global_count;

src/lib/libdwarf/dwarf_init_finish.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ dwarf_object_finish(Dwarf_Debug dbg)
11961196

11971197
#if defined(HAVE_ZLIB) && defined(HAVE_ZSTD)
11981198

1199-
#if 0
1199+
#if 0 /* Dropping heuristic check. Not reliable. */
12001200
static int
12011201
check_uncompr_inflation(Dwarf_Debug dbg,
12021202
Dwarf_Error *error,
@@ -1294,7 +1294,7 @@ check_uncompr_inflation(Dwarf_Debug dbg,
12941294
12951295
*/
12961296

1297-
#if 0
1297+
#if 0 /* Dropping heuristic check. Not reliable. */
12981298
/* ALLOWED_ZLIB_INFLATION is a heuristic, not necessarily right.
12991299
The test case klingler2/compresseddebug.amd64 actually
13001300
inflates about 8 times. */
@@ -1389,7 +1389,7 @@ do_decompress(Dwarf_Debug dbg,
13891389
" The compressed section is not properly formatted");
13901390
return DW_DLV_ERROR;
13911391
}
1392-
#if 0
1392+
#if 0 /* Dropping heuristic check. Not reliable. */
13931393
/* The heuristics are unreliable. Turned off now */
13941394
if (!zstdcompress) {
13951395
/* According to zlib.net zlib essentially never expands
@@ -1558,7 +1558,7 @@ _dwarf_load_section(Dwarf_Debug dbg,
15581558
if (res == DW_DLV_ERROR) {
15591559
DWARF_DBG_ERROR(dbg, errc, DW_DLV_ERROR);
15601560
}
1561-
#if 0
1561+
#if 0 /* Not changing error, to disruptive of regression tests. */
15621562
Hold off on this, keep old error for the moment
15631563
if (res == DW_DLV_ERROR) {
15641564
_dwarf_error_string(dbg, error,

src/lib/libdwarf/dwarf_line.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ void _dwarf_set_line_table_regs_default_values(
302302
*/
303303
struct Dwarf_Line_s {
304304
Dwarf_Addr li_address; /* pc value of machine instr */
305-
#if 1
306305
struct li_inner_s {
307306
/* New as of DWARF4 */
308307
Dwarf_Unsigned li_discriminator;
@@ -348,7 +347,6 @@ struct Dwarf_Line_s {
348347
/* Mark a line record as being DW_LNS_set_address. */
349348
unsigned li_is_addr_set:1;
350349
} li_l_data;
351-
#endif /* 1 */
352350
Dwarf_Line_Context li_context; /* assoc Dwarf_Line_Context_s */
353351

354352
/* Set only on the actuals table of a two-level line table.

src/lib/libdwarf/dwarf_macro5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ _dwarf_get_macro_ops_count_internal(Dwarf_Macro_Context macro_context,
368368
Normally we don't see this, the end operator
369369
signals end. */
370370
opslen = mdata - macro_context->mc_macro_ops;
371-
#if 0
371+
#if 0 /* Dropping a counterproductive test. */
372372
/* This test fails when there are corrupted FORms
373373
so we lose a really useful and precise error
374374
message and get this useless message. */

src/lib/libdwarf/dwarf_object_detector.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,6 @@ dwarf_object_detector_fd(int fd,
512512

513513
int
514514
_dwarf_object_detector_fd_a(int fd,
515-
#if 0
516-
void * in_memory,
517-
Dwarf_Unsigned in_mem_size,
518-
#endif
519515
unsigned *ftype,
520516
unsigned *endian,
521517
unsigned *offsetsize,
@@ -528,13 +524,7 @@ _dwarf_object_detector_fd_a(int fd,
528524
Dwarf_Unsigned filesize = 0;
529525
Dwarf_Unsigned remaininglen = 0;
530526
int res = 0;
531-
#if 0
532-
char * memobj = (char *)in_memory;
533527

534-
if (memobj) {
535-
filesize = in_mem_size;
536-
} else
537-
#endif
538528
{
539529
res = _dwarf_seekr(fd,0,SEEK_END,&filesize);
540530
if (res != DW_DLV_OK) {

0 commit comments

Comments
 (0)