[00/38] Start reorganization of DWARF code

Message ID 20200123005710.7978-1-tom@tromey.com
Headers show
Series
  • Start reorganization of DWARF code
Related show

Message

Tom Tromey Jan. 23, 2020, 12:56 a.m.
Most of the DWARF-related code in gdb is in one file, dwarf2read.c --
the single largest source file in gdb proper (I didn't check the
libraries).  As a consequence it is disorganized.

I've thought for a while that dwarf2read.c should be split up, and
this series is the start of this project.  This series does several
things:

* Splits some code out of dwarf2read.c into new files;
* In one or two cases, unifies code that is duplicated;
* Moves all the DWARF-related code to a subdirectory;
* Cleans up various APIs in small ways (like turning functions into
  methods on the appropriate class);
* Fixes a few minor bugs (I got distracted mid-series by moving hash
  tables off the objfile obstack, a gdb practice that's bothered me
  for years).

This series only shrinks dwarf2read.c from 26279 lines to 24744.  So,
there's clearly still much more to do.  The line number program state
machine or the macro-reading code seem like good candidates for
splitting out.

Tested by the buildbot.

Tom

Comments

Simon Marchi Feb. 8, 2020, 5:38 p.m. | #1
On 2020-01-22 7:56 p.m., Tom Tromey wrote:
> Most of the DWARF-related code in gdb is in one file, dwarf2read.c --

> the single largest source file in gdb proper (I didn't check the

> libraries).  As a consequence it is disorganized.

> 

> I've thought for a while that dwarf2read.c should be split up, and

> this series is the start of this project.  This series does several

> things:

> 

> * Splits some code out of dwarf2read.c into new files;

> * In one or two cases, unifies code that is duplicated;

> * Moves all the DWARF-related code to a subdirectory;

> * Cleans up various APIs in small ways (like turning functions into

>   methods on the appropriate class);

> * Fixes a few minor bugs (I got distracted mid-series by moving hash

>   tables off the objfile obstack, a gdb practice that's bothered me

>   for years).

> 

> This series only shrinks dwarf2read.c from 26279 lines to 24744.  So,

> there's clearly still much more to do.  The line number program state

> machine or the macro-reading code seem like good candidates for

> splitting out.

> 

> Tested by the buildbot.

> 

> Tom


Hi Tom,

I've looked through the series, I think this is very nice and I agree with
all the changes you did.  Impressive work!

Simon
Tom Tromey Feb. 8, 2020, 8:45 p.m. | #2
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:


Simon> I've looked through the series, I think this is very nice and I
Simon> agree with all the changes you did.  Impressive work!

Thanks.

I've fixed up the two things you pointed out, and I am going to commit
it shortly.

Tom