delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/20/01:01:56

Date: Mon, 20 Jan 2003 00:11:37 -0500
Message-Id: <200301200511.h0K5BbK27575@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <b0ff15$lql$1@news.online.de> (lars.o.hansen@gmx.de)
Subject: Re: several questions (symify, dynamic labels, cpu clock)
References: <b0ff15$lql$1 AT news DOT online DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 1. when running symify on a crashed program that was compiled with -g
> without -s I "get" the last called functions. Next to them are numbers.
> Are these supposed to be the source code line number where the C "instruction"
> is that was last executed before the crash?  Because they aren't. (at least
> for me)

Symify prints the binary address (the 0x... number), the function
name, an optional offset into the function (another binary address),
and optionally the file and line info (as "line 12 of foo.c").

> 2. how can I get the address of a dynamic label which is in a function I am
> not in? So if I am somewhere in int main() and want the address of the dynamic
> label in function void do_nothing(void){dynalabel1: asm nop;} (actually labels
> are not dynamic, gotos can be), what do I have to do?

Either you use '&&label' inside that function to reference it, or you
just can't do it.  Labels are not real once gcc is done with them, and
there's only certain ways you can reference them.  The GCC manual has
more info.

> 3. is CLOCKS_PER_SEC the clock speed of the cpu, so for example 1,533,000,000
> on an AthlonXP 1800+ ? (or 1,533,...("exact").)  If not, is there a C standard
> library (or djgpp one) function which gets me this value?

CLOCKS_PER_SEC is nothing more than a scale for processing the result
of clock().  It has nothing to do with the CPU frequency in djgpp.
There are no DJGPP functions which tell you the CPU clock frequency.
You may be able to use the RDTSC opcode to determine the CPU clock
frequency, if you write the test code in assembler.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019