It/Installing and Debugging the Source Code: Difference between revisions

From Valve Developer Community
< It
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
# Nella Solution Explorer (Microsoft Visual C++), fai tasto destro sul progetto attivo (quello col grassetto) e scegli "Properties". Non importa se stai lavorando con il server o col client.
# Nella Solution Explorer (Microsoft Visual C++), fai tasto destro sul progetto attivo (quello col grassetto) e scegli "Properties". Non importa se stai lavorando con il server o col client.
# Nella finestra che appare scegli "Debugging".
# Nella finestra che appare scegli "Debugging".
# Change ''Command'' to the path to the .exe file you want to launch (the same on that runs when you play the game/mod in question, e.g. <code>C:\Steam\SteamApps\common\source sdk base 2007\hl2.exe</code>).
# Cambia "Command" mettendoci il percorso del .exe che vuoi avviare (quello che si avvia quando giochi il tuo gioco/mod es. <code>C:\Steam\SteamApps\common\source sdk base 2007\hl2.exe</code>).
# Change ''Command Arguments'' to read something like <code>-allowdebug -dev -sw -game "C:\Steam\SteamApps\SourceMods\MyMod"</code>
# Cambia "'Command Arguments'' con qualcosa simile a <code>-allowdebug -dev -sw -game "C:\Steam\SteamApps\SourceMods\MyMod"</code>
# Change ''Working Directory'' to the folder containing the .exe you chose for Command e.g. <code>C:\Steam\SteamApps\common\source sdk base 2007</code>.
# Cambia "Working Directory'' alla cartella che contiene il .exe come quello che hai scelto su Command es. <code>C:\Steam\SteamApps\common\source sdk base 2007</code>
Adesso puoi preme F5 in qualsiasi momento e fare Debugging.. (Se davvero vuoi fare debugging in modalitá Release, ripeti le configurazioni sopra. Ma non aspettarti che i risultati siano utili).


You can now press F5 at any time to start debugging. (If you really do want to debug in Release mode, repeat the above for that configuration. But don't expect the results to be very useful).
Il percorso sará unico al SDK usato.  
 
The paths will be unique to the version of the SDK being used. For example, with Source SDK 2013, the settings for a single player mod might be:


     Command:          C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\hl2.exe
     Command:          C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\hl2.exe
Line 36: Line 35:
     Working Directory: C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\
     Working Directory: C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\


{{note|You will be told that symbols could not be found for <whatever>.exe - this is normal, as you don't have that source code. Ignore the warning.}}
{{note|Sarai notificato che i simboli non saranno trovati <qualcosa>.exe - questo é normale, perché non hai il codice sorgente, ignore l'avviso}}


==== Run-time attachment ====
==== Run-time attachment ====


If you want to debug a process that is already running, choose ''Debug > Attach to Process...'' and select it from the list.
If you want to debug a process that is already running, choose ''Debug > Attach to Process...'' and select it from the list.
=== Linux ===
# Disable OPTFLAGS in the root makefile
# Uncomment DEBUG in your project's makefile. {{confirm|Change it to read <code>-O0 -g -ggdb3</code>.}}
# Make and Install
# Open a terminal window and cd to the location of the executable you are running
<!-- not needed, and bad? # Perform <code>export LD_LIBRARY_PATH=".:bin:$LD_LIBRARY_PATH"</code> -->
# Perform <code>gdb srcds_linux</code> (or whatever the name is)
# Perform <code>run <parameters></code> to start the program
* On a crash ("segfault"), do <code>bt</code> ("backtrace") to see the callstack.
* To break into the debugger, press {{key|Ctrl+C}}; to continue afterwards perform <code>cont</code>.
* To set a breakpoint, do <code>break <function></code>. See <code>help breakpoint</code> for more details.
* To print an expression, do <code>print <expr></code>.




[[Category:Programming]]
[[Category:Programming]]
[[Category:Modding]]
[[Category:Modding]]

Revision as of 17:48, 1 March 2019

Template:Otherlang2

Installing

  1. Avvia il Source SDK e scegli "Create Mod". Guarda Creare una mod per più informazioni.
  2. Scegli un compiler
  3. Inizia con la Tua prima entitá.

Per compilare il tuo codice con Linux, guarda Compilare con Linux. Per ottenere il codice più recente guarda GitHub.

Debugging

Debugging' é il processo di una persona che osserva il funzionamento del Programma. Può rivelare il motivo di crash e bug.

Windows

  1. Sii sicuro che stai lavorando con la configurazione Debug, anziche Release.
  2. Nella Solution Explorer (Microsoft Visual C++), fai tasto destro sul progetto attivo (quello col grassetto) e scegli "Properties". Non importa se stai lavorando con il server o col client.
  3. Nella finestra che appare scegli "Debugging".
  4. Cambia "Command" mettendoci il percorso del .exe che vuoi avviare (quello che si avvia quando giochi il tuo gioco/mod es. C:\Steam\SteamApps\common\source sdk base 2007\hl2.exe).
  5. Cambia "'Command Arguments con qualcosa simile a -allowdebug -dev -sw -game "C:\Steam\SteamApps\SourceMods\MyMod"
  6. Cambia "Working Directory alla cartella che contiene il .exe come quello che hai scelto su Command es. C:\Steam\SteamApps\common\source sdk base 2007

Adesso puoi preme F5 in qualsiasi momento e fare Debugging.. (Se davvero vuoi fare debugging in modalitá Release, ripeti le configurazioni sopra. Ma non aspettarti che i risultati siano utili).

Il percorso sará unico al SDK usato.

   Command:           C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\hl2.exe
   Command Arguments: -allowdebug -dev -sw -condebug -console -toconsole -game "C:\My_Mod\source-sdk-2013\sp\game\mod_hl2" +map my_map
   Working Directory: C:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\
Note.pngNota:Sarai notificato che i simboli non saranno trovati <qualcosa>.exe - questo é normale, perché non hai il codice sorgente, ignore l'avviso

Run-time attachment

If you want to debug a process that is already running, choose Debug > Attach to Process... and select it from the list.