Skip to main content

Posts

Showing posts with the label gcc

CGI - Common Gateway Interface

What is the first thing come to your mind, when you see... CGI? Me -- Perl. But it's actually more than Perl. Here's some examples on CGI in different languages and some setups on Ubuntu to get the web server running. To setup Apache2 in Ubuntu. This will install and run the Apache2 server : sudo apt-get install apache2 By default, the cgi directory is setup at /usr/lib/cgi-bin . Just have your cgi scripts or executable put in this directory (make sure it's executable) and it can be access via http://localhost/cgi-bin/ path. This can be modified at the config file. The default config file is at /etc/apache2/sites-available/default . The section of the file that related to this looked like this : ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> The access and error log can be found at /var/log/a...

Something about object files

This is from a long lost track. I used to deal with object files in my previous job. That was like ages ago. Is VCS still compiling the design into object files to run simulation? Anyway, thanks to Synopsys team that helped me a lot in improving my debugging skills. :) Some simple steps to create a "test case" here. Let's create a "Hello world!" object file. #include <stdio.h> void main() {     printf("Hello world!\n"); } Compile into object file. gcc < source code file name > -o < object file name > To enable debug mode, compile with -g option. With debug mode, you can set break point when running the program in gdb. OK, back to the story. These are a few commands that they taught me to investigate about the object files. To get the list of the functions in the object file. strings < object file > This one is not obvious in my test case. The strings command actually listed all the strings in the o...