Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: kuba@witominska.net
Cc: gdb@sourceware.org
Subject: Re: Style and navigation in project question(?)
Date: Fri, 07 Sep 2018 22:34:00 -0000	[thread overview]
Message-ID: <87in3huec1.fsf@tromey.com> (raw)
In-Reply-To: <c78a497c8491dc24ee75960eec1807d2.squirrel@poczta.uirs.pl>	(kuba@witominska.net's message of "Thu, 6 Sep 2018 14:21:06 +0200")

>>>>> ">" == kuba  <kuba@witominska.net> writes:

>> I'm new in this project and for beginning  I want to figure out how to fix
>> this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23182

Hi.  We talked on irc but I figured that a reply on the list would also
be good for posterity.

>> 1. Trying to figure out what function can make problems I jump into print
>> and slowly go back. Reading code of those function I saw style problems
>> like
>>  int x;
>>  ...
>>  if (x) ...
>> or
>> if(a==b)
>>    /* it's ok to be a and b equal*/
>>    return a+b;
>> Is better to not touch them or add  !=0 or {}  as said in style documents?
>> (this one:
>> https://sourceware.org/gdb/wiki/Internals%20GDB-Testsuite-Coding-Standards

Normally existing code is just left as-is, unless you happen to be
touching that line.  Sometimes a reviewer might ask for a small change
in the context, but (I think) normally not -- though reindenting
something obviously wrong might be an exception.

>> 2. Its so big and I feel a bit lost. I found those  "print"  by luck and
>> guess. Is there any kind of map that can help me to find eg. actually
>> function that look for Fortran array, and try to print it? Or what
>> document I miss and should read?

gdb is a reasonably sized program and so one has to learn to navigate
it.  It is regular in its own way but this is not always written down.

Per-language code tends to be in files named after the language, so
ada-lang.c or rust-exp.y.  For Fortran the prefix is "f".  Convention
for most languages is that specialized printing code is in *-valprint,
so for Fortran array printing you want to start with f-valprint.c.

A language is defined by a structure in language.h.  So you can also
find most of the various callbacks by reading this structure and then
searching for instances of the structure.  This would take you to
f-lang.c:f_language_defn, which has a pointer to f_val_print -- the
primary entry point to Fortran value-printing.

There are other navigation rules like this.  Perhaps we could resurrect
that part of the old internals manual, if there was such a part, on the
wiki.

>> 3. It should be first question, but em I ask those two above in right place?

I don't understand this one, sorry, but you are welcome to ask questions
here or on irc.

Tom


      reply	other threads:[~2018-09-07 22:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 12:21 kuba
2018-09-07 22:34 ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87in3huec1.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=kuba@witominska.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox