The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 13, 2024, 04:18:24 am
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Trying to build uqm under qnx ;D
« previous next »
Pages: 1 [2] Print
Author Topic: Trying to build uqm under qnx ;D  (Read 7357 times)
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Trying to build uqm under qnx ;D
« Reply #15 on: June 12, 2003, 07:06:18 pm »

As for the construct_response, I think the easiest way to debug this is by looking what exactly is on the stack as the function is run.

Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Ilyak
Zebranky food
*
Offline Offline

Gender: Male
Posts: 9


I love YaBB 1G - SP1!


View Profile
Re: Trying to build uqm under qnx ;D
« Reply #16 on: June 12, 2003, 09:34:02 pm »

If you don't have it, then QNX probably does things differently. I'd
need to know how though.
==
i have got "ldd in shell script"
so, we may see:
localhost% ldd libSDL.so
       libm.so.2 =>    /lib/libm.so.2
       libph.so.2 =>   /usr/lib/libph.so.2
       libGL.so.2 =>   /usr/lib/libGL.so.2
       libasound.so.2 =>       /lib/libasound.so.2
       libc.so.2 =>    /proc/boot/libc.so.2
localhost% ldd libvorbis.so
       libc.so.2 =>    /proc/boot/libc.so.2
localhost% ldd libogg.so
       libc.so.2 =>    /proc/boot/libc.so.2

so, we can see, while 3rd-party made libSDL is linked properly, libs that came with distribution are linked really strangely.
so, we will have to have that QNX) part in config...

==
It's all in the manual page.
==
:p QNX does not have man by default... :p

==
printf works like the libc printf() function. The first argument is the
format string specifying how to interpret the rest of the options.
==
yes. and what do these 2 strings mean? i am curious, and printf is curious too...
" ? %*i. %s %s\n"
" ? %-*s ? %s (N/A) %s\n"

==
But you're right. It does look like this is what generated the 'format
errors', not sed. Why it only does that for the debug menu, I don't
know.
==
I have changed these format strings and everything went ok.
why only in menu? because, only in menu there are such strings. have not tried menus other than debug...

oh, btw. I have got OpenGL devel packages and made it with OpenGL support.
It DOES run and work but it goes TERRIBLE ;(

and, our bug:
==
Breakpoint 1, construct_response (buf=0x8339f80 "", R=58) at src/sc2code/commglue.c:240

240             fprintf(stderr, "DEBUG: We've entered into construct_response!\n");
(gdb) info stack
#0  construct_response (buf=0x8339f80 "", R=58) at src/sc2code/commglue.c:240
#1  0x08088140 in Intro () at src/sc2code/comm/comandr/comandr.c:633
#2  0x08052f76 in HailAlien () at src/sc2code/comm.c:2044
#3  0x08053396 in InitCommunication (which_comm=350231303) at src/sc2code/comm.c:2162
#4  0x0807d3e8 in VisitStarBase () at src/sc2code/starbase.c:441
#5  0x0807efbd in Starcon2Main (blah=0x8338fb0) at src/sc2code/starcon.c:926
#6  0x080ef513 in ThreadHelper (startInfo=0x8403e64) at src/sc2code/libs/threads/thrcommon.c:196
#7  0xb823088f in ?? ()
#8  0xb8230a7e in ?? ()
(gdb) next
242             va_start (vlist, R);
(gdb) next
244             fprintf(stderr, "DEBUG: R = %d\n", R);
(gdb) print vlist
$1 = 0x7f84aee "o\a@\201\b\b\200\2373\b:"
(gdb) ptype R
type = short unsigned int
==
what is strange:
1)vlist is junk
2)type of R is short unsigned int, but later program will try to R = va_arg(vlist, int);
3)i fail to understand what does work wrong...
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Trying to build uqm under qnx ;D
« Reply #17 on: June 13, 2003, 12:05:58 am »

Quote

so, we can see, while 3rd-party made libSDL is linked properly, libs that came with distribution are linked really strangely.
so, we will have to have that QNX) part in config...

Ok, then I'll add that. Is the -I/usr/local/include and -L/usr/local/lib necessary in QNX, or did you just copy them from the line from FreeBSD (on Linux, these paths are used automatically).

Quote

yes. and what do these 2 strings mean? i am curious, and printf is curious too...
" ? %*i. %s %s\n"
" ? %-*s ? %s (N/A) %s\n"

