ReactOS  0.4.15-dev-3440-g915569a
dwarfopen.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for dwarfopen.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

Dwarfdwarfopen (Pe *pe)
 
void dwarfclose (Dwarf *d)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file dwarfopen.c.

Function Documentation

◆ dwarfclose()

void dwarfclose ( Dwarf d)

Definition at line 52 of file dwarfopen.c.

53 {
54  free(d->abbrev.data);
55  free(d->aranges.data);
56  free(d->frame.data);
57  free(d->line.data);
58  free(d->pubnames.data);
59  free(d->ranges.data);
60  free(d->str.data);
61  free(d->info.data);
62  pefree(d->pe);
63  free(d);
64 }
#define free
Definition: debug_ros.c:5
void pefree(Pe *pe)
Definition: pe.c:109
#define d
Definition: ke_i.h:81

Referenced by RosSymDelete().

◆ dwarfopen()

Dwarf* dwarfopen ( Pe pe)

Definition at line 9 of file dwarfopen.c.

10 {
11  Dwarf *d;
12 
13  if(pe == nil){
14  werrstr("nil pe passed to dwarfopen");
15  return nil;
16  }
17 
18  d = mallocz(sizeof(Dwarf), 1);
19  if(d == nil)
20  return nil;
21 
22  d->pe = pe;
23  if(pe->loadsection(pe, ".debug_abbrev", &d->abbrev) < 0
24  || pe->loadsection(pe, ".debug_aranges", &d->aranges) < 0
25  || pe->loadsection(pe, ".debug_line", &d->line) < 0
26  || pe->loadsection(pe, ".debug_info", &d->info) < 0
27  || pe->loadsection(pe, ".debug_loc", &d->loc) < 0)
28  goto err;
29  pe->loadsection(pe, ".debug_pubnames", &d->pubnames);
30  pe->loadsection(pe, ".debug_frame", &d->frame);
31  pe->loadsection(pe, ".debug_ranges", &d->ranges);
32  pe->loadsection(pe, ".debug_str", &d->str);
33 
34  return d;
35 
36 err:
37  DPRINT("Failed to open dwarf\n");
38  free(d->abbrev.data);
39  free(d->aranges.data);
40  free(d->frame.data);
41  free(d->line.data);
42  free(d->pubnames.data);
43  free(d->ranges.data);
44  free(d->str.data);
45  free(d->info.data);
46  free(d->loc.data);
47  free(d);
48  return nil;
49 }
#define werrstr(str,...)
Definition: compat.h:34
#define free
Definition: debug_ros.c:5
#define mallocz(x, y)
Definition: compat.h:36
int(* loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b)
Definition: pe.h:22
#define err(...)
Definition: dwarf.h:436
#define nil
Definition: compat.h:23
#define DPRINT
Definition: sndvol32.h:71
#define d
Definition: ke_i.h:81

Referenced by main(), RosSymCreateFromFile(), and RosSymCreateFromMem().