Dear Dave, Thanks for sharing all of that! It was very helpful to read it over again, and it was helpful in IRC yesterday.
As a bit of a "that was strange" moment, I ran the builds again and did NOT do --disable-bootstrap with the patch on a different machine. They built and ran fine, with no segfaults during calls to error(...). I probably forgot to properly clean/build something in my debugging environment, which caused most of the problems. I already assigned my Copyright to the FSF, so that part should be fine! Is there anything else I should be doing? Sincerely, JeanHeyd On Wed, Oct 16, 2019 at 8:51 AM David Malcolm <dmalc...@redhat.com> wrote: > > On Tue, 2019-10-15 at 20:31 -0400, JeanHeyd Meneide wrote: > > Attached is a patch for p1301 that improves in the way Jason Merrill > > specified earlier > > (https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00858.html), but it > > keeps segfaulting on my build of GCC. I don't know what changes I've > > made that cause it to segfault: it does so whenever the error() > > function is called but the backtraces aren't showing me anything > > conclusive. > > > > The tests test what I expect them to and the output is fine, I just > > can't get the segfaults to stop, so I'm putting the patch up so > > someone can critique what I've written, or someone else to test it > > too. Sorry for taking so long. > > > > Thanks, > > JeanHeyd > > Thanks for posting these patches. > > I believe you're a new GCC contributor - welcome! > > Having said "welcome", for good or ill, GCC has some legalese that we > have to follow - to get a patch accepted, see the "Legal Prerequisites" > section of: https://gcc.gnu.org/contribute.html so you'll need to > follow that at some point (I hate having to say this). > > I got the impression on IRC yesterday that you were having some trouble > getting your debugging environment set up - it sounded to me like > you've been "making do" by adding print statements to the parser and > recompiling each time. > > If that's the case, then the best next step is probably to figure out > how to get you debugging cc1plus using a debugger. > > Normally, I run: > ./xgcc -B. > and add "-wrapper gdb,--args" to the command line so that the driver > invokes gdb. > > Another way is to invoke gdb and have it directly invoke cc1plus: > gdb --args ./cc1plus -quiet x.C > > In both cases, run it from <your-build-dir>/gcc > > See also: > https://dmalcolm.fedorapeople.org/gcc/newbies-guide/debugging.html > which has further hints and info on a "nicer" debugging experience. > > You mentioned that you normally use gdbserver, which makes me think > that you're most comfortable using gdb from an IDE. I'm not very > familiar with gdbserver, but hopefully someone here knows the recipe > for this that will let you comfortably debug the frontend - without > needing to add print statements and recompile each time (ugh). > > Note that for hacking on the frontend and debugging, I normally > configure gcc with --disable-bootstrap which saves a *lot* of time; > similarly I also only build the "gcc" subdirectory and its dependencies > (I still do a full bootstrap and regression test in a separate > directory once I've got a candidate patch that I want to test properly > before submitting to the mailing list). > > [I know that you know some/all of this, but I'm posting it here for the > benefit of people reading the list archives] > > Hope this is helpful, and welcome again. > Dave > >