%*i is like %i (take an integer), but it reads the length of the field from an additional argument. The minus sign in the second line means left-align instead of right-align.
If any of those what your printf chokes on, I can easilly work around it.
Just let me know which one (or maybe both).

Quote

I have changed these format strings and everything went ok.
why only in menu? because, only in menu there are such strings. have not tried menus other than debug...

The main menu also is a menu, that's why I was confused. I forgot for a moment it was a different kind of menu.

Quote

oh, btw. I have got OpenGL devel packages and made it with OpenGL support.
It DOES run and work but it goes TERRIBLE ;(

OpenGL only helps if you have hardware acceleration. In Linux, only a few video drivers support it. I suspect it's even worse on QNX.

Quote

what is strange:
1)vlist is junk

It's not. It's not supposed to be point to a string. It's pointing to somewhere on the stack.

Quote

2)type of R is short unsigned int, but later program will try to R = va_arg(vlist, int);

That itself is not a problem. The number fits in a short.
What I'm wondering though if whether a complete has really been pushed on the stack. (see below)

Quote

3)i fail to understand what does work wrong...

I suspect it is a variable size issue of some sort. The easiest way to check would be to check what's on the stack.
Could you do the following from gdb, from within construct_response:
(gdb) x/40xb &R
and also:
(gdb) p sizeof no_but_well_help0

Also, I'd like to know what architechture this is? IA-32?

I noticed you visited the IRC channel, but left again after a minute.
I was there, but like many other people, we're often working on something, and don't check the IRC session every minute. It's still the best place to find us, and probably the fastest way to solve this.

Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Ilyak
Zebranky food
*
Offline Offline

Gender: Male
Posts: 9


I love YaBB 1G - SP1!


View Profile
Re: Trying to build uqm under qnx ;D
« Reply #18 on: June 13, 2003, 12:29:34 pm »

Ok, then I'll add that. Is the -I/usr/local/include and -L/usr/local/lib
necessary in QNX, or did you just copy them from the line from FreeBSD
(on Linux, these paths are used automatically).
==
You dont need. Bacause, QNX is very strange on paths anyway:
libs should be taken from /<arch>/usr/lib/ and /usr/local/lib (libvorbis would be here by default)
includes - from /opt/include

thats do work without -I -L as i see...

==
%*i is like %i (take an integer), but it reads the length of the field
from an additional argument. The minus sign in the second line means
left-align instead of right-align.
If any of those what your printf chokes on, I can easilly work around
it.
Just let me know which one (or maybe both).
==
they _both_ does not work.
but, all menus looks correctly with:
==
                       if menu_have_choice "$MENU" "$OPTION"; then
                               printf "  %i. %s %s\n" "$I" \
                                               "$SELECTED" "$TEMP_TITLE"
                       else
                               printf "  %s  %s (N/A) %s\n" "-" \
                                               "$SELECTED" "$TEMP_TITLE"
                       fi
==
=>
==
 -= Main menu =-
 1. Include debugging information        Debug info + strict compile checks
 2. OpenGL graphics support              Include OpenGL graphics support
 3. Sound backend                        Use MixSDL for sound
 4. Installation paths                   [...]

Press a number plus <ENTER> if you want to change something,
or just <ENTER> if everything is ok: 1

 -= Include debugging information =-
 1.     No debugging information
 2.     Debugging information
 3. --> Debug info + strict compile checks

Select the option you want by typing a number plus <ENTER>
or just <ENTER> if everything is ok:

 -= OpenGL graphics support =-
 1.     Don't include OpenGL graphics support
 2. --> Include OpenGL graphics support

Select the option you want by typing a number plus <ENTER>
or just <ENTER> if everything is ok:

 -= Sound backend =-
/usr/bin/ntox86-ld: cannot find -lopenal
collect2: ld returned 1 exit status
OpenAL not found.
 1. --> Use MixSDL for sound
 -      (N/A) Include OpenAL support (experimental)

Select the option you want by typing a number plus <ENTER>
or just <ENTER> if everything is ok:
==
We does not have more than 10 options, and not going to, so we can use KISS method.

