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

From Valve Developer Community
< Pl
Jump to navigation Jump to search
(Created page with "{{otherlang2| | jp = Installing and Debugging the Source Code:jp | es = Installing and Debugging the Source Code:es | fr = Installing and Debugging the Source Code:fr | ru = I...")
 
m (obsolete language category)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{otherlang2|
{{LanguageBar|title = Instalowanie i usuwanie błędów w kodzie źródłowym}}
| jp = Installing and Debugging the Source Code:jp
| es = Installing and Debugging the Source Code:es
| fr = Installing and Debugging the Source Code:fr
| ru = Installing and Debugging the Source Code:ru
| pl = Installing and Debugging the Source Code:pl
| zh-cn = Installing and Debugging the Source Code:zh-cn}}


== Installing ==


# Run the [[Source SDK]] and choose ''Create a Mod''. See [[Create a Mod]] for details about the process.
== Instalacja ==
# [[Compiler Choices|Choose a compiler]]
# Go! Get started with [[Your First Entity]].


To compile your code on Linux, see [[Compiling under Linux]]. To get the latest code, see [https://github.com/ValveSoftware GitHub].
# Uruchom {{L|Source SDK}} i wybierz "Utwórz Mod". Zobacz {{L|Create a Mod}} Szczegółowe informacje na temat procesu.
# {{L|Compiler Choices|Wybierz kompilator}}
# Udać się! Zacznij korzystać z {{L|Your First Entity}}.


== Debugging ==
Do kompilacji kodu w systemie Linux, patrz {{L|Compiling under Linux|Kompilacja pod Linux}}. Aby uzyskać najnowszy kod, patrz [https://github.com/ValveSoftware GitHub].


'''Debugging''' is the process of a human examining closely the inner workings of a program. It can reveal the causes of crashes and other bugs.
== Debugowanie ==
 
'''Debugowanie''' Jest to proces człowiek bada ściśle wewnętrzne funkcjonowanie programu. Może ujawnić przyczyny awarii i innych błędów.


=== Windows ===
=== Windows ===


# Make sure you are working in the Debug configuration, not Release.
# Upewnij się, że pracuje w konfiguracji Debug nie Release.
# In the Solution Explorer (Microsoft Visual C++), right-click on the active project (the one in bold) and choose ''Properties''. It doesn't matter whether you're working with the server or client.
# W Solution Explorer (Microsoft Visual C ++), kliknij prawym przyciskiem myszy na aktywnym projekcie (jednego wytłuszczone) i wybierz '' Właściwości ''. To nie ma znaczenia, czy pracujesz z serwera lub klienta.
# In the window that appears, choose ''Debugging'' from the left-hand list.
# W oknie, które się pojawi, wybierz ''Debugowanie'' z listy po lewej stronie.
# 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>).
# Zmień ''Polecenia'' na ścieżkę do pliku exe, który chcesz uruchomić (ten sam na który działa podczas gry / mod, o którym mowa, na przykład <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>
# Change ''Argumenty polecenia '' czytać coś takiego <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>.
# Change ''Working Directory'' do folderu zawierającego plik .exe, które wybrałeś dla Komendy <code>C:\Steam\SteamApps\common\source sdk base 2007</code>.


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).
Możesz teraz nacisnąć klawisz F5 w dowolnym momencie, aby rozpocząć debugowanie. (Jeśli naprawdę chcesz debugować w trybie Release, powtórz powyższe czynności dla tej konfiguracji. Ale nie należy się spodziewać, że wyniki będą bardzo przydatne).


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:  
Ścieżek będzie specyficzne dla wersji SDK wykorzystywane. Na przykład, z Source SDK 2013, ustawienia dla pojedynczego gracza mod może być:  


     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 40: Line 35:
==== 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.
Jeśli chcesz debugować proces, który jest już uruchomiony, wybierz ''Debug> Dołącz do procesu ...'' i wybierz go z listy.


=== Linux ===
=== Linux ===
Line 58: Line 53:




[[Category:Programming]]
{{ACategory|Programming}}
[[Category:Modding]]
{{ACategory|Modding}}

Latest revision as of 03:38, 22 August 2024

English (en)Deutsch (de)Español (es)Français (fr)Italiano (it)日本語 (ja)Polski (pl)Русский (ru)中文 (zh)Translate (Translate)


Instalacja

  1. Uruchom Source SDK(en) i wybierz "Utwórz Mod". Zobacz Create a Mod(en) Szczegółowe informacje na temat procesu.
  2. Wybierz kompilator(en)
  3. Udać się! Zacznij korzystać z Your First Entity(en).

Do kompilacji kodu w systemie Linux, patrz Kompilacja pod Linux(en). Aby uzyskać najnowszy kod, patrz GitHub.

Debugowanie

Debugowanie Jest to proces człowiek bada ściśle wewnętrzne funkcjonowanie programu. Może ujawnić przyczyny awarii i innych błędów.

Windows

  1. Upewnij się, że pracuje w konfiguracji Debug nie Release.
  2. W Solution Explorer (Microsoft Visual C ++), kliknij prawym przyciskiem myszy na aktywnym projekcie (jednego wytłuszczone) i wybierz Właściwości . To nie ma znaczenia, czy pracujesz z serwera lub klienta.
  3. W oknie, które się pojawi, wybierz Debugowanie z listy po lewej stronie.
  4. Zmień Polecenia na ścieżkę do pliku exe, który chcesz uruchomić (ten sam na który działa podczas gry / mod, o którym mowa, na przykład C:\Steam\SteamApps\common\source sdk base 2007\hl2.exe).
  5. Change Argumenty polecenia czytać coś takiego -allowdebug -dev -sw -game "C:\Steam\SteamApps\SourceMods\MyMod"
  6. Change Working Directory do folderu zawierającego plik .exe, które wybrałeś dla Komendy C:\Steam\SteamApps\common\source sdk base 2007.

Możesz teraz nacisnąć klawisz F5 w dowolnym momencie, aby rozpocząć debugowanie. (Jeśli naprawdę chcesz debugować w trybie Release, powtórz powyższe czynności dla tej konfiguracji. Ale nie należy się spodziewać, że wyniki będą bardzo przydatne).

Ścieżek będzie specyficzne dla wersji SDK wykorzystywane. Na przykład, z Source SDK 2013, ustawienia dla pojedynczego gracza mod może być:

   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.pngUwaga: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.

Run-time attachment

Jeśli chcesz debugować proces, który jest już uruchomiony, wybierz Debug> Dołącz do procesu ... i wybierz go z listy.

Linux

  1. Disable OPTFLAGS in the root makefile
  2. Uncomment DEBUG in your project's makefile.
    Potwierdzić:Change it to read -O0 -g -ggdb3.
  3. Make and Install
  4. Open a terminal window and cd to the location of the executable you are running
  5. Perform gdb srcds_linux (or whatever the name is)
  6. Perform run <parameters> to start the program
  • On a crash ("segfault"), do bt ("backtrace") to see the callstack.
  • To break into the debugger, press Ctrl+C; to continue afterwards perform cont.
  • To set a breakpoint, do break <function>. See help breakpoint for more details.
  • To print an expression, do print <expr>.