[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] A few question
From: |
Kieron Dunbar |
Subject: |
Re: [Tinycc-devel] A few question |
Date: |
Wed, 12 Feb 2003 16:58:17 +0000 |
Once upon a time, Peter Finderup Lund wrote thus:
> On Wed, 12 Feb 2003, Kieron Dunbar wrote:
>> #0 0x081acc92 in bound_error ()
> What if you try without tcc's bounds checking?
It works fine then (although I can crash gdb by asking it to set a breakpoint).
>> If I replace the strcpy() in user_name() with sprintf(), it crashes at the
>> same point with:
> Okay, so you actually /do/ know where in your code it happens? A code
> snippet would be oh so extremely useful :)
I do now. The code in question isn't that useful, as simply calling that code
gives no error. In any case, it's:
void user_name(char *buf, int id)
{
struct passwd *pw;
/* Look up the user name */
if ((pw = getpwuid(id)))
{
(void)strcpy(buf, pw->pw_name);
buf[16] = '\0';
...
where buf is a global 32 character array.
> otherwise it would be so slow as to be unusable on many programs. It
> looks like it has some problems with the house keeping...
I don't know what the problem is, but I haven't found tcc programs to work
properly in gdb in general. For instance, "int main(void) { return 0; }" gives
the following error if I step through it to the end of the program:
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0x1: Input/output error.
The same program may be running in another process.
I haven't tried running other complicated programs with it because it tends to
run into problems with them (e.g. it includes most of stdbool.h, but not all of
it).
--
kwaheri, Kieron
- [Tinycc-devel] A few question, Kieron Dunbar, 2003/02/10
- Re: [Tinycc-devel] A few question, Peter Finderup Lund, 2003/02/11
- Re: [Tinycc-devel] A few question, Kieron Dunbar, 2003/02/11
- Re: [Tinycc-devel] A few question, Peter Finderup Lund, 2003/02/11
- Re: [Tinycc-devel] A few question, Kieron Dunbar, 2003/02/12
- Re: [Tinycc-devel] A few question, Peter Finderup Lund, 2003/02/12
- Re: [Tinycc-devel] A few question,
Kieron Dunbar <=
- [Tinycc-devel] 0.9.16 segfault, Nigel Horne, 2003/02/18
- [Tinycc-devel] ASM - Error, Jens Arm, 2003/02/20
- Re: [Tinycc-devel] ASM - Error, Fabrice Bellard, 2003/02/20
- Re: [Tinycc-devel] ASM - Error, Jens Arm, 2003/02/21
Re: [Tinycc-devel] A few question, Nigel Horne, 2003/02/11