==
OpenGL only helps if you have hardware acceleration.
==
Yea. We have it and it does work. How does it work - it's not our problem, SDL version looks good...
BTW, SDL itself is still beta under QNX.
"We call it beta cause it's betta when nothing"... :p
==
In Linux, only a few video drivers support it. I suspect it's even worse on QNX.
==
Sure. Qhile it's enough for Q3, btw ^^
==
(gdb) x/40xb &R
0x7f84aea:      0x3a    0x00    0x1c    0x4b    0xf8    0x07    0x40    0x81
0x7f84af2:      0x08    0x08    0x80    0x9f    0x33    0x08    0x3a    0x00
0x7f84afa:      0x00    0x00    0xaa    0xa2    0x33    0x08    0x3b    0x00
0x7f84b02:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
0x7f84b0a:      0x00    0x00    0x3c    0x4e    0xf8    0x07    0x64    0x2f

(gdb) p sizeof no_but_well_help0
$1 = 4

so, it's not that short...

but...
==
(gdb) ptype no_but_well_help0
type = enum {NULL_PHRASE, GLAD_WHEN_YOU_COME_BACK, GIVE_FUEL, GIVE_FUEL_AGAIN, ARE_YOU_SUPPLY_SHIP,
   DO_YOU_HAVE_RADIO_THIS_TIME, HERE_IS_ANOTHER_LANDER, THE_WHAT_FROM_WHERE, ABOUT_TIME,
   MESSAGE_GARBLED_1, MESSAGE_GARBLED_2, HERE_IS_A_NEW_LANDER, THIS_MAY_SEEM_SILLY, OK_THE_NAFS,
   OK_THE_CAN, OK_THE_UFW, OK_THE_NAME_IS_EMPIRE0, OK_THE_NAME_IS_EMPIRE1, FUEL_UP0, FUEL_UP1,
   WHAT_KIND_OF_IDIOT, DONT_KNOW_WHO_YOU_ARE, THATS_IMPOSSIBLE, ASK_AWAY, RADIOS_ON_MERCURY,
   THANKS_FOR_HELPING, STARBASE_IS, HAPPENED_TO_EARTH, URQUAN_LEFT, BASE_ON_MOON, ACKNOWLEDGE_SECRET,
   ABOUT_BASE, GOOD_LUCK_WITH_BASE, DEALT_WITH_BASE_YET, HERE_COMES_ILWRATH, VERY_IMPRESSIVE,
   IT_WAS_ABANDONED, YOU_REALLY_FOUGHT_BASE, IM_GLAD_YOU_WON, IM_SURE_IT_WAS_DIFFICULT, THAT_WAS_PROBE,
   DEEP_TROUBLE, GOOD_NEWS, SURE_HOPE, ABOUT_BASE_AGAIN, COOK_BUTTS, OVERTHROW_ALIENS, KILL_MONSTERS,
   GOOD_LUCK_AGAIN, STARBASE_WILL_BE_READY, overthrow_evil_aliens, annihilate_those_monsters,
   cook_their_butts, where_get_radios, well_go_get_them_now, we_will_transfer_now, what_will_you_give_us,
   before_radios_we_need_info, no_but_well_help0, no_but_well_help1, yes_this_is_supply_ship,
   what_slave_planet, i_lied, plumb_out, we_are_vindicator0, we_are_vindicator1, we_are_vindicator2,
   first_give_info, we_must_go_now, where_can_i_get_radios, ok_i_will_get_radios, whats_this_starbase,
   what_about_earth, where_are_urquan, our_mission_was_secret, we_are_here_to_help, tell_me_about_base,
   we_will_take_care_of_base, tell_me_again, base_was_abandoned, we_fought_them, oh_yes_big_fight,
   i_lied_it_was_abandoned, i_cant_talk_about_it, name_1, name_2, name_3, name_40, name_41,
   i_lost_my_lander, i_lost_another_lander, need_fuel, need_fuel_again, what_was_red_thing, it_went_away,
   we_destroyed_it, what_probe, take_care_of_base_again, goodbye_commander}
(gdb) p sizeof no_but_well_help0
$3 = 4
(gdb) ptype R
type = short unsigned int
(gdb) p sizeof R
$4 = 2
==
Something mystical... Reminds me about Arilou again...

==
Also, I'd like to know what architechture this is? IA-32?
==
Sure Wink Cause trying to get alpha version of game with beta libs on "still testing" platform is kinda tricky Wink
And i have seen non-x86 pc 2 or 3 times in my life ;p

==
I noticed you visited the IRC channel, but left again after a minute.
I was there, but like many other people, we're often working on
something, and don't check the IRC session every minute. It's still the
best place to find us, and probably the fastest way to solve this.
==
Sure ;p
I got there only to look around... I will be there, sometimes... ;p
Sorry for leaving irc; i had my phone line dead ;(
Logged
Pages: 1 [2] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!