News for hackers. Stuff that matters.
Re:Using Unix as an IDE (2012) by partycoder on Wednesday June 20, 2018 @07:40PM (#17360898)
If using LLVM, you may want to debug with lldb instead. Also with gdb you can use the tui mode.

To read the environment variables used by a program you can use

    cat /proc/{pid}/environ
update: Some of this overlaps with reverse engineering. I posted this comment yesterday about useful reverse engineering resources on Linux https://news.ycombinator.com/item?id=17342197
Re:Using Unix as an IDE (2012) by glandium on Wednesday June 20, 2018 @09:17PM (#17361288)
Note that `/proc/$pid/environ` has null bytes between the entries, so it's not very readable if you just `cat` it. So you want to filter its content, e.g.:

    tr "\0" "\n" < /proc/$pid/environ
Re:Using Unix as an IDE (2012) by laumars on Thursday June 21, 2018 @10:49AM (#17365648)
> To read the environment variables used by a program

This is only the environmental variables used when the program launches. If said program changes any environmental variables during the course of it's execution then /proc/$pid/environ wouldn't be updated to reflect that.

I expect you're already aware of this but it's worth me mentioning just in case anyone reading this thread wasn't aware.

Re:Using Unix as an IDE (2012) by samuell on Thursday June 21, 2018 @03:58AM (#17363013)
I found cgdb much easier to use and more robust when resizing the terminal than gdb+tui. Liked it so much I made a video demonstrating it's usage: https://youtu.be/OKLR6rrsBmI